diff --git a/.prettierignore b/.prettierignore index 3f7bbbd2b..10997bab0 100644 --- a/.prettierignore +++ b/.prettierignore @@ -13,3 +13,4 @@ markdown package.json package.lock.json +tsdoc-metadata.json diff --git a/dist/bitburner.d.ts b/dist/bitburner.d.ts index 3fce41e28..a547348c9 100644 --- a/dist/bitburner.d.ts +++ b/dist/bitburner.d.ts @@ -505,10 +505,10 @@ export declare interface Bladeburner { * Returns the estimated number of Synthoids in the specified city, * or -1 if an invalid city was specified. * - * @param cityName - Name of city. Case-sensitive + * @param city - Name of city. Case-sensitive * @returns Estimated number of Synthoids in the specified city. */ - getCityEstimatedPopulation(name: string): number; + getCityEstimatedPopulation(city: CityName | `${CityName}`): number; /** * Get number of communities in a city. @@ -518,10 +518,10 @@ export declare interface Bladeburner { * Returns the estimated number of Synthoid communities in the specified city, * or -1 if an invalid city was specified. * - * @param cityName - Name of city. Case-sensitive + * @param city - Name of city. Case-sensitive * @returns Number of Synthoids communities in the specified city. */ - getCityCommunities(name: string): number; + getCityCommunities(city: CityName | `${CityName}`): number; /** * Get chaos of a city. @@ -531,10 +531,10 @@ export declare interface Bladeburner { * Returns the chaos in the specified city, * or -1 if an invalid city was specified. * - * @param cityName - Name of city. Case-sensitive + * @param city - Name of city. Case-sensitive * @returns Chaos in the specified city. */ - getCityChaos(name: string): number; + getCityChaos(city: CityName | `${CityName}`): number; /** * Get current city. @@ -545,7 +545,7 @@ export declare interface Bladeburner { * * @returns City that the player is currently in (for Bladeburner). */ - getCity(): string; + getCity(): CityName; /** * Travel to another city in bladeburner. @@ -555,10 +555,10 @@ export declare interface Bladeburner { * * Returns true if successful, and false otherwise * - * @param cityName - Name of city. Case-sensitive + * @param city - Name of city. Case-sensitive * @returns true if successful, and false otherwise */ - switchCity(name: string): boolean; + switchCity(city: CityName | `${CityName}`): boolean; /** * Get bladeburner stamina. @@ -651,6 +651,17 @@ export declare interface BladeburnerCurAction { name: string; } +/** Names of all cities + * @public */ +export declare enum CityName { + Aevum = "Aevum", + Chongqing = "Chongqing", + Sector12 = "Sector-12", + NewTokyo = "New Tokyo", + Ishima = "Ishima", + Volhaven = "Volhaven", +} + /** * Coding Contract API * @public @@ -768,59 +779,144 @@ export declare interface CodingContract { */ export declare type CodingContractData = any; -/** @public */ -export declare enum CompanyPosName { - sw0 = "Software Engineering Intern", - sw1 = "Junior Software Engineer", - sw2 = "Senior Software Engineer", - sw3 = "Lead Software Developer", - sw4 = "Head of Software", - sw5 = "Head of Engineering", - sw6 = "Vice President of Technology", - sw7 = "Chief Technology Officer", - IT0 = "IT Intern", - IT1 = "IT Analyst", - IT2 = "IT Manager", - IT3 = "Systems Administrator", - secEng = "Security Engineer", - netEng0 = "Network Engineer", - netEng1 = "Network Administrator", - bus0 = "Business Intern", - bus1 = "Business Analyst", - bus2 = "Business Manager", - bus3 = "Operations Manager", - bus4 = "Chief Financial Officer", - bus5 = "Chief Executive Officer", - sec0 = "Police Officer", - sec1 = "Police Chief", - sec2 = "Security Guard", - sec3 = "Security Officer", - sec4 = "Security Supervisor", - sec5 = "Head of Security", - agent0 = "Field Agent", - agent1 = "Secret Agent", - agent2 = "Special Operative", - waiter = "Waiter", - employee = "Employee", - softCons0 = "Software Consultant", - softCons1 = "Senior Software Consultant", - busCons0 = "Business Consultant", - busCons1 = "Senior Business Consultant", - waiterPT = "Part-time Waiter", - employeePT = "Part-time Employee", +/** + * Corporation related constants + * @public + */ +export declare interface CorpConstants { + /** Names of all corporation game states */ + stateNames: CorpStateName[]; + /** Names of all industries */ + industryNames: CorpIndustryName[]; + /** Names of all materials */ + materialNames: CorpMaterialName[]; + /** Names of all one-time corporation-wide unlocks */ + unlockNames: CorpUnlockName[]; + /** Names of all corporation-wide upgrades */ + upgradeNames: CorpUpgradeName[]; + /** Names of all researches common to all industries */ + researchNamesBase: CorpResearchName[]; + /** Names of all researches only available to product industries */ + researchNamesProductOnly: CorpResearchName[]; + /** Names of all researches */ + researchNames: CorpResearchName[]; + initialShares: number; + /** When selling large number of shares, price is dynamically updated for every batch of this amount */ + sharesPerPriceUpdate: number; + /** Cooldown for issue new shares cooldown in game cycles (1 game cycle = 200ms) */ + issueNewSharesCooldown: number; + /** Cooldown for selling shares in game cycles (1 game cycle = 200ms) */ + sellSharesCooldown: number; + coffeeCostPerEmployee: number; + gameCyclesPerMarketCycle: number; + gameCyclesPerCorpStateCycle: number; + secondsPerMarketCycle: number; + warehouseInitialCost: number; + warehouseInitialSize: number; + warehouseSizeUpgradeCostBase: number; + officeInitialCost: number; + officeInitialSize: number; + officeSizeUpgradeCostBase: number; + bribeThreshold: number; + bribeAmountPerReputation: number; + baseProductProfitMult: number; + dividendMaxRate: number; + /** Conversion factor for employee stats to initial salary */ + employeeSalaryMultiplier: number; + marketCyclesPerEmployeeRaise: number; + employeeRaiseAmount: number; + /** Max products for a division without upgrades */ + maxProductsBase: number; } +/** @public */ +export declare type CorpEmployeePosition = +| "Operations" +| "Engineer" +| "Business" +| "Management" +| "Research & Development" +| "Training" +| "Unassigned"; + +/** Data for an individual industry + * @public */ +export declare interface CorpIndustryData { + startingCost: number; + description: string; + product?: CorpProductData; + recommendStarting: boolean; + requiredMaterials: Partial>; + /** Real estate factor */ + realEstateFactor?: number; + /** Scientific research factor (affects quality) */ + scienceFactor?: number; + /** Hardware factor */ + hardwareFactor?: number; + /** Robots factor */ + robotFactor?: number; + /** AI Cores factor */ + aiCoreFactor?: number; + /** Advertising factor (affects sales) */ + advertisingFactor?: number; + producedMaterials?: CorpMaterialName[]; +} + +/** @public */ +export declare type CorpIndustryName = +| "Energy" +| "Water Utilities" +| "Agriculture" +| "Fishing" +| "Mining" +| "Food" +| "Tobacco" +| "Chemical" +| "Pharmaceutical" +| "Computer Hardware" +| "Robotics" +| "Software" +| "Healthcare" +| "Real Estate"; + +/** + * Corporation material information + * @public + */ +export declare interface CorpMaterialConstantData { + /** Name of the material */ + name: string; + /** Size of the material */ + size: number; + demandBase: number; + /** Min and max demand */ + demandRange: [min: number, max: number]; + competitionBase: number; + competitionRange: [min: number, max: number]; + baseCost: number; + maxVolatility: number; + baseMarkup: number; +} + +/** @public */ +export declare type CorpMaterialName = +| "Water" +| "Energy" +| "Food" +| "Plants" +| "Metal" +| "Hardware" +| "Chemicals" +| "Drugs" +| "Robots" +| "AI Cores" +| "Real Estate"; + /** * Corporation API * @public */ export declare interface Corporation extends WarehouseAPI, OfficeAPI { - /** Enums specific to the corporation game mechanic. */ - enums: { - EmployeePositions: typeof EmployeePositions; - IndustryType: typeof IndustryType; - }; - /** Returns whether the player has a corporation. Does not require API access. * @returns whether the player has a corporation */ hasCorporation(): boolean; @@ -851,34 +947,19 @@ export declare interface Corporation extends WarehouseAPI, OfficeAPI { * @returns cost of the upgrade */ getUpgradeLevelCost(upgradeName: string): number; - /** Gets the cost to expand into a new industry - * @param industryName - Name of the industry - * @returns cost */ - getExpandIndustryCost(industryName: IndustryType | `${IndustryType}`): number; - - /** Gets the cost to expand into a new city - * @returns cost */ - getExpandCityCost(): number; - /** Get an offer for investment based on you companies current valuation * @returns An offer of investment */ getInvestmentOffer(): InvestmentOffer; - /** Get list of materials - * @returns material names */ - getMaterialNames(): string[]; + /** Get corporation related constants + * @returns corporation related constants */ + getConstants(): CorpConstants; - /** Get list of one-time unlockable upgrades - * @returns unlockable upgrades names */ - getUnlockables(): string[]; + /** Get constant industry definition data for a specific industry */ + getIndustryData(industryName: CorpIndustryName): CorpIndustryData; - /** Get list of upgrade names - * @returns upgrade names */ - getUpgradeNames(): string[]; - - /** Get list of research names - * @returns research names */ - getResearchNames(): string[]; + /** Get constant data for a specific material */ + getMaterialData(materialName: CorpMaterialName): CorpMaterialConstantData; /** Accept investment based on you companies current valuation * @remarks @@ -909,12 +990,12 @@ export declare interface Corporation extends WarehouseAPI, OfficeAPI { /** Expand to a new industry * @param industryType - Name of the industry * @param divisionName - Name of the division */ - expandIndustry(industryType: IndustryType | `${IndustryType}`, divisionName: string): void; + expandIndustry(industryType: CorpIndustryName, divisionName: string): void; /** Expand to a new city * @param divisionName - Name of the division - * @param cityName - Name of the city */ - expandCity(divisionName: string, cityName: string): void; + * @param city - Name of the city */ + expandCity(divisionName: string, city: CityName | `${CityName}`): void; /** Unlock an upgrade * @param upgradeName - Name of the upgrade */ @@ -928,6 +1009,11 @@ export declare interface Corporation extends WarehouseAPI, OfficeAPI { * @param rate - Fraction of profit to issue as dividends. */ issueDividends(rate: number): void; + /** Issue new shares + * @param amount - Number of new shares to issue, will be rounded to nearest 10m. Defaults to max amount. + * @returns Amount of funds generated for the corporation. */ + issueNewShares(amount?: number): number; + /** Buyback Shares * @param amount - Amount of shares to buy back. */ buyBackShares(amount: number): void; @@ -976,10 +1062,84 @@ export declare interface CorporationInfo { dividendEarnings: number; /** State of the corporation. Possible states are START, PURCHASE, PRODUCTION, SALE, EXPORT. */ state: string; - /** Array of all divisions */ - divisions: Division[]; + /** Array of all division names */ + divisions: string[]; } +/** Product rating information + * @public */ +export declare type CorpProductData = { + /** Name of the product */ + name: string; + /** Verb used to describe creation of the product */ + verb: string; + /** Description of product creation */ + desc: string; + /** Weighting factors for product */ + ratingWeights: { + aesthetics?: number; + durability?: number; + features?: number; + quality?: number; + performance?: number; + reliability?: number; + }; +}; + +/** @public */ +export declare type CorpResearchName = +| "Hi-Tech R&D Laboratory" +| "AutoBrew" +| "AutoPartyManager" +| "Automatic Drug Administration" +| "Bulk Purchasing" +| "CPH4 Injections" +| "Drones" +| "Drones - Assembly" +| "Drones - Transport" +| "Go-Juice" +| "HRBuddy-Recruitment" +| "HRBuddy-Training" +| "JoyWire" +| "Market-TA.I" +| "Market-TA.II" +| "Overclock" +| "Self-Correcting Assemblers" +| "Sti.mu" +| "uPgrade: Capacity.I" +| "uPgrade: Capacity.II" +| "uPgrade: Dashboard" +| "uPgrade: Fulcrum" +| "sudo.Assist"; + +/** @public */ +export declare type CorpStateName = "START" | "PURCHASE" | "PRODUCTION" | "SALE" | "EXPORT"; + +/** @public */ +export declare type CorpUnlockName = +| "Export" +| "Smart Supply" +| "Market Research - Demand" +| "Market Data - Competition" +| "VeChain" +| "Shady Accounting" +| "Government Partnership" +| "Warehouse API" +| "Office API"; + +/** @public */ +export declare type CorpUpgradeName = +| "Smart Factories" +| "Smart Storage" +| "DreamSense" +| "Wilson Analytics" +| "Nuoptimal Nootropic Injector Implants" +| "Speech Processor Implants" +| "Neural Accelerators" +| "FocusWires" +| "ABC SalesBots" +| "Project Insight"; + /** * Data representing the internal values of a crime. * @public @@ -1049,7 +1209,7 @@ export declare interface Division { /** Name of the division */ name: string; /** Type of division, like Agriculture */ - type: string; + type: CorpIndustryName; /** Awareness of the division */ awareness: number; /** Popularity of the division */ @@ -1069,24 +1229,13 @@ export declare interface Division { /** All research bought */ upgrades: number[]; /** Cities in which this division has expanded */ - cities: string[]; + cities: CityName[]; /** Products developed by this division */ products: string[]; /** Whether the industry this division is in is capable of making products */ makesProducts: boolean; } -/** @public */ -export declare enum EmployeePositions { - Operations = "Operations", - Engineer = "Engineer", - Business = "Business", - Management = "Management", - RandD = "Research & Development", - Training = "Training", - Unassigned = "Unassigned", -} - /** * Object representing data representing a gang member equipment. * @public @@ -1114,7 +1263,7 @@ export declare interface Export { /** Division the material is being exported to */ div: string; /** City the material is being exported to */ - loc: string; + loc: CityName; /** Amount of material exported */ amt: string; } @@ -2396,26 +2545,29 @@ export declare interface HP { /** @public */ export declare interface ILocation { - city: string; - name: string; + city: CityName; + name: LocationName; } -/** @public */ -export declare enum IndustryType { - Energy = "Energy", - Utilities = "Water Utilities", - Agriculture = "Agriculture", - Fishing = "Fishing", - Mining = "Mining", - Food = "Food", - Tobacco = "Tobacco", - Chemical = "Chemical", - Pharmaceutical = "Pharmaceutical", - Computers = "Computer Hardware", - Robotics = "Robotics", - Software = "Software", - Healthcare = "Healthcare", - RealEstate = "RealEstate", +/** + * Corporation industry information + * @public + */ +export declare interface IndustryData { + /** Industry type */ + type: CorpIndustryName; + /** Cost to expand to the division */ + cost: number; + /** Materials required for production and their amounts */ + requiredMaterials: Record; + /** Materials produced */ + producedMaterials?: string[]; + /** Whether the division makes materials */ + makesMaterials: boolean; + /** Whether the division makes products */ + makesProducts: boolean; + /** Product type */ + productType?: string; } /** @@ -2477,6 +2629,48 @@ export declare interface IStyleSettings { lineHeight: number; } +/** @public */ +export declare enum JobName { + software0 = "Software Engineering Intern", + software1 = "Junior Software Engineer", + software2 = "Senior Software Engineer", + software3 = "Lead Software Developer", + software4 = "Head of Software", + software5 = "Head of Engineering", + software6 = "Vice President of Technology", + software7 = "Chief Technology Officer", + IT0 = "IT Intern", + IT1 = "IT Analyst", + IT2 = "IT Manager", + IT3 = "Systems Administrator", + securityEng = "Security Engineer", + networkEng0 = "Network Engineer", + networkEng1 = "Network Administrator", + business0 = "Business Intern", + business1 = "Business Analyst", + business2 = "Business Manager", + business3 = "Operations Manager", + business4 = "Chief Financial Officer", + business5 = "Chief Executive Officer", + security0 = "Police Officer", + security1 = "Police Chief", + security2 = "Security Guard", + security3 = "Security Officer", + security4 = "Security Supervisor", + security5 = "Head of Security", + agent0 = "Field Agent", + agent1 = "Secret Agent", + agent2 = "Special Operative", + waiter = "Waiter", + employee = "Employee", + softwareConsult0 = "Software Consultant", + softwareConsult1 = "Senior Software Consultant", + businessConsult0 = "Business Consultant", + businessConsult1 = "Senior Business Consultant", + waiterPT = "Part-time Waiter", + employeePT = "Part-time Employee", +} + /** Names of all locations * @public */ export declare enum LocationName { @@ -2551,7 +2745,7 @@ export declare enum LocationName { */ export declare interface Material { /** Name of the material */ - name: string; + name: CorpMaterialName; /** Amount of material */ qty: number; /** Quality of the material */ @@ -2912,6 +3106,9 @@ export declare interface NS { */ readonly args: (string | number | boolean)[]; + /** The current script's PID */ + readonly pid: number; + /** * Steal a server's money. * @remarks @@ -3975,7 +4172,7 @@ export declare interface NS { * const files = ["hack.js","weaken.js","grow.js"]; * ns.scp(files, server, "home"); * ``` - * @param files - Filename or an array of filenames of script/literature files to copy. + * @param files - Filename or an array of filenames of script/literature files to copy. Note that if a file is located in a subdirectory, the filename must include the leading `/`. * @param destination - Hostname of the destination server, which is the server to which the file will be copied. * @param source - Hostname of the source server, which is the server from which the file will be copied. This argument is optional and if it’s omitted the source will be the current server. * @returns True if the file is successfully copied over and false otherwise. If the files argument is an array then this function will return false if any of the operations failed. @@ -4073,7 +4270,7 @@ export declare interface NS { /** * Get hacking related multipliers. * @remarks - * RAM cost: 4 GB + * RAM cost: 0.25 GB * * Returns an object containing the Player’s hacking related multipliers. * These multipliers are returned in fractional forms, not percentages @@ -4102,7 +4299,7 @@ export declare interface NS { /** * Get hacknet related multipliers. * @remarks - * RAM cost: 4 GB + * RAM cost: 0.25 GB * * Returns an object containing the Player’s hacknet related multipliers. * These multipliers are returned in fractional forms, not percentages @@ -5217,13 +5414,14 @@ export declare interface NS { /** @public */ export declare type NSEnums = { - toast: typeof ToastVariant; + CityName: typeof CityName; CrimeType: typeof CrimeType; FactionWorkType: typeof FactionWorkType; GymType: typeof GymType; - UniversityClassType: typeof UniversityClassType; - CompanyPosName: typeof CompanyPosName; + JobName: typeof JobName; LocationName: typeof LocationName; + ToastVariant: typeof ToastVariant; + UniversityClassType: typeof UniversityClassType; }; /** @@ -5232,7 +5430,7 @@ export declare type NSEnums = { */ export declare interface Office { /** City of the office */ - loc: string; + loc: CityName; /** Maximum number of employee */ size: number; /** Minimum amount of energy of the employees */ @@ -5256,9 +5454,9 @@ export declare interface Office { /** Average morale of the employees */ avgMor: number; /** Production of the employees */ - employeeProd: Record<`${EmployeePositions}`, number>; + employeeProd: Record; /** Positions of the employees */ - employeeJobs: Record<`${EmployeePositions}`, number>; + employeeJobs: Record; } /** @@ -5272,37 +5470,37 @@ export declare interface OfficeAPI { /** * Hire an employee. * @param divisionName - Name of the division - * @param cityName - Name of the city + * @param city - Name of the city * @param employeePosition - Position to place into. Defaults to "Unassigned". * @returns True if an employee was hired, false otherwise */ hireEmployee( divisionName: string, - cityName: string, - employeePosition?: EmployeePositions | `${EmployeePositions}`, + city: CityName | `${CityName}`, + employeePosition?: CorpEmployeePosition, ): boolean; /** * Upgrade office size. * @param divisionName - Name of the division - * @param cityName - Name of the city + * @param city - Name of the city * @param size - Amount of positions to open */ - upgradeOfficeSize(divisionName: string, cityName: string, size: number): void; + upgradeOfficeSize(divisionName: string, city: CityName | `${CityName}`, size: number): void; /** * Throw a party for your employees * @param divisionName - Name of the division - * @param cityName - Name of the city + * @param city - Name of the city * @param costPerEmployee - Amount to spend per employee. * @returns Multiplier for happiness and morale, or zero on failure */ - throwParty(divisionName: string, cityName: string, costPerEmployee: number): number; + throwParty(divisionName: string, city: CityName | `${CityName}`, costPerEmployee: number): number; /** * Buy coffee for your employees * @param divisionName - Name of the division - * @param cityName - Name of the city + * @param city - Name of the city * @returns true if buying coffee was successful, false otherwise */ - buyCoffee(divisionName: string, cityName: string): boolean; + buyCoffee(divisionName: string, city: CityName | `${CityName}`): boolean; /** * Hire AdVert. * @param divisionName - Name of the division @@ -5317,24 +5515,22 @@ export declare interface OfficeAPI { /** * Get data about an office * @param divisionName - Name of the division - * @param cityName - Name of the city + * @param city - Name of the city * @returns Office data */ - getOffice(divisionName: string, cityName: string): Office; + getOffice(divisionName: string, city: CityName | `${CityName}`): Office; /** - * Get data about an employee - * @param divisionName - Name of the division - * @param cityName - Name of the city - * @param employeeName - Name of the employee - * @returns Employee data + * Get the cost to hire AdVert. + * @param divisionName - Name of the division. + * @returns The cost to hire AdVert. */ getHireAdVertCost(divisionName: string): number; /** - * Get the number of times you have Hired AdVert - * @param divisionName - Name of the division - * @returns Number of times you have Hired AdVert + * Get the number of times you have hired AdVert. + * @param divisionName - Name of the division. + * @returns Number of times you have hired AdVert. */ - getHireAdVertCount(adivisionName: string): number; + getHireAdVertCount(divisionName: string): number; /** * Get the cost to unlock research * @param divisionName - Name of the division @@ -5352,20 +5548,20 @@ export declare interface OfficeAPI { /** * Set the auto job assignment for a job * @param divisionName - Name of the division - * @param cityName - Name of the city + * @param city - Name of the city * @param job - Name of the job * @param amount - Number of employees to assign to that job * @returns true if the employee count reached the target amount, false if not */ - setAutoJobAssignment(divisionName: string, cityName: string, job: string, amount: number): boolean; + setAutoJobAssignment(divisionName: string, city: CityName | `${CityName}`, job: string, amount: number): boolean; /** * Cost to Upgrade office size. * @param divisionName - Name of the division - * @param cityName - Name of the city + * @param city - Name of the city * @param size - Amount of positions to open * @returns Cost of upgrading the office */ - getOfficeSizeUpgradeCost(divisionName: string, cityName: string, asize: number): number; + getOfficeSizeUpgradeCost(divisionName: string, city: CityName | `${CityName}`, asize: number): number; } /** @public */ @@ -5382,7 +5578,7 @@ export declare interface Person { skills: Skills; exp: Skills; mults: Multipliers; - city: string; + city: CityName; } /** @public */ @@ -5445,7 +5641,7 @@ export declare interface Product { /** Data refers to the production, sale, and quantity of the products * These values are specific to a city * For each city, the data is [qty, prod, sell] */ - cityData: { [key: string]: number[] }; + cityData: Record; /** Creation progress - A number between 0-100 representing percentage */ developmentProgress: number; } @@ -5695,7 +5891,7 @@ export declare interface Singularity { * @param city - City to travel to. * @returns True if action is successful, false otherwise. */ - travelToCity(city: string): boolean; + travelToCity(city: CityName | `${CityName}`): boolean; /** * Purchase the TOR router. @@ -6111,7 +6307,7 @@ export declare interface Singularity { * * This function returns the number of milliseconds it takes to attempt the * specified crime (e.g It takes 60 seconds to attempt the ‘Rob Store’ crime, - * so running `commitCrime('ROBSTORE')` will return 60,000). + * so running `commitCrime('Rob Store')` will return 60,000). * * @param crime - Name of crime to attempt. * @param focus - Acquire player focus on this crime. Optional. Defaults to true. @@ -6590,23 +6786,12 @@ export declare interface Sleeve { * * @example * ```ts - * // NS1 - * // Assign the first 3 sleeves to commit various crimes. - * var crime = ["MUG", "ROBSTORE", "SHOPLIFT"]; - * for (var i = 0; i < crime.length; i++) { - * tprintf("Sleeve %d commits crime: %s", i, crime[i]); - * sleeve.setToCommitCrime(i, crime[i]); - * } - * ``` - * @example - * ```ts - * // NS2 - * // Assign the first 3 sleeves to commit various crimes. - * const crime = ["MUG", "ROBSTORE", "SHOPLIFT"]; - * for (let i = 0; i < crime.length; i++) { - * ns.tprintf("Sleeve %d commits crime: %s", i, crime[i]); - * ns.sleeve.setToCommitCrime(i, crime[i]); - * } + * // Assigns the first sleeve to Homicide. + * ns.sleeve.setToCommitCrime(0, "Homicide"); + * + * // Assigns the second sleeve to Grand Theft Auto, using enum + * const crimes = ns.enums.CrimeType; + * ns.sleeve.setToCommitCrime(1, crimes.grandTheftAuto) * ``` * * @param sleeveNumber - Index of the sleeve to start committing crime. Sleeves are numbered starting from 0. @@ -6682,10 +6867,10 @@ export declare interface Sleeve { * Return a boolean indicating whether or not the sleeve reached destination. * * @param sleeveNumber - Index of the sleeve to travel. - * @param cityName - Name of the destination city. + * @param city - Name of the destination city. * @returns True if the sleeve reached destination, false otherwise. */ - travel(sleeveNumber: number, cityName: string): boolean; + travel(sleeveNumber: number, city: CityName | `${CityName}`): boolean; /** * Get augmentations installed on a sleeve. @@ -7012,20 +7197,8 @@ export declare interface TIX { * 1. TIX API Access * * @example - * ```ts - * // NS1 - * stock.getPrice("FSIG"); - * - * // Choose the first stock symbol from the array of stock symbols. Get the price - * // of the corresponding stock. - * var sym = stock.getSymbols()[0]; - * tprint("Stock symbol: " + sym); - * tprint("Stock price: " + stock.getPrice(sym)); - * ``` - * @example - * ```ts - * // NS2 - * ns.stock.getPrice("FSIG"); + * ```js + * const fourSigmaStockPrice = ns.stock.getPrice("FSIG"); * * // Choose the first stock symbol from the array of stock symbols. Get the price * // of the corresponding stock. @@ -7578,7 +7751,7 @@ export declare interface Warehouse { /** Amount of size upgrade bought */ level: number; /** City in which the warehouse is located */ - loc: string; + loc: CityName; /** Total space in the warehouse */ size: number; /** Used space in the warehouse */ @@ -7597,16 +7770,22 @@ export declare interface WarehouseAPI { /** * Set material sell data. * @param divisionName - Name of the division - * @param cityName - Name of the city + * @param city - Name of the city * @param materialName - Name of the material * @param amt - Amount to sell, can be "MAX" * @param price - Price to sell, can be "MP" */ - sellMaterial(divisionName: string, cityName: string, materialName: string, amt: string, price: string): void; + sellMaterial( + divisionName: string, + city: CityName | `${CityName}`, + materialName: string, + amt: string, + price: string, + ): void; /** * Set product sell data. * @param divisionName - Name of the division - * @param cityName - Name of the city + * @param city - Name of the city * @param productName - Name of the product * @param amt - Amount to sell, can be "MAX" * @param price - Price to sell, can be "MP" @@ -7614,7 +7793,7 @@ export declare interface WarehouseAPI { */ sellProduct( divisionName: string, - cityName: string, + city: CityName | `${CityName}`, productName: string, amt: string, price: string, @@ -7629,41 +7808,46 @@ export declare interface WarehouseAPI { /** * Set smart supply * @param divisionName - Name of the division - * @param cityName - Name of the city + * @param city - Name of the city * @param enabled - smart supply enabled */ - setSmartSupply(divisionName: string, cityName: string, enabled: boolean): void; + setSmartSupply(divisionName: string, city: CityName | `${CityName}`, enabled: boolean): void; /** * Set whether smart supply uses leftovers before buying * @param divisionName - Name of the division - * @param cityName - Name of the city + * @param city - Name of the city * @param materialName - Name of the material * @param enabled - smart supply use leftovers enabled */ - setSmartSupplyUseLeftovers(divisionName: string, cityName: string, materialName: string, enabled: boolean): void; + setSmartSupplyUseLeftovers( + divisionName: string, + city: CityName | `${CityName}`, + materialName: string, + enabled: boolean, + ): void; /** * Set material buy data * @param divisionName - Name of the division - * @param cityName - Name of the city + * @param city - Name of the city * @param materialName - Name of the material * @param amt - Amount of material to buy */ - buyMaterial(divisionName: string, cityName: string, materialName: string, amt: number): void; + buyMaterial(divisionName: string, city: CityName | `${CityName}`, materialName: string, amt: number): void; /** * Set material to bulk buy * @param divisionName - Name of the division - * @param cityName - Name of the city + * @param city - Name of the city * @param materialName - Name of the material * @param amt - Amount of material to buy */ - bulkPurchase(divisionName: string, cityName: string, materialName: string, amt: number): void; + bulkPurchase(divisionName: string, city: CityName | `${CityName}`, materialName: string, amt: number): void; /** * Get warehouse data * @param divisionName - Name of the division - * @param cityName - Name of the city + * @param city - Name of the city * @returns warehouse data */ - getWarehouse(divisionName: string, cityName: string): Warehouse; + getWarehouse(divisionName: string, city: CityName | `${CityName}`): Warehouse; /** * Get product data * @param divisionName - Name of the division @@ -7674,26 +7858,27 @@ export declare interface WarehouseAPI { /** * Get material data * @param divisionName - Name of the division + * @param city - Name of the city * @param materialName - Name of the material * @returns material data */ - getMaterial(divisionName: string, cityName: string, materialName: string): Material; + getMaterial(divisionName: string, city: CityName | `${CityName}`, materialName: string): Material; /** * Set market TA 1 for a material. * @param divisionName - Name of the division - * @param cityName - Name of the city + * @param city - Name of the city * @param materialName - Name of the material * @param on - market ta enabled */ - setMaterialMarketTA1(divisionName: string, cityName: string, materialName: string, on: boolean): void; + setMaterialMarketTA1(divisionName: string, city: CityName | `${CityName}`, materialName: string, on: boolean): void; /** * Set market TA 2 for a material. * @param divisionName - Name of the division - * @param cityName - Name of the city + * @param city - Name of the city * @param materialName - Name of the material * @param on - market ta enabled */ - setMaterialMarketTA2(divisionName: string, cityName: string, materialName: string, on: boolean): void; + setMaterialMarketTA2(divisionName: string, city: CityName | `${CityName}`, materialName: string, on: boolean): void; /** * Set market TA 1 for a product. * @param divisionName - Name of the division @@ -7719,9 +7904,9 @@ export declare interface WarehouseAPI { */ exportMaterial( sourceDivision: string, - sourceCity: string, + sourceCity: CityName | `${CityName}`, targetDivision: string, - targetCity: string, + targetCity: CityName | `${CityName}`, materialName: string, amt: number, ): void; @@ -7736,36 +7921,36 @@ export declare interface WarehouseAPI { */ cancelExportMaterial( sourceDivision: string, - sourceCity: string, + sourceCity: CityName | `${CityName}`, targetDivision: string, - targetCity: string, + targetCity: CityName | `${CityName}`, materialName: string, amt: number, ): void; /** * Purchase warehouse for a new city * @param divisionName - Name of the division - * @param cityName - Name of the city + * @param city - Name of the city */ - purchaseWarehouse(divisionName: string, cityName: string): void; + purchaseWarehouse(divisionName: string, city: CityName | `${CityName}`): void; /** * Upgrade warehouse * @param divisionName - Name of the division - * @param cityName - Name of the city + * @param city - Name of the city * @param amt - amount of upgrades defaults to 1 */ - upgradeWarehouse(divisionName: string, cityName: string, amt?: number): void; + upgradeWarehouse(divisionName: string, city: CityName | `${CityName}`, amt?: number): void; /** * Create a new product * @param divisionName - Name of the division - * @param cityName - Name of the city + * @param city - Name of the city * @param productName - Name of the product * @param designInvest - Amount to invest for the design of the product. * @param marketingInvest - Amount to invest for the marketing of the product. */ makeProduct( divisionName: string, - cityName: string, + city: CityName | `${CityName}`, productName: string, designInvest: number, marketingInvest: number, @@ -7773,37 +7958,37 @@ export declare interface WarehouseAPI { /** * Limit Material Production. * @param divisionName - Name of the division. - * @param cityName - Name of the city. + * @param city - Name of the city. * @param materialName - Name of the material. * @param qty - Amount to limit to. Pass a negative value to remove the limit instead. */ - limitMaterialProduction(divisionName: string, cityName: string, materialName: string, qty: number): void; + limitMaterialProduction( + divisionName: string, + city: CityName | `${CityName}`, + materialName: string, + qty: number, + ): void; /** * Limit Product Production. * @param divisionName - Name of the division. - * @param cityName - Name of the city. + * @param city - Name of the city. * @param productName - Name of the product. * @param qty - Amount to limit to. Pass a negative value to remove the limit instead. */ - limitProductProduction(divisionName: string, cityName: string, productName: string, qty: number): void; - /** - * Gets the cost to purchase a warehouse - * @returns cost - */ - getPurchaseWarehouseCost(): number; + limitProductProduction(divisionName: string, city: CityName | `${CityName}`, productName: string, qty: number): void; /** * Gets the cost to upgrade a warehouse to the next level * @param divisionName - Name of the division - * @param cityName - Name of the city - * @param amt - amount of upgrades defaults to 1 + * @param city - Name of the city + * @param amt - amount of upgrades. Optional, defaults to 1 * @returns cost to upgrade */ - getUpgradeWarehouseCost(adivisionName: string, acityName: string, amt?: number): number; + getUpgradeWarehouseCost(divisionName: string, city: CityName | `${CityName}`, amt?: number): number; /** * Check if you have a warehouse in city * @returns true if warehouse is present, false if not */ - hasWarehouse(adivisionName: string, acityName: string): boolean; + hasWarehouse(divisionName: string, city: CityName | `${CityName}`): boolean; } /** @@ -7825,12 +8010,7 @@ export declare 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: CompanyPosName | `${CompanyPosName}`, - favor: number, - ): WorkStats; + companyGains(person: Person, companyName: string, workType: JobName | `${JobName}`, favor: number): WorkStats; } /** @public */ diff --git a/jest.config.js b/jest.config.js index 8f75f0c29..f2a33a3d3 100644 --- a/jest.config.js +++ b/jest.config.js @@ -11,5 +11,6 @@ module.exports = { "\\.(css|less)$": "/test/__mocks__/styleMock.js", "\\!!raw-loader!.*$": "/test/__mocks__/rawLoader.js", "@player": "/src/Player", + "@nsdefs": "/src/ScriptEditor/NetscriptDefinitions", }, }; diff --git a/markdown/bitburner.bladeburner.getcity.md b/markdown/bitburner.bladeburner.getcity.md index a97627638..0bb805701 100644 --- a/markdown/bitburner.bladeburner.getcity.md +++ b/markdown/bitburner.bladeburner.getcity.md @@ -9,11 +9,11 @@ Get current city. Signature: ```typescript -getCity(): string; +getCity(): CityName; ``` Returns: -string +[CityName](./bitburner.cityname.md) City that the player is currently in (for Bladeburner). diff --git a/markdown/bitburner.bladeburner.getcitychaos.md b/markdown/bitburner.bladeburner.getcitychaos.md index 20b997e38..e45cadb12 100644 --- a/markdown/bitburner.bladeburner.getcitychaos.md +++ b/markdown/bitburner.bladeburner.getcitychaos.md @@ -9,14 +9,14 @@ Get chaos of a city. Signature: ```typescript -getCityChaos(name: string): number; +getCityChaos(city: CityName | `${CityName}`): number; ``` ## Parameters | Parameter | Type | Description | | --- | --- | --- | -| name | string | | +| city | [CityName](./bitburner.cityname.md) \| \`${[CityName](./bitburner.cityname.md)}\` | Name of city. Case-sensitive | Returns: diff --git a/markdown/bitburner.bladeburner.getcitycommunities.md b/markdown/bitburner.bladeburner.getcitycommunities.md index 3d9057fb2..c01f3779f 100644 --- a/markdown/bitburner.bladeburner.getcitycommunities.md +++ b/markdown/bitburner.bladeburner.getcitycommunities.md @@ -9,14 +9,14 @@ Get number of communities in a city. Signature: ```typescript -getCityCommunities(name: string): number; +getCityCommunities(city: CityName | `${CityName}`): number; ``` ## Parameters | Parameter | Type | Description | | --- | --- | --- | -| name | string | | +| city | [CityName](./bitburner.cityname.md) \| \`${[CityName](./bitburner.cityname.md)}\` | Name of city. Case-sensitive | Returns: diff --git a/markdown/bitburner.bladeburner.getcityestimatedpopulation.md b/markdown/bitburner.bladeburner.getcityestimatedpopulation.md index 7e9c07e68..9b54667c9 100644 --- a/markdown/bitburner.bladeburner.getcityestimatedpopulation.md +++ b/markdown/bitburner.bladeburner.getcityestimatedpopulation.md @@ -9,14 +9,14 @@ Get estimated population in city. Signature: ```typescript -getCityEstimatedPopulation(name: string): number; +getCityEstimatedPopulation(city: CityName | `${CityName}`): number; ``` ## Parameters | Parameter | Type | Description | | --- | --- | --- | -| name | string | | +| city | [CityName](./bitburner.cityname.md) \| \`${[CityName](./bitburner.cityname.md)}\` | Name of city. Case-sensitive | Returns: diff --git a/markdown/bitburner.bladeburner.md b/markdown/bitburner.bladeburner.md index c4a8173d7..0ea3ddb30 100644 --- a/markdown/bitburner.bladeburner.md +++ b/markdown/bitburner.bladeburner.md @@ -32,9 +32,9 @@ You have to be employed in the Bladeburner division and be in BitNode-7 or have | [getBlackOpRank(name)](./bitburner.bladeburner.getblackoprank.md) | Get black op required rank. | | [getBonusTime()](./bitburner.bladeburner.getbonustime.md) | Get bladeburner bonus time. | | [getCity()](./bitburner.bladeburner.getcity.md) | Get current city. | -| [getCityChaos(name)](./bitburner.bladeburner.getcitychaos.md) | Get chaos of a city. | -| [getCityCommunities(name)](./bitburner.bladeburner.getcitycommunities.md) | Get number of communities in a city. | -| [getCityEstimatedPopulation(name)](./bitburner.bladeburner.getcityestimatedpopulation.md) | Get estimated population in city. | +| [getCityChaos(city)](./bitburner.bladeburner.getcitychaos.md) | Get chaos of a city. | +| [getCityCommunities(city)](./bitburner.bladeburner.getcitycommunities.md) | Get number of communities in a city. | +| [getCityEstimatedPopulation(city)](./bitburner.bladeburner.getcityestimatedpopulation.md) | Get estimated population in city. | | [getContractNames()](./bitburner.bladeburner.getcontractnames.md) | List all contracts. | | [getCurrentAction()](./bitburner.bladeburner.getcurrentaction.md) | Get current action. | | [getGeneralActionNames()](./bitburner.bladeburner.getgeneralactionnames.md) | List all general actions. | @@ -54,6 +54,6 @@ You have to be employed in the Bladeburner division and be in BitNode-7 or have | [setTeamSize(type, name, size)](./bitburner.bladeburner.setteamsize.md) | Set team size. | | [startAction(type, name)](./bitburner.bladeburner.startaction.md) | Start an action. | | [stopBladeburnerAction()](./bitburner.bladeburner.stopbladeburneraction.md) | Stop current action. | -| [switchCity(name)](./bitburner.bladeburner.switchcity.md) | Travel to another city in bladeburner. | +| [switchCity(city)](./bitburner.bladeburner.switchcity.md) | Travel to another city in bladeburner. | | [upgradeSkill(name, count)](./bitburner.bladeburner.upgradeskill.md) | Upgrade skill. | diff --git a/markdown/bitburner.bladeburner.switchcity.md b/markdown/bitburner.bladeburner.switchcity.md index 77e414a9a..99962b1b3 100644 --- a/markdown/bitburner.bladeburner.switchcity.md +++ b/markdown/bitburner.bladeburner.switchcity.md @@ -9,14 +9,14 @@ Travel to another city in bladeburner. Signature: ```typescript -switchCity(name: string): boolean; +switchCity(city: CityName | `${CityName}`): boolean; ``` ## Parameters | Parameter | Type | Description | | --- | --- | --- | -| name | string | | +| city | [CityName](./bitburner.cityname.md) \| \`${[CityName](./bitburner.cityname.md)}\` | Name of city. Case-sensitive | Returns: diff --git a/markdown/bitburner.cityname.md b/markdown/bitburner.cityname.md new file mode 100644 index 000000000..2ee019716 --- /dev/null +++ b/markdown/bitburner.cityname.md @@ -0,0 +1,25 @@ + + +[Home](./index.md) > [bitburner](./bitburner.md) > [CityName](./bitburner.cityname.md) + +## CityName enum + +Names of all cities + +Signature: + +```typescript +declare enum CityName +``` + +## Enumeration Members + +| Member | Value | Description | +| --- | --- | --- | +| Aevum | "Aevum" | | +| Chongqing | "Chongqing" | | +| Ishima | "Ishima" | | +| NewTokyo | "New Tokyo" | | +| Sector12 | "Sector-12" | | +| Volhaven | "Volhaven" | | + diff --git a/markdown/bitburner.companyposname.md b/markdown/bitburner.companyposname.md deleted file mode 100644 index deb2ac365..000000000 --- a/markdown/bitburner.companyposname.md +++ /dev/null @@ -1,56 +0,0 @@ - - -[Home](./index.md) > [bitburner](./bitburner.md) > [CompanyPosName](./bitburner.companyposname.md) - -## CompanyPosName enum - - -Signature: - -```typescript -declare enum CompanyPosName -``` - -## Enumeration Members - -| Member | Value | Description | -| --- | --- | --- | -| agent0 | "Field Agent" | | -| agent1 | "Secret Agent" | | -| agent2 | "Special Operative" | | -| bus0 | "Business Intern" | | -| bus1 | "Business Analyst" | | -| bus2 | "Business Manager" | | -| bus3 | "Operations Manager" | | -| bus4 | "Chief Financial Officer" | | -| bus5 | "Chief Executive Officer" | | -| busCons0 | "Business Consultant" | | -| busCons1 | "Senior Business Consultant" | | -| employee | "Employee" | | -| employeePT | "Part-time Employee" | | -| IT0 | "IT Intern" | | -| IT1 | "IT Analyst" | | -| IT2 | "IT Manager" | | -| IT3 | "Systems Administrator" | | -| netEng0 | "Network Engineer" | | -| netEng1 | "Network Administrator" | | -| sec0 | "Police Officer" | | -| sec1 | "Police Chief" | | -| sec2 | "Security Guard" | | -| sec3 | "Security Officer" | | -| sec4 | "Security Supervisor" | | -| sec5 | "Head of Security" | | -| secEng | "Security Engineer" | | -| softCons0 | "Software Consultant" | | -| softCons1 | "Senior Software Consultant" | | -| sw0 | "Software Engineering Intern" | | -| sw1 | "Junior Software Engineer" | | -| sw2 | "Senior Software Engineer" | | -| sw3 | "Lead Software Developer" | | -| sw4 | "Head of Software" | | -| sw5 | "Head of Engineering" | | -| sw6 | "Vice President of Technology" | | -| sw7 | "Chief Technology Officer" | | -| waiter | "Waiter" | | -| waiterPT | "Part-time Waiter" | | - diff --git a/markdown/bitburner.corpconstants.baseproductprofitmult.md b/markdown/bitburner.corpconstants.baseproductprofitmult.md new file mode 100644 index 000000000..9c45026ac --- /dev/null +++ b/markdown/bitburner.corpconstants.baseproductprofitmult.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [bitburner](./bitburner.md) > [CorpConstants](./bitburner.corpconstants.md) > [baseProductProfitMult](./bitburner.corpconstants.baseproductprofitmult.md) + +## CorpConstants.baseProductProfitMult property + +Signature: + +```typescript +baseProductProfitMult: number; +``` diff --git a/markdown/bitburner.corpconstants.bribeamountperreputation.md b/markdown/bitburner.corpconstants.bribeamountperreputation.md new file mode 100644 index 000000000..ac9f5a57f --- /dev/null +++ b/markdown/bitburner.corpconstants.bribeamountperreputation.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [bitburner](./bitburner.md) > [CorpConstants](./bitburner.corpconstants.md) > [bribeAmountPerReputation](./bitburner.corpconstants.bribeamountperreputation.md) + +## CorpConstants.bribeAmountPerReputation property + +Signature: + +```typescript +bribeAmountPerReputation: number; +``` diff --git a/markdown/bitburner.corpconstants.bribethreshold.md b/markdown/bitburner.corpconstants.bribethreshold.md new file mode 100644 index 000000000..501ea2e61 --- /dev/null +++ b/markdown/bitburner.corpconstants.bribethreshold.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [bitburner](./bitburner.md) > [CorpConstants](./bitburner.corpconstants.md) > [bribeThreshold](./bitburner.corpconstants.bribethreshold.md) + +## CorpConstants.bribeThreshold property + +Signature: + +```typescript +bribeThreshold: number; +``` diff --git a/markdown/bitburner.corpconstants.coffeecostperemployee.md b/markdown/bitburner.corpconstants.coffeecostperemployee.md new file mode 100644 index 000000000..827e55be0 --- /dev/null +++ b/markdown/bitburner.corpconstants.coffeecostperemployee.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [bitburner](./bitburner.md) > [CorpConstants](./bitburner.corpconstants.md) > [coffeeCostPerEmployee](./bitburner.corpconstants.coffeecostperemployee.md) + +## CorpConstants.coffeeCostPerEmployee property + +Signature: + +```typescript +coffeeCostPerEmployee: number; +``` diff --git a/markdown/bitburner.corpconstants.dividendmaxrate.md b/markdown/bitburner.corpconstants.dividendmaxrate.md new file mode 100644 index 000000000..56b36b831 --- /dev/null +++ b/markdown/bitburner.corpconstants.dividendmaxrate.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [bitburner](./bitburner.md) > [CorpConstants](./bitburner.corpconstants.md) > [dividendMaxRate](./bitburner.corpconstants.dividendmaxrate.md) + +## CorpConstants.dividendMaxRate property + +Signature: + +```typescript +dividendMaxRate: number; +``` diff --git a/markdown/bitburner.corpconstants.employeeraiseamount.md b/markdown/bitburner.corpconstants.employeeraiseamount.md new file mode 100644 index 000000000..5f616749c --- /dev/null +++ b/markdown/bitburner.corpconstants.employeeraiseamount.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [bitburner](./bitburner.md) > [CorpConstants](./bitburner.corpconstants.md) > [employeeRaiseAmount](./bitburner.corpconstants.employeeraiseamount.md) + +## CorpConstants.employeeRaiseAmount property + +Signature: + +```typescript +employeeRaiseAmount: number; +``` diff --git a/markdown/bitburner.corpconstants.employeesalarymultiplier.md b/markdown/bitburner.corpconstants.employeesalarymultiplier.md new file mode 100644 index 000000000..b5fee3fb3 --- /dev/null +++ b/markdown/bitburner.corpconstants.employeesalarymultiplier.md @@ -0,0 +1,13 @@ + + +[Home](./index.md) > [bitburner](./bitburner.md) > [CorpConstants](./bitburner.corpconstants.md) > [employeeSalaryMultiplier](./bitburner.corpconstants.employeesalarymultiplier.md) + +## CorpConstants.employeeSalaryMultiplier property + +Conversion factor for employee stats to initial salary + +Signature: + +```typescript +employeeSalaryMultiplier: number; +``` diff --git a/markdown/bitburner.corpconstants.gamecyclespercorpstatecycle.md b/markdown/bitburner.corpconstants.gamecyclespercorpstatecycle.md new file mode 100644 index 000000000..3087ba944 --- /dev/null +++ b/markdown/bitburner.corpconstants.gamecyclespercorpstatecycle.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [bitburner](./bitburner.md) > [CorpConstants](./bitburner.corpconstants.md) > [gameCyclesPerCorpStateCycle](./bitburner.corpconstants.gamecyclespercorpstatecycle.md) + +## CorpConstants.gameCyclesPerCorpStateCycle property + +Signature: + +```typescript +gameCyclesPerCorpStateCycle: number; +``` diff --git a/markdown/bitburner.corpconstants.gamecyclespermarketcycle.md b/markdown/bitburner.corpconstants.gamecyclespermarketcycle.md new file mode 100644 index 000000000..b4c0861c7 --- /dev/null +++ b/markdown/bitburner.corpconstants.gamecyclespermarketcycle.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [bitburner](./bitburner.md) > [CorpConstants](./bitburner.corpconstants.md) > [gameCyclesPerMarketCycle](./bitburner.corpconstants.gamecyclespermarketcycle.md) + +## CorpConstants.gameCyclesPerMarketCycle property + +Signature: + +```typescript +gameCyclesPerMarketCycle: number; +``` diff --git a/markdown/bitburner.corpconstants.industrynames.md b/markdown/bitburner.corpconstants.industrynames.md new file mode 100644 index 000000000..22056a0b5 --- /dev/null +++ b/markdown/bitburner.corpconstants.industrynames.md @@ -0,0 +1,13 @@ + + +[Home](./index.md) > [bitburner](./bitburner.md) > [CorpConstants](./bitburner.corpconstants.md) > [industryNames](./bitburner.corpconstants.industrynames.md) + +## CorpConstants.industryNames property + +Names of all industries + +Signature: + +```typescript +industryNames: CorpIndustryName[]; +``` diff --git a/markdown/bitburner.corpconstants.initialshares.md b/markdown/bitburner.corpconstants.initialshares.md new file mode 100644 index 000000000..3b3d9cc60 --- /dev/null +++ b/markdown/bitburner.corpconstants.initialshares.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [bitburner](./bitburner.md) > [CorpConstants](./bitburner.corpconstants.md) > [initialShares](./bitburner.corpconstants.initialshares.md) + +## CorpConstants.initialShares property + +Signature: + +```typescript +initialShares: number; +``` diff --git a/markdown/bitburner.corpconstants.issuenewsharescooldown.md b/markdown/bitburner.corpconstants.issuenewsharescooldown.md new file mode 100644 index 000000000..317d399db --- /dev/null +++ b/markdown/bitburner.corpconstants.issuenewsharescooldown.md @@ -0,0 +1,13 @@ + + +[Home](./index.md) > [bitburner](./bitburner.md) > [CorpConstants](./bitburner.corpconstants.md) > [issueNewSharesCooldown](./bitburner.corpconstants.issuenewsharescooldown.md) + +## CorpConstants.issueNewSharesCooldown property + +Cooldown for issue new shares cooldown in game cycles (1 game cycle = 200ms) + +Signature: + +```typescript +issueNewSharesCooldown: number; +``` diff --git a/markdown/bitburner.corpconstants.marketcyclesperemployeeraise.md b/markdown/bitburner.corpconstants.marketcyclesperemployeeraise.md new file mode 100644 index 000000000..eff6cd23d --- /dev/null +++ b/markdown/bitburner.corpconstants.marketcyclesperemployeeraise.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [bitburner](./bitburner.md) > [CorpConstants](./bitburner.corpconstants.md) > [marketCyclesPerEmployeeRaise](./bitburner.corpconstants.marketcyclesperemployeeraise.md) + +## CorpConstants.marketCyclesPerEmployeeRaise property + +Signature: + +```typescript +marketCyclesPerEmployeeRaise: number; +``` diff --git a/markdown/bitburner.corpconstants.materialnames.md b/markdown/bitburner.corpconstants.materialnames.md new file mode 100644 index 000000000..97cd629ac --- /dev/null +++ b/markdown/bitburner.corpconstants.materialnames.md @@ -0,0 +1,13 @@ + + +[Home](./index.md) > [bitburner](./bitburner.md) > [CorpConstants](./bitburner.corpconstants.md) > [materialNames](./bitburner.corpconstants.materialnames.md) + +## CorpConstants.materialNames property + +Names of all materials + +Signature: + +```typescript +materialNames: CorpMaterialName[]; +``` diff --git a/markdown/bitburner.corpconstants.maxproductsbase.md b/markdown/bitburner.corpconstants.maxproductsbase.md new file mode 100644 index 000000000..c2ac45f6e --- /dev/null +++ b/markdown/bitburner.corpconstants.maxproductsbase.md @@ -0,0 +1,13 @@ + + +[Home](./index.md) > [bitburner](./bitburner.md) > [CorpConstants](./bitburner.corpconstants.md) > [maxProductsBase](./bitburner.corpconstants.maxproductsbase.md) + +## CorpConstants.maxProductsBase property + +Max products for a division without upgrades + +Signature: + +```typescript +maxProductsBase: number; +``` diff --git a/markdown/bitburner.corpconstants.md b/markdown/bitburner.corpconstants.md new file mode 100644 index 000000000..de05af502 --- /dev/null +++ b/markdown/bitburner.corpconstants.md @@ -0,0 +1,49 @@ + + +[Home](./index.md) > [bitburner](./bitburner.md) > [CorpConstants](./bitburner.corpconstants.md) + +## CorpConstants interface + +Corporation related constants + +Signature: + +```typescript +interface CorpConstants +``` + +## Properties + +| Property | Type | Description | +| --- | --- | --- | +| [baseProductProfitMult](./bitburner.corpconstants.baseproductprofitmult.md) | number | | +| [bribeAmountPerReputation](./bitburner.corpconstants.bribeamountperreputation.md) | number | | +| [bribeThreshold](./bitburner.corpconstants.bribethreshold.md) | number | | +| [coffeeCostPerEmployee](./bitburner.corpconstants.coffeecostperemployee.md) | number | | +| [dividendMaxRate](./bitburner.corpconstants.dividendmaxrate.md) | number | | +| [employeeRaiseAmount](./bitburner.corpconstants.employeeraiseamount.md) | number | | +| [employeeSalaryMultiplier](./bitburner.corpconstants.employeesalarymultiplier.md) | number | Conversion factor for employee stats to initial salary | +| [gameCyclesPerCorpStateCycle](./bitburner.corpconstants.gamecyclespercorpstatecycle.md) | number | | +| [gameCyclesPerMarketCycle](./bitburner.corpconstants.gamecyclespermarketcycle.md) | number | | +| [industryNames](./bitburner.corpconstants.industrynames.md) | [CorpIndustryName](./bitburner.corpindustryname.md)\[\] | Names of all industries | +| [initialShares](./bitburner.corpconstants.initialshares.md) | number | | +| [issueNewSharesCooldown](./bitburner.corpconstants.issuenewsharescooldown.md) | number | Cooldown for issue new shares cooldown in game cycles (1 game cycle = 200ms) | +| [marketCyclesPerEmployeeRaise](./bitburner.corpconstants.marketcyclesperemployeeraise.md) | number | | +| [materialNames](./bitburner.corpconstants.materialnames.md) | [CorpMaterialName](./bitburner.corpmaterialname.md)\[\] | Names of all materials | +| [maxProductsBase](./bitburner.corpconstants.maxproductsbase.md) | number | Max products for a division without upgrades | +| [officeInitialCost](./bitburner.corpconstants.officeinitialcost.md) | number | | +| [officeInitialSize](./bitburner.corpconstants.officeinitialsize.md) | number | | +| [officeSizeUpgradeCostBase](./bitburner.corpconstants.officesizeupgradecostbase.md) | number | | +| [researchNames](./bitburner.corpconstants.researchnames.md) | [CorpResearchName](./bitburner.corpresearchname.md)\[\] | Names of all researches | +| [researchNamesBase](./bitburner.corpconstants.researchnamesbase.md) | [CorpResearchName](./bitburner.corpresearchname.md)\[\] | Names of all researches common to all industries | +| [researchNamesProductOnly](./bitburner.corpconstants.researchnamesproductonly.md) | [CorpResearchName](./bitburner.corpresearchname.md)\[\] | Names of all researches only available to product industries | +| [secondsPerMarketCycle](./bitburner.corpconstants.secondspermarketcycle.md) | number | | +| [sellSharesCooldown](./bitburner.corpconstants.sellsharescooldown.md) | number | Cooldown for selling shares in game cycles (1 game cycle = 200ms) | +| [sharesPerPriceUpdate](./bitburner.corpconstants.sharesperpriceupdate.md) | number | When selling large number of shares, price is dynamically updated for every batch of this amount | +| [stateNames](./bitburner.corpconstants.statenames.md) | [CorpStateName](./bitburner.corpstatename.md)\[\] | Names of all corporation game states | +| [unlockNames](./bitburner.corpconstants.unlocknames.md) | [CorpUnlockName](./bitburner.corpunlockname.md)\[\] | Names of all one-time corporation-wide unlocks | +| [upgradeNames](./bitburner.corpconstants.upgradenames.md) | [CorpUpgradeName](./bitburner.corpupgradename.md)\[\] | Names of all corporation-wide upgrades | +| [warehouseInitialCost](./bitburner.corpconstants.warehouseinitialcost.md) | number | | +| [warehouseInitialSize](./bitburner.corpconstants.warehouseinitialsize.md) | number | | +| [warehouseSizeUpgradeCostBase](./bitburner.corpconstants.warehousesizeupgradecostbase.md) | number | | + diff --git a/markdown/bitburner.corpconstants.officeinitialcost.md b/markdown/bitburner.corpconstants.officeinitialcost.md new file mode 100644 index 000000000..b4a79f434 --- /dev/null +++ b/markdown/bitburner.corpconstants.officeinitialcost.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [bitburner](./bitburner.md) > [CorpConstants](./bitburner.corpconstants.md) > [officeInitialCost](./bitburner.corpconstants.officeinitialcost.md) + +## CorpConstants.officeInitialCost property + +Signature: + +```typescript +officeInitialCost: number; +``` diff --git a/markdown/bitburner.corpconstants.officeinitialsize.md b/markdown/bitburner.corpconstants.officeinitialsize.md new file mode 100644 index 000000000..38b7e35c3 --- /dev/null +++ b/markdown/bitburner.corpconstants.officeinitialsize.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [bitburner](./bitburner.md) > [CorpConstants](./bitburner.corpconstants.md) > [officeInitialSize](./bitburner.corpconstants.officeinitialsize.md) + +## CorpConstants.officeInitialSize property + +Signature: + +```typescript +officeInitialSize: number; +``` diff --git a/markdown/bitburner.corpconstants.officesizeupgradecostbase.md b/markdown/bitburner.corpconstants.officesizeupgradecostbase.md new file mode 100644 index 000000000..06e16f74f --- /dev/null +++ b/markdown/bitburner.corpconstants.officesizeupgradecostbase.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [bitburner](./bitburner.md) > [CorpConstants](./bitburner.corpconstants.md) > [officeSizeUpgradeCostBase](./bitburner.corpconstants.officesizeupgradecostbase.md) + +## CorpConstants.officeSizeUpgradeCostBase property + +Signature: + +```typescript +officeSizeUpgradeCostBase: number; +``` diff --git a/markdown/bitburner.corpconstants.researchnames.md b/markdown/bitburner.corpconstants.researchnames.md new file mode 100644 index 000000000..f53bf0bbd --- /dev/null +++ b/markdown/bitburner.corpconstants.researchnames.md @@ -0,0 +1,13 @@ + + +[Home](./index.md) > [bitburner](./bitburner.md) > [CorpConstants](./bitburner.corpconstants.md) > [researchNames](./bitburner.corpconstants.researchnames.md) + +## CorpConstants.researchNames property + +Names of all researches + +Signature: + +```typescript +researchNames: CorpResearchName[]; +``` diff --git a/markdown/bitburner.corpconstants.researchnamesbase.md b/markdown/bitburner.corpconstants.researchnamesbase.md new file mode 100644 index 000000000..63cff1190 --- /dev/null +++ b/markdown/bitburner.corpconstants.researchnamesbase.md @@ -0,0 +1,13 @@ + + +[Home](./index.md) > [bitburner](./bitburner.md) > [CorpConstants](./bitburner.corpconstants.md) > [researchNamesBase](./bitburner.corpconstants.researchnamesbase.md) + +## CorpConstants.researchNamesBase property + +Names of all researches common to all industries + +Signature: + +```typescript +researchNamesBase: CorpResearchName[]; +``` diff --git a/markdown/bitburner.corpconstants.researchnamesproductonly.md b/markdown/bitburner.corpconstants.researchnamesproductonly.md new file mode 100644 index 000000000..735dd7a53 --- /dev/null +++ b/markdown/bitburner.corpconstants.researchnamesproductonly.md @@ -0,0 +1,13 @@ + + +[Home](./index.md) > [bitburner](./bitburner.md) > [CorpConstants](./bitburner.corpconstants.md) > [researchNamesProductOnly](./bitburner.corpconstants.researchnamesproductonly.md) + +## CorpConstants.researchNamesProductOnly property + +Names of all researches only available to product industries + +Signature: + +```typescript +researchNamesProductOnly: CorpResearchName[]; +``` diff --git a/markdown/bitburner.corpconstants.secondspermarketcycle.md b/markdown/bitburner.corpconstants.secondspermarketcycle.md new file mode 100644 index 000000000..5723094c1 --- /dev/null +++ b/markdown/bitburner.corpconstants.secondspermarketcycle.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [bitburner](./bitburner.md) > [CorpConstants](./bitburner.corpconstants.md) > [secondsPerMarketCycle](./bitburner.corpconstants.secondspermarketcycle.md) + +## CorpConstants.secondsPerMarketCycle property + +Signature: + +```typescript +secondsPerMarketCycle: number; +``` diff --git a/markdown/bitburner.corpconstants.sellsharescooldown.md b/markdown/bitburner.corpconstants.sellsharescooldown.md new file mode 100644 index 000000000..89f78b2e9 --- /dev/null +++ b/markdown/bitburner.corpconstants.sellsharescooldown.md @@ -0,0 +1,13 @@ + + +[Home](./index.md) > [bitburner](./bitburner.md) > [CorpConstants](./bitburner.corpconstants.md) > [sellSharesCooldown](./bitburner.corpconstants.sellsharescooldown.md) + +## CorpConstants.sellSharesCooldown property + +Cooldown for selling shares in game cycles (1 game cycle = 200ms) + +Signature: + +```typescript +sellSharesCooldown: number; +``` diff --git a/markdown/bitburner.corpconstants.sharesperpriceupdate.md b/markdown/bitburner.corpconstants.sharesperpriceupdate.md new file mode 100644 index 000000000..5244c1673 --- /dev/null +++ b/markdown/bitburner.corpconstants.sharesperpriceupdate.md @@ -0,0 +1,13 @@ + + +[Home](./index.md) > [bitburner](./bitburner.md) > [CorpConstants](./bitburner.corpconstants.md) > [sharesPerPriceUpdate](./bitburner.corpconstants.sharesperpriceupdate.md) + +## CorpConstants.sharesPerPriceUpdate property + +When selling large number of shares, price is dynamically updated for every batch of this amount + +Signature: + +```typescript +sharesPerPriceUpdate: number; +``` diff --git a/markdown/bitburner.corpconstants.statenames.md b/markdown/bitburner.corpconstants.statenames.md new file mode 100644 index 000000000..cd03a41e5 --- /dev/null +++ b/markdown/bitburner.corpconstants.statenames.md @@ -0,0 +1,13 @@ + + +[Home](./index.md) > [bitburner](./bitburner.md) > [CorpConstants](./bitburner.corpconstants.md) > [stateNames](./bitburner.corpconstants.statenames.md) + +## CorpConstants.stateNames property + +Names of all corporation game states + +Signature: + +```typescript +stateNames: CorpStateName[]; +``` diff --git a/markdown/bitburner.corpconstants.unlocknames.md b/markdown/bitburner.corpconstants.unlocknames.md new file mode 100644 index 000000000..69524785d --- /dev/null +++ b/markdown/bitburner.corpconstants.unlocknames.md @@ -0,0 +1,13 @@ + + +[Home](./index.md) > [bitburner](./bitburner.md) > [CorpConstants](./bitburner.corpconstants.md) > [unlockNames](./bitburner.corpconstants.unlocknames.md) + +## CorpConstants.unlockNames property + +Names of all one-time corporation-wide unlocks + +Signature: + +```typescript +unlockNames: CorpUnlockName[]; +``` diff --git a/markdown/bitburner.corpconstants.upgradenames.md b/markdown/bitburner.corpconstants.upgradenames.md new file mode 100644 index 000000000..66e64b615 --- /dev/null +++ b/markdown/bitburner.corpconstants.upgradenames.md @@ -0,0 +1,13 @@ + + +[Home](./index.md) > [bitburner](./bitburner.md) > [CorpConstants](./bitburner.corpconstants.md) > [upgradeNames](./bitburner.corpconstants.upgradenames.md) + +## CorpConstants.upgradeNames property + +Names of all corporation-wide upgrades + +Signature: + +```typescript +upgradeNames: CorpUpgradeName[]; +``` diff --git a/markdown/bitburner.corpconstants.warehouseinitialcost.md b/markdown/bitburner.corpconstants.warehouseinitialcost.md new file mode 100644 index 000000000..52affbee6 --- /dev/null +++ b/markdown/bitburner.corpconstants.warehouseinitialcost.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [bitburner](./bitburner.md) > [CorpConstants](./bitburner.corpconstants.md) > [warehouseInitialCost](./bitburner.corpconstants.warehouseinitialcost.md) + +## CorpConstants.warehouseInitialCost property + +Signature: + +```typescript +warehouseInitialCost: number; +``` diff --git a/markdown/bitburner.corpconstants.warehouseinitialsize.md b/markdown/bitburner.corpconstants.warehouseinitialsize.md new file mode 100644 index 000000000..6fddcae5c --- /dev/null +++ b/markdown/bitburner.corpconstants.warehouseinitialsize.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [bitburner](./bitburner.md) > [CorpConstants](./bitburner.corpconstants.md) > [warehouseInitialSize](./bitburner.corpconstants.warehouseinitialsize.md) + +## CorpConstants.warehouseInitialSize property + +Signature: + +```typescript +warehouseInitialSize: number; +``` diff --git a/markdown/bitburner.corpconstants.warehousesizeupgradecostbase.md b/markdown/bitburner.corpconstants.warehousesizeupgradecostbase.md new file mode 100644 index 000000000..a5a7ae8a4 --- /dev/null +++ b/markdown/bitburner.corpconstants.warehousesizeupgradecostbase.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [bitburner](./bitburner.md) > [CorpConstants](./bitburner.corpconstants.md) > [warehouseSizeUpgradeCostBase](./bitburner.corpconstants.warehousesizeupgradecostbase.md) + +## CorpConstants.warehouseSizeUpgradeCostBase property + +Signature: + +```typescript +warehouseSizeUpgradeCostBase: number; +``` diff --git a/markdown/bitburner.corpemployeeposition.md b/markdown/bitburner.corpemployeeposition.md new file mode 100644 index 000000000..5d3cf1484 --- /dev/null +++ b/markdown/bitburner.corpemployeeposition.md @@ -0,0 +1,19 @@ + + +[Home](./index.md) > [bitburner](./bitburner.md) > [CorpEmployeePosition](./bitburner.corpemployeeposition.md) + +## CorpEmployeePosition type + + +Signature: + +```typescript +type CorpEmployeePosition = + | "Operations" + | "Engineer" + | "Business" + | "Management" + | "Research & Development" + | "Training" + | "Unassigned"; +``` diff --git a/markdown/bitburner.corpindustrydata.advertisingfactor.md b/markdown/bitburner.corpindustrydata.advertisingfactor.md new file mode 100644 index 000000000..0a6ee2731 --- /dev/null +++ b/markdown/bitburner.corpindustrydata.advertisingfactor.md @@ -0,0 +1,13 @@ + + +[Home](./index.md) > [bitburner](./bitburner.md) > [CorpIndustryData](./bitburner.corpindustrydata.md) > [advertisingFactor](./bitburner.corpindustrydata.advertisingfactor.md) + +## CorpIndustryData.advertisingFactor property + +Advertising factor (affects sales) + +Signature: + +```typescript +advertisingFactor?: number; +``` diff --git a/markdown/bitburner.corpindustrydata.aicorefactor.md b/markdown/bitburner.corpindustrydata.aicorefactor.md new file mode 100644 index 000000000..f2b597c3e --- /dev/null +++ b/markdown/bitburner.corpindustrydata.aicorefactor.md @@ -0,0 +1,13 @@ + + +[Home](./index.md) > [bitburner](./bitburner.md) > [CorpIndustryData](./bitburner.corpindustrydata.md) > [aiCoreFactor](./bitburner.corpindustrydata.aicorefactor.md) + +## CorpIndustryData.aiCoreFactor property + +AI Cores factor + +Signature: + +```typescript +aiCoreFactor?: number; +``` diff --git a/markdown/bitburner.corpindustrydata.description.md b/markdown/bitburner.corpindustrydata.description.md new file mode 100644 index 000000000..9e95550c7 --- /dev/null +++ b/markdown/bitburner.corpindustrydata.description.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [bitburner](./bitburner.md) > [CorpIndustryData](./bitburner.corpindustrydata.md) > [description](./bitburner.corpindustrydata.description.md) + +## CorpIndustryData.description property + +Signature: + +```typescript +description: string; +``` diff --git a/markdown/bitburner.corpindustrydata.hardwarefactor.md b/markdown/bitburner.corpindustrydata.hardwarefactor.md new file mode 100644 index 000000000..3024f2640 --- /dev/null +++ b/markdown/bitburner.corpindustrydata.hardwarefactor.md @@ -0,0 +1,13 @@ + + +[Home](./index.md) > [bitburner](./bitburner.md) > [CorpIndustryData](./bitburner.corpindustrydata.md) > [hardwareFactor](./bitburner.corpindustrydata.hardwarefactor.md) + +## CorpIndustryData.hardwareFactor property + +Hardware factor + +Signature: + +```typescript +hardwareFactor?: number; +``` diff --git a/markdown/bitburner.corpindustrydata.md b/markdown/bitburner.corpindustrydata.md new file mode 100644 index 000000000..829f9a717 --- /dev/null +++ b/markdown/bitburner.corpindustrydata.md @@ -0,0 +1,31 @@ + + +[Home](./index.md) > [bitburner](./bitburner.md) > [CorpIndustryData](./bitburner.corpindustrydata.md) + +## CorpIndustryData interface + +Data for an individual industry + +Signature: + +```typescript +interface CorpIndustryData +``` + +## Properties + +| Property | Type | Description | +| --- | --- | --- | +| [advertisingFactor?](./bitburner.corpindustrydata.advertisingfactor.md) | number | (Optional) Advertising factor (affects sales) | +| [aiCoreFactor?](./bitburner.corpindustrydata.aicorefactor.md) | number | (Optional) AI Cores factor | +| [description](./bitburner.corpindustrydata.description.md) | string | | +| [hardwareFactor?](./bitburner.corpindustrydata.hardwarefactor.md) | number | (Optional) Hardware factor | +| [producedMaterials?](./bitburner.corpindustrydata.producedmaterials.md) | [CorpMaterialName](./bitburner.corpmaterialname.md)\[\] | (Optional) | +| [product?](./bitburner.corpindustrydata.product.md) | [CorpProductData](./bitburner.corpproductdata.md) | (Optional) | +| [realEstateFactor?](./bitburner.corpindustrydata.realestatefactor.md) | number | (Optional) Real estate factor | +| [recommendStarting](./bitburner.corpindustrydata.recommendstarting.md) | boolean | | +| [requiredMaterials](./bitburner.corpindustrydata.requiredmaterials.md) | Partial<Record<[CorpMaterialName](./bitburner.corpmaterialname.md), number>> | | +| [robotFactor?](./bitburner.corpindustrydata.robotfactor.md) | number | (Optional) Robots factor | +| [scienceFactor?](./bitburner.corpindustrydata.sciencefactor.md) | number | (Optional) Scientific research factor (affects quality) | +| [startingCost](./bitburner.corpindustrydata.startingcost.md) | number | | + diff --git a/markdown/bitburner.corpindustrydata.producedmaterials.md b/markdown/bitburner.corpindustrydata.producedmaterials.md new file mode 100644 index 000000000..5ba737018 --- /dev/null +++ b/markdown/bitburner.corpindustrydata.producedmaterials.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [bitburner](./bitburner.md) > [CorpIndustryData](./bitburner.corpindustrydata.md) > [producedMaterials](./bitburner.corpindustrydata.producedmaterials.md) + +## CorpIndustryData.producedMaterials property + +Signature: + +```typescript +producedMaterials?: CorpMaterialName[]; +``` diff --git a/markdown/bitburner.corpindustrydata.product.md b/markdown/bitburner.corpindustrydata.product.md new file mode 100644 index 000000000..b9c9e5d33 --- /dev/null +++ b/markdown/bitburner.corpindustrydata.product.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [bitburner](./bitburner.md) > [CorpIndustryData](./bitburner.corpindustrydata.md) > [product](./bitburner.corpindustrydata.product.md) + +## CorpIndustryData.product property + +Signature: + +```typescript +product?: CorpProductData; +``` diff --git a/markdown/bitburner.corpindustrydata.realestatefactor.md b/markdown/bitburner.corpindustrydata.realestatefactor.md new file mode 100644 index 000000000..0df329432 --- /dev/null +++ b/markdown/bitburner.corpindustrydata.realestatefactor.md @@ -0,0 +1,13 @@ + + +[Home](./index.md) > [bitburner](./bitburner.md) > [CorpIndustryData](./bitburner.corpindustrydata.md) > [realEstateFactor](./bitburner.corpindustrydata.realestatefactor.md) + +## CorpIndustryData.realEstateFactor property + +Real estate factor + +Signature: + +```typescript +realEstateFactor?: number; +``` diff --git a/markdown/bitburner.corpindustrydata.recommendstarting.md b/markdown/bitburner.corpindustrydata.recommendstarting.md new file mode 100644 index 000000000..22f28b3ab --- /dev/null +++ b/markdown/bitburner.corpindustrydata.recommendstarting.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [bitburner](./bitburner.md) > [CorpIndustryData](./bitburner.corpindustrydata.md) > [recommendStarting](./bitburner.corpindustrydata.recommendstarting.md) + +## CorpIndustryData.recommendStarting property + +Signature: + +```typescript +recommendStarting: boolean; +``` diff --git a/markdown/bitburner.corpindustrydata.requiredmaterials.md b/markdown/bitburner.corpindustrydata.requiredmaterials.md new file mode 100644 index 000000000..41bdbe37d --- /dev/null +++ b/markdown/bitburner.corpindustrydata.requiredmaterials.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [bitburner](./bitburner.md) > [CorpIndustryData](./bitburner.corpindustrydata.md) > [requiredMaterials](./bitburner.corpindustrydata.requiredmaterials.md) + +## CorpIndustryData.requiredMaterials property + +Signature: + +```typescript +requiredMaterials: Partial>; +``` diff --git a/markdown/bitburner.corpindustrydata.robotfactor.md b/markdown/bitburner.corpindustrydata.robotfactor.md new file mode 100644 index 000000000..7a9e56f4b --- /dev/null +++ b/markdown/bitburner.corpindustrydata.robotfactor.md @@ -0,0 +1,13 @@ + + +[Home](./index.md) > [bitburner](./bitburner.md) > [CorpIndustryData](./bitburner.corpindustrydata.md) > [robotFactor](./bitburner.corpindustrydata.robotfactor.md) + +## CorpIndustryData.robotFactor property + +Robots factor + +Signature: + +```typescript +robotFactor?: number; +``` diff --git a/markdown/bitburner.corpindustrydata.sciencefactor.md b/markdown/bitburner.corpindustrydata.sciencefactor.md new file mode 100644 index 000000000..7dd044532 --- /dev/null +++ b/markdown/bitburner.corpindustrydata.sciencefactor.md @@ -0,0 +1,13 @@ + + +[Home](./index.md) > [bitburner](./bitburner.md) > [CorpIndustryData](./bitburner.corpindustrydata.md) > [scienceFactor](./bitburner.corpindustrydata.sciencefactor.md) + +## CorpIndustryData.scienceFactor property + +Scientific research factor (affects quality) + +Signature: + +```typescript +scienceFactor?: number; +``` diff --git a/markdown/bitburner.corpindustrydata.startingcost.md b/markdown/bitburner.corpindustrydata.startingcost.md new file mode 100644 index 000000000..fe5564c38 --- /dev/null +++ b/markdown/bitburner.corpindustrydata.startingcost.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [bitburner](./bitburner.md) > [CorpIndustryData](./bitburner.corpindustrydata.md) > [startingCost](./bitburner.corpindustrydata.startingcost.md) + +## CorpIndustryData.startingCost property + +Signature: + +```typescript +startingCost: number; +``` diff --git a/markdown/bitburner.corpindustryname.md b/markdown/bitburner.corpindustryname.md new file mode 100644 index 000000000..b86895628 --- /dev/null +++ b/markdown/bitburner.corpindustryname.md @@ -0,0 +1,26 @@ + + +[Home](./index.md) > [bitburner](./bitburner.md) > [CorpIndustryName](./bitburner.corpindustryname.md) + +## CorpIndustryName type + + +Signature: + +```typescript +type CorpIndustryName = + | "Energy" + | "Water Utilities" + | "Agriculture" + | "Fishing" + | "Mining" + | "Food" + | "Tobacco" + | "Chemical" + | "Pharmaceutical" + | "Computer Hardware" + | "Robotics" + | "Software" + | "Healthcare" + | "Real Estate"; +``` diff --git a/markdown/bitburner.corpmaterialconstantdata.basecost.md b/markdown/bitburner.corpmaterialconstantdata.basecost.md new file mode 100644 index 000000000..62d74fd6b --- /dev/null +++ b/markdown/bitburner.corpmaterialconstantdata.basecost.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [bitburner](./bitburner.md) > [CorpMaterialConstantData](./bitburner.corpmaterialconstantdata.md) > [baseCost](./bitburner.corpmaterialconstantdata.basecost.md) + +## CorpMaterialConstantData.baseCost property + +Signature: + +```typescript +baseCost: number; +``` diff --git a/markdown/bitburner.corpmaterialconstantdata.basemarkup.md b/markdown/bitburner.corpmaterialconstantdata.basemarkup.md new file mode 100644 index 000000000..0a85352e1 --- /dev/null +++ b/markdown/bitburner.corpmaterialconstantdata.basemarkup.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [bitburner](./bitburner.md) > [CorpMaterialConstantData](./bitburner.corpmaterialconstantdata.md) > [baseMarkup](./bitburner.corpmaterialconstantdata.basemarkup.md) + +## CorpMaterialConstantData.baseMarkup property + +Signature: + +```typescript +baseMarkup: number; +``` diff --git a/markdown/bitburner.corpmaterialconstantdata.competitionbase.md b/markdown/bitburner.corpmaterialconstantdata.competitionbase.md new file mode 100644 index 000000000..d86d4b036 --- /dev/null +++ b/markdown/bitburner.corpmaterialconstantdata.competitionbase.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [bitburner](./bitburner.md) > [CorpMaterialConstantData](./bitburner.corpmaterialconstantdata.md) > [competitionBase](./bitburner.corpmaterialconstantdata.competitionbase.md) + +## CorpMaterialConstantData.competitionBase property + +Signature: + +```typescript +competitionBase: number; +``` diff --git a/markdown/bitburner.corpmaterialconstantdata.competitionrange.md b/markdown/bitburner.corpmaterialconstantdata.competitionrange.md new file mode 100644 index 000000000..f687d19d1 --- /dev/null +++ b/markdown/bitburner.corpmaterialconstantdata.competitionrange.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [bitburner](./bitburner.md) > [CorpMaterialConstantData](./bitburner.corpmaterialconstantdata.md) > [competitionRange](./bitburner.corpmaterialconstantdata.competitionrange.md) + +## CorpMaterialConstantData.competitionRange property + +Signature: + +```typescript +competitionRange: [min: number, max: number]; +``` diff --git a/markdown/bitburner.corpmaterialconstantdata.demandbase.md b/markdown/bitburner.corpmaterialconstantdata.demandbase.md new file mode 100644 index 000000000..16fc5a6b6 --- /dev/null +++ b/markdown/bitburner.corpmaterialconstantdata.demandbase.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [bitburner](./bitburner.md) > [CorpMaterialConstantData](./bitburner.corpmaterialconstantdata.md) > [demandBase](./bitburner.corpmaterialconstantdata.demandbase.md) + +## CorpMaterialConstantData.demandBase property + +Signature: + +```typescript +demandBase: number; +``` diff --git a/markdown/bitburner.corpmaterialconstantdata.demandrange.md b/markdown/bitburner.corpmaterialconstantdata.demandrange.md new file mode 100644 index 000000000..69fac8cd2 --- /dev/null +++ b/markdown/bitburner.corpmaterialconstantdata.demandrange.md @@ -0,0 +1,13 @@ + + +[Home](./index.md) > [bitburner](./bitburner.md) > [CorpMaterialConstantData](./bitburner.corpmaterialconstantdata.md) > [demandRange](./bitburner.corpmaterialconstantdata.demandrange.md) + +## CorpMaterialConstantData.demandRange property + +Min and max demand + +Signature: + +```typescript +demandRange: [min: number, max: number]; +``` diff --git a/markdown/bitburner.corpmaterialconstantdata.maxvolatility.md b/markdown/bitburner.corpmaterialconstantdata.maxvolatility.md new file mode 100644 index 000000000..fb8d15cba --- /dev/null +++ b/markdown/bitburner.corpmaterialconstantdata.maxvolatility.md @@ -0,0 +1,11 @@ + + +[Home](./index.md) > [bitburner](./bitburner.md) > [CorpMaterialConstantData](./bitburner.corpmaterialconstantdata.md) > [maxVolatility](./bitburner.corpmaterialconstantdata.maxvolatility.md) + +## CorpMaterialConstantData.maxVolatility property + +Signature: + +```typescript +maxVolatility: number; +``` diff --git a/markdown/bitburner.corpmaterialconstantdata.md b/markdown/bitburner.corpmaterialconstantdata.md new file mode 100644 index 000000000..c92b95d89 --- /dev/null +++ b/markdown/bitburner.corpmaterialconstantdata.md @@ -0,0 +1,28 @@ + + +[Home](./index.md) > [bitburner](./bitburner.md) > [CorpMaterialConstantData](./bitburner.corpmaterialconstantdata.md) + +## CorpMaterialConstantData interface + +Corporation material information + +Signature: + +```typescript +interface CorpMaterialConstantData +``` + +## Properties + +| Property | Type | Description | +| --- | --- | --- | +| [baseCost](./bitburner.corpmaterialconstantdata.basecost.md) | number | | +| [baseMarkup](./bitburner.corpmaterialconstantdata.basemarkup.md) | number | | +| [competitionBase](./bitburner.corpmaterialconstantdata.competitionbase.md) | number | | +| [competitionRange](./bitburner.corpmaterialconstantdata.competitionrange.md) | \[min: number, max: number\] | | +| [demandBase](./bitburner.corpmaterialconstantdata.demandbase.md) | number | | +| [demandRange](./bitburner.corpmaterialconstantdata.demandrange.md) | \[min: number, max: number\] | Min and max demand | +| [maxVolatility](./bitburner.corpmaterialconstantdata.maxvolatility.md) | number | | +| [name](./bitburner.corpmaterialconstantdata.name.md) | string | Name of the material | +| [size](./bitburner.corpmaterialconstantdata.size.md) | number | Size of the material | + diff --git a/markdown/bitburner.corpmaterialconstantdata.name.md b/markdown/bitburner.corpmaterialconstantdata.name.md new file mode 100644 index 000000000..b3305b957 --- /dev/null +++ b/markdown/bitburner.corpmaterialconstantdata.name.md @@ -0,0 +1,13 @@ + + +[Home](./index.md) > [bitburner](./bitburner.md) > [CorpMaterialConstantData](./bitburner.corpmaterialconstantdata.md) > [name](./bitburner.corpmaterialconstantdata.name.md) + +## CorpMaterialConstantData.name property + +Name of the material + +Signature: + +```typescript +name: string; +``` diff --git a/markdown/bitburner.corpmaterialconstantdata.size.md b/markdown/bitburner.corpmaterialconstantdata.size.md new file mode 100644 index 000000000..a3a1190e6 --- /dev/null +++ b/markdown/bitburner.corpmaterialconstantdata.size.md @@ -0,0 +1,13 @@ + + +[Home](./index.md) > [bitburner](./bitburner.md) > [CorpMaterialConstantData](./bitburner.corpmaterialconstantdata.md) > [size](./bitburner.corpmaterialconstantdata.size.md) + +## CorpMaterialConstantData.size property + +Size of the material + +Signature: + +```typescript +size: number; +``` diff --git a/markdown/bitburner.corpmaterialname.md b/markdown/bitburner.corpmaterialname.md new file mode 100644 index 000000000..ba5f19ebd --- /dev/null +++ b/markdown/bitburner.corpmaterialname.md @@ -0,0 +1,23 @@ + + +[Home](./index.md) > [bitburner](./bitburner.md) > [CorpMaterialName](./bitburner.corpmaterialname.md) + +## CorpMaterialName type + + +Signature: + +```typescript +type CorpMaterialName = + | "Water" + | "Energy" + | "Food" + | "Plants" + | "Metal" + | "Hardware" + | "Chemicals" + | "Drugs" + | "Robots" + | "AI Cores" + | "Real Estate"; +``` diff --git a/markdown/bitburner.corporation.enums.md b/markdown/bitburner.corporation.enums.md deleted file mode 100644 index 1700462e2..000000000 --- a/markdown/bitburner.corporation.enums.md +++ /dev/null @@ -1,16 +0,0 @@ - - -[Home](./index.md) > [bitburner](./bitburner.md) > [Corporation](./bitburner.corporation.md) > [enums](./bitburner.corporation.enums.md) - -## Corporation.enums property - -Enums specific to the corporation game mechanic. - -Signature: - -```typescript -enums: { - EmployeePositions: typeof EmployeePositions; - IndustryType: typeof IndustryType; - }; -``` diff --git a/markdown/bitburner.corporation.expandcity.md b/markdown/bitburner.corporation.expandcity.md index d8b23cac4..8fb8271a9 100644 --- a/markdown/bitburner.corporation.expandcity.md +++ b/markdown/bitburner.corporation.expandcity.md @@ -9,7 +9,7 @@ Expand to a new city Signature: ```typescript -expandCity(divisionName: string, cityName: string): void; +expandCity(divisionName: string, city: CityName | `${CityName}`): void; ``` ## Parameters @@ -17,7 +17,7 @@ expandCity(divisionName: string, cityName: string): void; | Parameter | Type | Description | | --- | --- | --- | | divisionName | string | Name of the division | -| cityName | string | Name of the city | +| city | [CityName](./bitburner.cityname.md) \| \`${[CityName](./bitburner.cityname.md)}\` | Name of the city | Returns: diff --git a/markdown/bitburner.corporation.expandindustry.md b/markdown/bitburner.corporation.expandindustry.md index bc9f8f7cf..1ea9b6d01 100644 --- a/markdown/bitburner.corporation.expandindustry.md +++ b/markdown/bitburner.corporation.expandindustry.md @@ -9,14 +9,14 @@ Expand to a new industry Signature: ```typescript -expandIndustry(industryType: IndustryType | `${IndustryType}`, divisionName: string): void; +expandIndustry(industryType: CorpIndustryName, divisionName: string): void; ``` ## Parameters | Parameter | Type | Description | | --- | --- | --- | -| industryType | [IndustryType](./bitburner.industrytype.md) \| \`${[IndustryType](./bitburner.industrytype.md)}\` | Name of the industry | +| industryType | [CorpIndustryName](./bitburner.corpindustryname.md) | Name of the industry | | divisionName | string | Name of the division | Returns: diff --git a/markdown/bitburner.corporation.getconstants.md b/markdown/bitburner.corporation.getconstants.md new file mode 100644 index 000000000..80f1116fc --- /dev/null +++ b/markdown/bitburner.corporation.getconstants.md @@ -0,0 +1,19 @@ + + +[Home](./index.md) > [bitburner](./bitburner.md) > [Corporation](./bitburner.corporation.md) > [getConstants](./bitburner.corporation.getconstants.md) + +## Corporation.getConstants() method + +Get corporation related constants + +Signature: + +```typescript +getConstants(): CorpConstants; +``` +Returns: + +[CorpConstants](./bitburner.corpconstants.md) + +corporation related constants + diff --git a/markdown/bitburner.corporation.getexpandcitycost.md b/markdown/bitburner.corporation.getexpandcitycost.md deleted file mode 100644 index 99726fc89..000000000 --- a/markdown/bitburner.corporation.getexpandcitycost.md +++ /dev/null @@ -1,19 +0,0 @@ - - -[Home](./index.md) > [bitburner](./bitburner.md) > [Corporation](./bitburner.corporation.md) > [getExpandCityCost](./bitburner.corporation.getexpandcitycost.md) - -## Corporation.getExpandCityCost() method - -Gets the cost to expand into a new city - -Signature: - -```typescript -getExpandCityCost(): number; -``` -Returns: - -number - -cost - diff --git a/markdown/bitburner.corporation.getexpandindustrycost.md b/markdown/bitburner.corporation.getexpandindustrycost.md deleted file mode 100644 index ab6bcd583..000000000 --- a/markdown/bitburner.corporation.getexpandindustrycost.md +++ /dev/null @@ -1,26 +0,0 @@ - - -[Home](./index.md) > [bitburner](./bitburner.md) > [Corporation](./bitburner.corporation.md) > [getExpandIndustryCost](./bitburner.corporation.getexpandindustrycost.md) - -## Corporation.getExpandIndustryCost() method - -Gets the cost to expand into a new industry - -Signature: - -```typescript -getExpandIndustryCost(industryName: IndustryType | `${IndustryType}`): number; -``` - -## Parameters - -| Parameter | Type | Description | -| --- | --- | --- | -| industryName | [IndustryType](./bitburner.industrytype.md) \| \`${[IndustryType](./bitburner.industrytype.md)}\` | Name of the industry | - -Returns: - -number - -cost - diff --git a/markdown/bitburner.corporation.getindustrydata.md b/markdown/bitburner.corporation.getindustrydata.md new file mode 100644 index 000000000..9bb137935 --- /dev/null +++ b/markdown/bitburner.corporation.getindustrydata.md @@ -0,0 +1,24 @@ + + +[Home](./index.md) > [bitburner](./bitburner.md) > [Corporation](./bitburner.corporation.md) > [getIndustryData](./bitburner.corporation.getindustrydata.md) + +## Corporation.getIndustryData() method + +Get constant industry definition data for a specific industry + +Signature: + +```typescript +getIndustryData(industryName: CorpIndustryName): CorpIndustryData; +``` + +## Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| industryName | [CorpIndustryName](./bitburner.corpindustryname.md) | | + +Returns: + +[CorpIndustryData](./bitburner.corpindustrydata.md) + diff --git a/markdown/bitburner.corporation.getmaterialdata.md b/markdown/bitburner.corporation.getmaterialdata.md new file mode 100644 index 000000000..48ed6b5c9 --- /dev/null +++ b/markdown/bitburner.corporation.getmaterialdata.md @@ -0,0 +1,24 @@ + + +[Home](./index.md) > [bitburner](./bitburner.md) > [Corporation](./bitburner.corporation.md) > [getMaterialData](./bitburner.corporation.getmaterialdata.md) + +## Corporation.getMaterialData() method + +Get constant data for a specific material + +Signature: + +```typescript +getMaterialData(materialName: CorpMaterialName): CorpMaterialConstantData; +``` + +## Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| materialName | [CorpMaterialName](./bitburner.corpmaterialname.md) | | + +Returns: + +[CorpMaterialConstantData](./bitburner.corpmaterialconstantdata.md) + diff --git a/markdown/bitburner.corporation.getmaterialnames.md b/markdown/bitburner.corporation.getmaterialnames.md deleted file mode 100644 index 65339c74b..000000000 --- a/markdown/bitburner.corporation.getmaterialnames.md +++ /dev/null @@ -1,19 +0,0 @@ - - -[Home](./index.md) > [bitburner](./bitburner.md) > [Corporation](./bitburner.corporation.md) > [getMaterialNames](./bitburner.corporation.getmaterialnames.md) - -## Corporation.getMaterialNames() method - -Get list of materials - -Signature: - -```typescript -getMaterialNames(): string[]; -``` -Returns: - -string\[\] - -material names - diff --git a/markdown/bitburner.corporation.getresearchnames.md b/markdown/bitburner.corporation.getresearchnames.md deleted file mode 100644 index 55f0a1107..000000000 --- a/markdown/bitburner.corporation.getresearchnames.md +++ /dev/null @@ -1,19 +0,0 @@ - - -[Home](./index.md) > [bitburner](./bitburner.md) > [Corporation](./bitburner.corporation.md) > [getResearchNames](./bitburner.corporation.getresearchnames.md) - -## Corporation.getResearchNames() method - -Get list of research names - -Signature: - -```typescript -getResearchNames(): string[]; -``` -Returns: - -string\[\] - -research names - diff --git a/markdown/bitburner.corporation.getunlockables.md b/markdown/bitburner.corporation.getunlockables.md deleted file mode 100644 index 36f422178..000000000 --- a/markdown/bitburner.corporation.getunlockables.md +++ /dev/null @@ -1,19 +0,0 @@ - - -[Home](./index.md) > [bitburner](./bitburner.md) > [Corporation](./bitburner.corporation.md) > [getUnlockables](./bitburner.corporation.getunlockables.md) - -## Corporation.getUnlockables() method - -Get list of one-time unlockable upgrades - -Signature: - -```typescript -getUnlockables(): string[]; -``` -Returns: - -string\[\] - -unlockable upgrades names - diff --git a/markdown/bitburner.corporation.getupgradenames.md b/markdown/bitburner.corporation.getupgradenames.md deleted file mode 100644 index 936891689..000000000 --- a/markdown/bitburner.corporation.getupgradenames.md +++ /dev/null @@ -1,19 +0,0 @@ - - -[Home](./index.md) > [bitburner](./bitburner.md) > [Corporation](./bitburner.corporation.md) > [getUpgradeNames](./bitburner.corporation.getupgradenames.md) - -## Corporation.getUpgradeNames() method - -Get list of upgrade names - -Signature: - -```typescript -getUpgradeNames(): string[]; -``` -Returns: - -string\[\] - -upgrade names - diff --git a/markdown/bitburner.corporation.issuenewshares.md b/markdown/bitburner.corporation.issuenewshares.md new file mode 100644 index 000000000..8ea8a102f --- /dev/null +++ b/markdown/bitburner.corporation.issuenewshares.md @@ -0,0 +1,26 @@ + + +[Home](./index.md) > [bitburner](./bitburner.md) > [Corporation](./bitburner.corporation.md) > [issueNewShares](./bitburner.corporation.issuenewshares.md) + +## Corporation.issueNewShares() method + +Issue new shares + +Signature: + +```typescript +issueNewShares(amount?: number): number; +``` + +## Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| amount | number | Number of new shares to issue, will be rounded to nearest 10m. Defaults to max amount. | + +Returns: + +number + +Amount of funds generated for the corporation. + diff --git a/markdown/bitburner.corporation.md b/markdown/bitburner.corporation.md index 8139ad688..c99284271 100644 --- a/markdown/bitburner.corporation.md +++ b/markdown/bitburner.corporation.md @@ -13,12 +13,6 @@ export interface Corporation extends WarehouseAPI, OfficeAPI ``` Extends: [WarehouseAPI](./bitburner.warehouseapi.md), [OfficeAPI](./bitburner.officeapi.md) -## Properties - -| Property | Type | Description | -| --- | --- | --- | -| [enums](./bitburner.corporation.enums.md) | { EmployeePositions: typeof [EmployeePositions](./bitburner.employeepositions.md); IndustryType: typeof [IndustryType](./bitburner.industrytype.md); } | Enums specific to the corporation game mechanic. | - ## Methods | Method | Description | @@ -27,25 +21,23 @@ export interface Corporation extends WarehouseAPI, OfficeAPI | [bribe(factionName, amountCash)](./bitburner.corporation.bribe.md) | Bribe a faction | | [buyBackShares(amount)](./bitburner.corporation.buybackshares.md) | Buyback Shares | | [createCorporation(corporationName, selfFund)](./bitburner.corporation.createcorporation.md) | Create a Corporation | -| [expandCity(divisionName, cityName)](./bitburner.corporation.expandcity.md) | Expand to a new city | +| [expandCity(divisionName, city)](./bitburner.corporation.expandcity.md) | Expand to a new city | | [expandIndustry(industryType, divisionName)](./bitburner.corporation.expandindustry.md) | Expand to a new industry | | [getBonusTime()](./bitburner.corporation.getbonustime.md) | Get bonus time. “Bonus time” is accumulated when the game is offline or if the game is inactive in the browser. “Bonus time” makes the game progress faster. | +| [getConstants()](./bitburner.corporation.getconstants.md) | Get corporation related constants | | [getCorporation()](./bitburner.corporation.getcorporation.md) | Get corporation data | | [getDivision(divisionName)](./bitburner.corporation.getdivision.md) | Get division data | -| [getExpandCityCost()](./bitburner.corporation.getexpandcitycost.md) | Gets the cost to expand into a new city | -| [getExpandIndustryCost(industryName)](./bitburner.corporation.getexpandindustrycost.md) | Gets the cost to expand into a new industry | +| [getIndustryData(industryName)](./bitburner.corporation.getindustrydata.md) | Get constant industry definition data for a specific industry | | [getInvestmentOffer()](./bitburner.corporation.getinvestmentoffer.md) | Get an offer for investment based on you companies current valuation | -| [getMaterialNames()](./bitburner.corporation.getmaterialnames.md) | Get list of materials | -| [getResearchNames()](./bitburner.corporation.getresearchnames.md) | Get list of research names | -| [getUnlockables()](./bitburner.corporation.getunlockables.md) | Get list of one-time unlockable upgrades | +| [getMaterialData(materialName)](./bitburner.corporation.getmaterialdata.md) | Get constant data for a specific material | | [getUnlockUpgradeCost(upgradeName)](./bitburner.corporation.getunlockupgradecost.md) | Gets the cost to unlock a one time unlockable upgrade | | [getUpgradeLevel(upgradeName)](./bitburner.corporation.getupgradelevel.md) | Get the level of a levelable upgrade | | [getUpgradeLevelCost(upgradeName)](./bitburner.corporation.getupgradelevelcost.md) | Gets the cost to unlock the next level of a levelable upgrade | -| [getUpgradeNames()](./bitburner.corporation.getupgradenames.md) | Get list of upgrade names | | [goPublic(numShares)](./bitburner.corporation.gopublic.md) | Go public | | [hasCorporation()](./bitburner.corporation.hascorporation.md) | Returns whether the player has a corporation. Does not require API access. | | [hasUnlockUpgrade(upgradeName)](./bitburner.corporation.hasunlockupgrade.md) | Check if you have a one time unlockable upgrade | | [issueDividends(rate)](./bitburner.corporation.issuedividends.md) | Issue dividends | +| [issueNewShares(amount)](./bitburner.corporation.issuenewshares.md) | Issue new shares | | [levelUpgrade(upgradeName)](./bitburner.corporation.levelupgrade.md) | Level an upgrade. | | [sellShares(amount)](./bitburner.corporation.sellshares.md) | Sell Shares | | [unlockUpgrade(upgradeName)](./bitburner.corporation.unlockupgrade.md) | Unlock an upgrade | diff --git a/markdown/bitburner.corporationinfo.divisions.md b/markdown/bitburner.corporationinfo.divisions.md index eb58a0f87..2b72b8685 100644 --- a/markdown/bitburner.corporationinfo.divisions.md +++ b/markdown/bitburner.corporationinfo.divisions.md @@ -4,10 +4,10 @@ ## CorporationInfo.divisions property -Array of all divisions +Array of all division names Signature: ```typescript -divisions: Division[]; +divisions: string[]; ``` diff --git a/markdown/bitburner.corporationinfo.md b/markdown/bitburner.corporationinfo.md index 5f61a9567..5921d4032 100644 --- a/markdown/bitburner.corporationinfo.md +++ b/markdown/bitburner.corporationinfo.md @@ -19,7 +19,7 @@ interface CorporationInfo | [dividendEarnings](./bitburner.corporationinfo.dividendearnings.md) | number | Your earnings as a shareholder per second this cycle | | [dividendRate](./bitburner.corporationinfo.dividendrate.md) | number | Fraction of profits issued as dividends | | [dividendTax](./bitburner.corporationinfo.dividendtax.md) | number | Tax applied on your earnings as a shareholder | -| [divisions](./bitburner.corporationinfo.divisions.md) | [Division](./bitburner.division.md)\[\] | Array of all divisions | +| [divisions](./bitburner.corporationinfo.divisions.md) | string\[\] | Array of all division names | | [expenses](./bitburner.corporationinfo.expenses.md) | number | Expenses per second this cycle | | [funds](./bitburner.corporationinfo.funds.md) | number | Funds available | | [issuedShares](./bitburner.corporationinfo.issuedshares.md) | number | Amount of acquirable shares. | diff --git a/markdown/bitburner.corpproductdata.md b/markdown/bitburner.corpproductdata.md new file mode 100644 index 000000000..63dd1f473 --- /dev/null +++ b/markdown/bitburner.corpproductdata.md @@ -0,0 +1,25 @@ + + +[Home](./index.md) > [bitburner](./bitburner.md) > [CorpProductData](./bitburner.corpproductdata.md) + +## CorpProductData type + +Product rating information + +Signature: + +```typescript +type CorpProductData = { + name: string; + verb: string; + desc: string; + ratingWeights: { + aesthetics?: number; + durability?: number; + features?: number; + quality?: number; + performance?: number; + reliability?: number; + }; +}; +``` diff --git a/markdown/bitburner.corpresearchname.md b/markdown/bitburner.corpresearchname.md new file mode 100644 index 000000000..c506a8d1c --- /dev/null +++ b/markdown/bitburner.corpresearchname.md @@ -0,0 +1,35 @@ + + +[Home](./index.md) > [bitburner](./bitburner.md) > [CorpResearchName](./bitburner.corpresearchname.md) + +## CorpResearchName type + + +Signature: + +```typescript +type CorpResearchName = + | "Hi-Tech R&D Laboratory" + | "AutoBrew" + | "AutoPartyManager" + | "Automatic Drug Administration" + | "Bulk Purchasing" + | "CPH4 Injections" + | "Drones" + | "Drones - Assembly" + | "Drones - Transport" + | "Go-Juice" + | "HRBuddy-Recruitment" + | "HRBuddy-Training" + | "JoyWire" + | "Market-TA.I" + | "Market-TA.II" + | "Overclock" + | "Self-Correcting Assemblers" + | "Sti.mu" + | "uPgrade: Capacity.I" + | "uPgrade: Capacity.II" + | "uPgrade: Dashboard" + | "uPgrade: Fulcrum" + | "sudo.Assist"; +``` diff --git a/markdown/bitburner.corpstatename.md b/markdown/bitburner.corpstatename.md new file mode 100644 index 000000000..a9aa15716 --- /dev/null +++ b/markdown/bitburner.corpstatename.md @@ -0,0 +1,12 @@ + + +[Home](./index.md) > [bitburner](./bitburner.md) > [CorpStateName](./bitburner.corpstatename.md) + +## CorpStateName type + + +Signature: + +```typescript +type CorpStateName = "START" | "PURCHASE" | "PRODUCTION" | "SALE" | "EXPORT"; +``` diff --git a/markdown/bitburner.corpunlockname.md b/markdown/bitburner.corpunlockname.md new file mode 100644 index 000000000..0749cec81 --- /dev/null +++ b/markdown/bitburner.corpunlockname.md @@ -0,0 +1,21 @@ + + +[Home](./index.md) > [bitburner](./bitburner.md) > [CorpUnlockName](./bitburner.corpunlockname.md) + +## CorpUnlockName type + + +Signature: + +```typescript +type CorpUnlockName = + | "Export" + | "Smart Supply" + | "Market Research - Demand" + | "Market Data - Competition" + | "VeChain" + | "Shady Accounting" + | "Government Partnership" + | "Warehouse API" + | "Office API"; +``` diff --git a/markdown/bitburner.corpupgradename.md b/markdown/bitburner.corpupgradename.md new file mode 100644 index 000000000..7a3f6b96f --- /dev/null +++ b/markdown/bitburner.corpupgradename.md @@ -0,0 +1,22 @@ + + +[Home](./index.md) > [bitburner](./bitburner.md) > [CorpUpgradeName](./bitburner.corpupgradename.md) + +## CorpUpgradeName type + + +Signature: + +```typescript +type CorpUpgradeName = + | "Smart Factories" + | "Smart Storage" + | "DreamSense" + | "Wilson Analytics" + | "Nuoptimal Nootropic Injector Implants" + | "Speech Processor Implants" + | "Neural Accelerators" + | "FocusWires" + | "ABC SalesBots" + | "Project Insight"; +``` diff --git a/markdown/bitburner.division.cities.md b/markdown/bitburner.division.cities.md index 0f24b160c..921014f19 100644 --- a/markdown/bitburner.division.cities.md +++ b/markdown/bitburner.division.cities.md @@ -9,5 +9,5 @@ Cities in which this division has expanded Signature: ```typescript -cities: string[]; +cities: CityName[]; ``` diff --git a/markdown/bitburner.division.md b/markdown/bitburner.division.md index 48d3e2de4..64a0b4de3 100644 --- a/markdown/bitburner.division.md +++ b/markdown/bitburner.division.md @@ -17,7 +17,7 @@ interface Division | Property | Type | Description | | --- | --- | --- | | [awareness](./bitburner.division.awareness.md) | number | Awareness of the division | -| [cities](./bitburner.division.cities.md) | string\[\] | Cities in which this division has expanded | +| [cities](./bitburner.division.cities.md) | [CityName](./bitburner.cityname.md)\[\] | Cities in which this division has expanded | | [lastCycleExpenses](./bitburner.division.lastcycleexpenses.md) | number | Expenses last cycle | | [lastCycleRevenue](./bitburner.division.lastcyclerevenue.md) | number | Revenue last cycle | | [makesProducts](./bitburner.division.makesproducts.md) | boolean | Whether the industry this division is in is capable of making products | @@ -28,6 +28,6 @@ interface Division | [research](./bitburner.division.research.md) | number | Amount of research in that division | | [thisCycleExpenses](./bitburner.division.thiscycleexpenses.md) | number | Expenses this cycle | | [thisCycleRevenue](./bitburner.division.thiscyclerevenue.md) | number | Revenue this cycle | -| [type](./bitburner.division.type.md) | string | Type of division, like Agriculture | +| [type](./bitburner.division.type.md) | [CorpIndustryName](./bitburner.corpindustryname.md) | Type of division, like Agriculture | | [upgrades](./bitburner.division.upgrades.md) | number\[\] | All research bought | diff --git a/markdown/bitburner.division.type.md b/markdown/bitburner.division.type.md index 30b7a7c79..525d553b3 100644 --- a/markdown/bitburner.division.type.md +++ b/markdown/bitburner.division.type.md @@ -9,5 +9,5 @@ Type of division, like Agriculture Signature: ```typescript -type: string; +type: CorpIndustryName; ``` diff --git a/markdown/bitburner.employeepositions.md b/markdown/bitburner.employeepositions.md deleted file mode 100644 index 49a1d9fed..000000000 --- a/markdown/bitburner.employeepositions.md +++ /dev/null @@ -1,25 +0,0 @@ - - -[Home](./index.md) > [bitburner](./bitburner.md) > [EmployeePositions](./bitburner.employeepositions.md) - -## EmployeePositions enum - - -Signature: - -```typescript -declare enum EmployeePositions -``` - -## Enumeration Members - -| Member | Value | Description | -| --- | --- | --- | -| Business | "Business" | | -| Engineer | "Engineer" | | -| Management | "Management" | | -| Operations | "Operations" | | -| RandD | "Research & Development" | | -| Training | "Training" | | -| Unassigned | "Unassigned" | | - diff --git a/markdown/bitburner.export.loc.md b/markdown/bitburner.export.loc.md index dc969ffc9..1c7f10616 100644 --- a/markdown/bitburner.export.loc.md +++ b/markdown/bitburner.export.loc.md @@ -9,5 +9,5 @@ City the material is being exported to Signature: ```typescript -loc: string; +loc: CityName; ``` diff --git a/markdown/bitburner.export.md b/markdown/bitburner.export.md index 60d5300c0..c0b20466a 100644 --- a/markdown/bitburner.export.md +++ b/markdown/bitburner.export.md @@ -18,5 +18,5 @@ interface Export | --- | --- | --- | | [amt](./bitburner.export.amt.md) | string | Amount of material exported | | [div](./bitburner.export.div.md) | string | Division the material is being exported to | -| [loc](./bitburner.export.loc.md) | string | City the material is being exported to | +| [loc](./bitburner.export.loc.md) | [CityName](./bitburner.cityname.md) | City the material is being exported to | diff --git a/markdown/bitburner.ilocation.city.md b/markdown/bitburner.ilocation.city.md index 5ff25d8df..dfe1d9be2 100644 --- a/markdown/bitburner.ilocation.city.md +++ b/markdown/bitburner.ilocation.city.md @@ -7,5 +7,5 @@ Signature: ```typescript -city: string; +city: CityName; ``` diff --git a/markdown/bitburner.ilocation.md b/markdown/bitburner.ilocation.md index b448410e3..e47b75a61 100644 --- a/markdown/bitburner.ilocation.md +++ b/markdown/bitburner.ilocation.md @@ -15,6 +15,6 @@ interface ILocation | Property | Type | Description | | --- | --- | --- | -| [city](./bitburner.ilocation.city.md) | string | | -| [name](./bitburner.ilocation.name.md) | string | | +| [city](./bitburner.ilocation.city.md) | [CityName](./bitburner.cityname.md) | | +| [name](./bitburner.ilocation.name.md) | [LocationName](./bitburner.locationname.md) | | diff --git a/markdown/bitburner.ilocation.name.md b/markdown/bitburner.ilocation.name.md index d91bf6201..9a7f08feb 100644 --- a/markdown/bitburner.ilocation.name.md +++ b/markdown/bitburner.ilocation.name.md @@ -7,5 +7,5 @@ Signature: ```typescript -name: string; +name: LocationName; ``` diff --git a/markdown/bitburner.industrydata.cost.md b/markdown/bitburner.industrydata.cost.md new file mode 100644 index 000000000..b41589a35 --- /dev/null +++ b/markdown/bitburner.industrydata.cost.md @@ -0,0 +1,13 @@ + + +[Home](./index.md) > [bitburner](./bitburner.md) > [IndustryData](./bitburner.industrydata.md) > [cost](./bitburner.industrydata.cost.md) + +## IndustryData.cost property + +Cost to expand to the division + +Signature: + +```typescript +cost: number; +``` diff --git a/markdown/bitburner.industrydata.makesmaterials.md b/markdown/bitburner.industrydata.makesmaterials.md new file mode 100644 index 000000000..db197a528 --- /dev/null +++ b/markdown/bitburner.industrydata.makesmaterials.md @@ -0,0 +1,13 @@ + + +[Home](./index.md) > [bitburner](./bitburner.md) > [IndustryData](./bitburner.industrydata.md) > [makesMaterials](./bitburner.industrydata.makesmaterials.md) + +## IndustryData.makesMaterials property + +Whether the division makes materials + +Signature: + +```typescript +makesMaterials: boolean; +``` diff --git a/markdown/bitburner.industrydata.makesproducts.md b/markdown/bitburner.industrydata.makesproducts.md new file mode 100644 index 000000000..274118953 --- /dev/null +++ b/markdown/bitburner.industrydata.makesproducts.md @@ -0,0 +1,13 @@ + + +[Home](./index.md) > [bitburner](./bitburner.md) > [IndustryData](./bitburner.industrydata.md) > [makesProducts](./bitburner.industrydata.makesproducts.md) + +## IndustryData.makesProducts property + +Whether the division makes products + +Signature: + +```typescript +makesProducts: boolean; +``` diff --git a/markdown/bitburner.industrydata.md b/markdown/bitburner.industrydata.md new file mode 100644 index 000000000..877ae4b24 --- /dev/null +++ b/markdown/bitburner.industrydata.md @@ -0,0 +1,26 @@ + + +[Home](./index.md) > [bitburner](./bitburner.md) > [IndustryData](./bitburner.industrydata.md) + +## IndustryData interface + +Corporation industry information + +Signature: + +```typescript +interface IndustryData +``` + +## Properties + +| Property | Type | Description | +| --- | --- | --- | +| [cost](./bitburner.industrydata.cost.md) | number | Cost to expand to the division | +| [makesMaterials](./bitburner.industrydata.makesmaterials.md) | boolean | Whether the division makes materials | +| [makesProducts](./bitburner.industrydata.makesproducts.md) | boolean | Whether the division makes products | +| [producedMaterials?](./bitburner.industrydata.producedmaterials.md) | string\[\] | (Optional) Materials produced | +| [productType?](./bitburner.industrydata.producttype.md) | string | (Optional) Product type | +| [requiredMaterials](./bitburner.industrydata.requiredmaterials.md) | Record<string, number> | Materials required for production and their amounts | +| [type](./bitburner.industrydata.type.md) | [CorpIndustryName](./bitburner.corpindustryname.md) | Industry type | + diff --git a/markdown/bitburner.industrydata.producedmaterials.md b/markdown/bitburner.industrydata.producedmaterials.md new file mode 100644 index 000000000..80feafb86 --- /dev/null +++ b/markdown/bitburner.industrydata.producedmaterials.md @@ -0,0 +1,13 @@ + + +[Home](./index.md) > [bitburner](./bitburner.md) > [IndustryData](./bitburner.industrydata.md) > [producedMaterials](./bitburner.industrydata.producedmaterials.md) + +## IndustryData.producedMaterials property + +Materials produced + +Signature: + +```typescript +producedMaterials?: string[]; +``` diff --git a/markdown/bitburner.industrydata.producttype.md b/markdown/bitburner.industrydata.producttype.md new file mode 100644 index 000000000..369fe80e1 --- /dev/null +++ b/markdown/bitburner.industrydata.producttype.md @@ -0,0 +1,13 @@ + + +[Home](./index.md) > [bitburner](./bitburner.md) > [IndustryData](./bitburner.industrydata.md) > [productType](./bitburner.industrydata.producttype.md) + +## IndustryData.productType property + +Product type + +Signature: + +```typescript +productType?: string; +``` diff --git a/markdown/bitburner.industrydata.requiredmaterials.md b/markdown/bitburner.industrydata.requiredmaterials.md new file mode 100644 index 000000000..6839e49d7 --- /dev/null +++ b/markdown/bitburner.industrydata.requiredmaterials.md @@ -0,0 +1,13 @@ + + +[Home](./index.md) > [bitburner](./bitburner.md) > [IndustryData](./bitburner.industrydata.md) > [requiredMaterials](./bitburner.industrydata.requiredmaterials.md) + +## IndustryData.requiredMaterials property + +Materials required for production and their amounts + +Signature: + +```typescript +requiredMaterials: Record; +``` diff --git a/markdown/bitburner.industrydata.type.md b/markdown/bitburner.industrydata.type.md new file mode 100644 index 000000000..0c4ff151d --- /dev/null +++ b/markdown/bitburner.industrydata.type.md @@ -0,0 +1,13 @@ + + +[Home](./index.md) > [bitburner](./bitburner.md) > [IndustryData](./bitburner.industrydata.md) > [type](./bitburner.industrydata.type.md) + +## IndustryData.type property + +Industry type + +Signature: + +```typescript +type: CorpIndustryName; +``` diff --git a/markdown/bitburner.industrytype.md b/markdown/bitburner.industrytype.md deleted file mode 100644 index e58b7ace7..000000000 --- a/markdown/bitburner.industrytype.md +++ /dev/null @@ -1,32 +0,0 @@ - - -[Home](./index.md) > [bitburner](./bitburner.md) > [IndustryType](./bitburner.industrytype.md) - -## IndustryType enum - - -Signature: - -```typescript -declare enum IndustryType -``` - -## Enumeration Members - -| Member | Value | Description | -| --- | --- | --- | -| Agriculture | "Agriculture" | | -| Chemical | "Chemical" | | -| Computers | "Computer Hardware" | | -| Energy | "Energy" | | -| Fishing | "Fishing" | | -| Food | "Food" | | -| Healthcare | "Healthcare" | | -| Mining | "Mining" | | -| Pharmaceutical | "Pharmaceutical" | | -| RealEstate | "RealEstate" | | -| Robotics | "Robotics" | | -| Software | "Software" | | -| Tobacco | "Tobacco" | | -| Utilities | "Water Utilities" | | - diff --git a/markdown/bitburner.jobname.md b/markdown/bitburner.jobname.md new file mode 100644 index 000000000..e39fc611a --- /dev/null +++ b/markdown/bitburner.jobname.md @@ -0,0 +1,56 @@ + + +[Home](./index.md) > [bitburner](./bitburner.md) > [JobName](./bitburner.jobname.md) + +## JobName enum + + +Signature: + +```typescript +declare enum JobName +``` + +## Enumeration Members + +| Member | Value | Description | +| --- | --- | --- | +| agent0 | "Field Agent" | | +| agent1 | "Secret Agent" | | +| agent2 | "Special Operative" | | +| business0 | "Business Intern" | | +| business1 | "Business Analyst" | | +| business2 | "Business Manager" | | +| business3 | "Operations Manager" | | +| business4 | "Chief Financial Officer" | | +| business5 | "Chief Executive Officer" | | +| businessConsult0 | "Business Consultant" | | +| businessConsult1 | "Senior Business Consultant" | | +| employee | "Employee" | | +| employeePT | "Part-time Employee" | | +| IT0 | "IT Intern" | | +| IT1 | "IT Analyst" | | +| IT2 | "IT Manager" | | +| IT3 | "Systems Administrator" | | +| networkEng0 | "Network Engineer" | | +| networkEng1 | "Network Administrator" | | +| security0 | "Police Officer" | | +| security1 | "Police Chief" | | +| security2 | "Security Guard" | | +| security3 | "Security Officer" | | +| security4 | "Security Supervisor" | | +| security5 | "Head of Security" | | +| securityEng | "Security Engineer" | | +| software0 | "Software Engineering Intern" | | +| software1 | "Junior Software Engineer" | | +| software2 | "Senior Software Engineer" | | +| software3 | "Lead Software Developer" | | +| software4 | "Head of Software" | | +| software5 | "Head of Engineering" | | +| software6 | "Vice President of Technology" | | +| software7 | "Chief Technology Officer" | | +| softwareConsult0 | "Software Consultant" | | +| softwareConsult1 | "Senior Software Consultant" | | +| waiter | "Waiter" | | +| waiterPT | "Part-time Waiter" | | + diff --git a/markdown/bitburner.material.md b/markdown/bitburner.material.md index 29836ebee..537bdc6d9 100644 --- a/markdown/bitburner.material.md +++ b/markdown/bitburner.material.md @@ -20,7 +20,7 @@ interface Material | [cost](./bitburner.material.cost.md) | number | Cost to buy material | | [dmd](./bitburner.material.dmd.md) | number \| undefined | Demand for the material, only present if "Market Research - Demand" unlocked | | [exp](./bitburner.material.exp.md) | [Export](./bitburner.export.md)\[\] | Export orders | -| [name](./bitburner.material.name.md) | string | Name of the material | +| [name](./bitburner.material.name.md) | [CorpMaterialName](./bitburner.corpmaterialname.md) | Name of the material | | [prod](./bitburner.material.prod.md) | number | Amount of material produced | | [qlt](./bitburner.material.qlt.md) | number | Quality of the material | | [qty](./bitburner.material.qty.md) | number | Amount of material | diff --git a/markdown/bitburner.material.name.md b/markdown/bitburner.material.name.md index 04f62762f..a0780e632 100644 --- a/markdown/bitburner.material.name.md +++ b/markdown/bitburner.material.name.md @@ -9,5 +9,5 @@ Name of the material Signature: ```typescript -name: string; +name: CorpMaterialName; ``` diff --git a/markdown/bitburner.md b/markdown/bitburner.md index 6f3c0c0e3..605cb9c48 100644 --- a/markdown/bitburner.md +++ b/markdown/bitburner.md @@ -8,12 +8,11 @@ | Enumeration | Description | | --- | --- | -| [CompanyPosName](./bitburner.companyposname.md) | | +| [CityName](./bitburner.cityname.md) | Names of all cities | | [CrimeType](./bitburner.crimetype.md) | | -| [EmployeePositions](./bitburner.employeepositions.md) | | | [FactionWorkType](./bitburner.factionworktype.md) | | | [GymType](./bitburner.gymtype.md) | | -| [IndustryType](./bitburner.industrytype.md) | | +| [JobName](./bitburner.jobname.md) | | | [LocationName](./bitburner.locationname.md) | Names of all locations | | [OrderTypes](./bitburner.ordertypes.md) | | | [PositionTypes](./bitburner.positiontypes.md) | | @@ -32,6 +31,9 @@ | [Bladeburner](./bitburner.bladeburner.md) | Bladeburner API | | [BladeburnerCurAction](./bitburner.bladeburnercuraction.md) | Bladeburner current action. | | [CodingContract](./bitburner.codingcontract.md) | Coding Contract API | +| [CorpConstants](./bitburner.corpconstants.md) | Corporation related constants | +| [CorpIndustryData](./bitburner.corpindustrydata.md) | Data for an individual industry | +| [CorpMaterialConstantData](./bitburner.corpmaterialconstantdata.md) | Corporation material information | | [Corporation](./bitburner.corporation.md) | Corporation API | | [CorporationInfo](./bitburner.corporationinfo.md) | General info about a corporation | | [CrimeStats](./bitburner.crimestats.md) | Data representing the internal values of a crime. | @@ -61,6 +63,7 @@ | [HacknetServersFormulas](./bitburner.hacknetserversformulas.md) | Hacknet Server formulas | | [HP](./bitburner.hp.md) | | | [ILocation](./bitburner.ilocation.md) | | +| [IndustryData](./bitburner.industrydata.md) | Corporation industry information | | [Infiltration](./bitburner.infiltration.md) | Infiltration API. | | [InfiltrationLocation](./bitburner.infiltrationlocation.md) | | | [InfiltrationReward](./bitburner.infiltrationreward.md) | | @@ -105,6 +108,14 @@ | Type Alias | Description | | --- | --- | | [CodingContractData](./bitburner.codingcontractdata.md) | Coding contract data will differ depending on coding contract. | +| [CorpEmployeePosition](./bitburner.corpemployeeposition.md) | | +| [CorpIndustryName](./bitburner.corpindustryname.md) | | +| [CorpMaterialName](./bitburner.corpmaterialname.md) | | +| [CorpProductData](./bitburner.corpproductdata.md) | Product rating information | +| [CorpResearchName](./bitburner.corpresearchname.md) | | +| [CorpStateName](./bitburner.corpstatename.md) | | +| [CorpUnlockName](./bitburner.corpunlockname.md) | | +| [CorpUpgradeName](./bitburner.corpupgradename.md) | | | [FilenameOrPID](./bitburner.filenameorpid.md) | | | [NSEnums](./bitburner.nsenums.md) | | | [PortData](./bitburner.portdata.md) | | diff --git a/markdown/bitburner.ns.gethackingmultipliers.md b/markdown/bitburner.ns.gethackingmultipliers.md index f44258729..9a8be05f2 100644 --- a/markdown/bitburner.ns.gethackingmultipliers.md +++ b/markdown/bitburner.ns.gethackingmultipliers.md @@ -19,7 +19,7 @@ Object containing the Player’s hacking related multipliers. ## Remarks -RAM cost: 4 GB +RAM cost: 0.25 GB Returns an object containing the Player’s hacking related multipliers. These multipliers are returned in fractional forms, not percentages (e.g. 1.5 instead of 150%). diff --git a/markdown/bitburner.ns.gethacknetmultipliers.md b/markdown/bitburner.ns.gethacknetmultipliers.md index c720f04a4..8deeba51f 100644 --- a/markdown/bitburner.ns.gethacknetmultipliers.md +++ b/markdown/bitburner.ns.gethacknetmultipliers.md @@ -19,7 +19,7 @@ Object containing the Player’s hacknet related multipliers. ## Remarks -RAM cost: 4 GB +RAM cost: 0.25 GB Returns an object containing the Player’s hacknet related multipliers. These multipliers are returned in fractional forms, not percentages (e.g. 1.5 instead of 150%). diff --git a/markdown/bitburner.ns.md b/markdown/bitburner.ns.md index c15c5e693..ef6918fba 100644 --- a/markdown/bitburner.ns.md +++ b/markdown/bitburner.ns.md @@ -50,6 +50,7 @@ export async function main(ns) { | [grafting](./bitburner.ns.grafting.md) | [Grafting](./bitburner.grafting.md) | Namespace for grafting functions. | | [hacknet](./bitburner.ns.hacknet.md) | [Hacknet](./bitburner.hacknet.md) | Namespace for hacknet functions. | | [infiltration](./bitburner.ns.infiltration.md) | [Infiltration](./bitburner.infiltration.md) | Namespace for infiltration functions. RAM cost: 0 GB | +| [pid](./bitburner.ns.pid.md) | number | The current script's PID | | [singularity](./bitburner.ns.singularity.md) | [Singularity](./bitburner.singularity.md) | Namespace for singularity functions. RAM cost: 0 GB | | [sleeve](./bitburner.ns.sleeve.md) | [Sleeve](./bitburner.sleeve.md) | Namespace for sleeve functions. | | [stanek](./bitburner.ns.stanek.md) | [Stanek](./bitburner.stanek.md) | Namespace for stanek functions. RAM cost: 0 GB | diff --git a/markdown/bitburner.ns.pid.md b/markdown/bitburner.ns.pid.md new file mode 100644 index 000000000..d2f666a2e --- /dev/null +++ b/markdown/bitburner.ns.pid.md @@ -0,0 +1,13 @@ + + +[Home](./index.md) > [bitburner](./bitburner.md) > [NS](./bitburner.ns.md) > [pid](./bitburner.ns.pid.md) + +## NS.pid property + +The current script's PID + +Signature: + +```typescript +readonly pid: number; +``` diff --git a/markdown/bitburner.ns.scp.md b/markdown/bitburner.ns.scp.md index e20aaee69..8bd95155e 100644 --- a/markdown/bitburner.ns.scp.md +++ b/markdown/bitburner.ns.scp.md @@ -16,7 +16,7 @@ scp(files: string | string[], destination: string, source?: string): boolean; | Parameter | Type | Description | | --- | --- | --- | -| files | string \| string\[\] | Filename or an array of filenames of script/literature files to copy. | +| files | string \| string\[\] | Filename or an array of filenames of script/literature files to copy. Note that if a file is located in a subdirectory, the filename must include the leading /. | | destination | string | Hostname of the destination server, which is the server to which the file will be copied. | | source | string | Hostname of the source server, which is the server from which the file will be copied. This argument is optional and if it’s omitted the source will be the current server. | diff --git a/markdown/bitburner.nsenums.md b/markdown/bitburner.nsenums.md index 85364c3e0..3324c47f6 100644 --- a/markdown/bitburner.nsenums.md +++ b/markdown/bitburner.nsenums.md @@ -9,14 +9,15 @@ ```typescript export type NSEnums = { - toast: typeof ToastVariant; + CityName: typeof CityName; CrimeType: typeof CrimeType; FactionWorkType: typeof FactionWorkType; GymType: typeof GymType; - UniversityClassType: typeof UniversityClassType; - CompanyPosName: typeof CompanyPosName; + JobName: typeof JobName; LocationName: typeof LocationName; + ToastVariant: typeof ToastVariant; + UniversityClassType: typeof UniversityClassType; }; ``` -References: [ToastVariant](./bitburner.toastvariant.md), [CrimeType](./bitburner.crimetype.md), [FactionWorkType](./bitburner.factionworktype.md), [GymType](./bitburner.gymtype.md), [UniversityClassType](./bitburner.universityclasstype.md), [CompanyPosName](./bitburner.companyposname.md), [LocationName](./bitburner.locationname.md) +References: [CityName](./bitburner.cityname.md), [CrimeType](./bitburner.crimetype.md), [FactionWorkType](./bitburner.factionworktype.md), [GymType](./bitburner.gymtype.md), [JobName](./bitburner.jobname.md), [LocationName](./bitburner.locationname.md), [ToastVariant](./bitburner.toastvariant.md), [UniversityClassType](./bitburner.universityclasstype.md) diff --git a/markdown/bitburner.office.employeejobs.md b/markdown/bitburner.office.employeejobs.md index 05d2b2603..debdb5eff 100644 --- a/markdown/bitburner.office.employeejobs.md +++ b/markdown/bitburner.office.employeejobs.md @@ -9,5 +9,5 @@ Positions of the employees Signature: ```typescript -employeeJobs: Record<`${EmployeePositions}`, number>; +employeeJobs: Record; ``` diff --git a/markdown/bitburner.office.employeeprod.md b/markdown/bitburner.office.employeeprod.md index 7190b0939..9efcdbe6e 100644 --- a/markdown/bitburner.office.employeeprod.md +++ b/markdown/bitburner.office.employeeprod.md @@ -9,5 +9,5 @@ Production of the employees Signature: ```typescript -employeeProd: Record<`${EmployeePositions}`, number>; +employeeProd: Record; ``` diff --git a/markdown/bitburner.office.loc.md b/markdown/bitburner.office.loc.md index 7944150f1..4e544bd6d 100644 --- a/markdown/bitburner.office.loc.md +++ b/markdown/bitburner.office.loc.md @@ -9,5 +9,5 @@ City of the office Signature: ```typescript -loc: string; +loc: CityName; ``` diff --git a/markdown/bitburner.office.md b/markdown/bitburner.office.md index ee1cc7956..aaefadbc8 100644 --- a/markdown/bitburner.office.md +++ b/markdown/bitburner.office.md @@ -19,10 +19,10 @@ export interface Office | [avgEne](./bitburner.office.avgene.md) | number | Average energy of the employees | | [avgHap](./bitburner.office.avghap.md) | number | Average happiness of the employees | | [avgMor](./bitburner.office.avgmor.md) | number | Average morale of the employees | -| [employeeJobs](./bitburner.office.employeejobs.md) | Record<\`${[EmployeePositions](./bitburner.employeepositions.md)}\`, number> | Positions of the employees | -| [employeeProd](./bitburner.office.employeeprod.md) | Record<\`${[EmployeePositions](./bitburner.employeepositions.md)}\`, number> | Production of the employees | +| [employeeJobs](./bitburner.office.employeejobs.md) | Record<[CorpEmployeePosition](./bitburner.corpemployeeposition.md), number> | Positions of the employees | +| [employeeProd](./bitburner.office.employeeprod.md) | Record<[CorpEmployeePosition](./bitburner.corpemployeeposition.md), number> | Production of the employees | | [employees](./bitburner.office.employees.md) | number | Amount of employees | -| [loc](./bitburner.office.loc.md) | string | City of the office | +| [loc](./bitburner.office.loc.md) | [CityName](./bitburner.cityname.md) | City of the office | | [maxEne](./bitburner.office.maxene.md) | number | Maximum amount of energy of the employees | | [maxHap](./bitburner.office.maxhap.md) | number | Maximum happiness of the employees | | [maxMor](./bitburner.office.maxmor.md) | number | Maximum morale of the employees | diff --git a/markdown/bitburner.officeapi.buycoffee.md b/markdown/bitburner.officeapi.buycoffee.md index 75558d76f..337e89594 100644 --- a/markdown/bitburner.officeapi.buycoffee.md +++ b/markdown/bitburner.officeapi.buycoffee.md @@ -9,7 +9,7 @@ Buy coffee for your employees Signature: ```typescript -buyCoffee(divisionName: string, cityName: string): boolean; +buyCoffee(divisionName: string, city: CityName | `${CityName}`): boolean; ``` ## Parameters @@ -17,7 +17,7 @@ buyCoffee(divisionName: string, cityName: string): boolean; | Parameter | Type | Description | | --- | --- | --- | | divisionName | string | Name of the division | -| cityName | string | Name of the city | +| city | [CityName](./bitburner.cityname.md) \| \`${[CityName](./bitburner.cityname.md)}\` | Name of the city | Returns: diff --git a/markdown/bitburner.officeapi.gethireadvertcost.md b/markdown/bitburner.officeapi.gethireadvertcost.md index 8a5140778..9b4a4b565 100644 --- a/markdown/bitburner.officeapi.gethireadvertcost.md +++ b/markdown/bitburner.officeapi.gethireadvertcost.md @@ -4,7 +4,7 @@ ## OfficeAPI.getHireAdVertCost() method -Get data about an employee +Get the cost to hire AdVert. Signature: @@ -16,11 +16,11 @@ getHireAdVertCost(divisionName: string): number; | Parameter | Type | Description | | --- | --- | --- | -| divisionName | string | Name of the division | +| divisionName | string | Name of the division. | Returns: number -Employee data +The cost to hire AdVert. diff --git a/markdown/bitburner.officeapi.gethireadvertcount.md b/markdown/bitburner.officeapi.gethireadvertcount.md index 6fade9cf7..9ba4e048d 100644 --- a/markdown/bitburner.officeapi.gethireadvertcount.md +++ b/markdown/bitburner.officeapi.gethireadvertcount.md @@ -4,23 +4,23 @@ ## OfficeAPI.getHireAdVertCount() method -Get the number of times you have Hired AdVert +Get the number of times you have hired AdVert. Signature: ```typescript -getHireAdVertCount(adivisionName: string): number; +getHireAdVertCount(divisionName: string): number; ``` ## Parameters | Parameter | Type | Description | | --- | --- | --- | -| adivisionName | string | | +| divisionName | string | Name of the division. | Returns: number -Number of times you have Hired AdVert +Number of times you have hired AdVert. diff --git a/markdown/bitburner.officeapi.getoffice.md b/markdown/bitburner.officeapi.getoffice.md index a1f78ff56..fc2f18b67 100644 --- a/markdown/bitburner.officeapi.getoffice.md +++ b/markdown/bitburner.officeapi.getoffice.md @@ -9,7 +9,7 @@ Get data about an office Signature: ```typescript -getOffice(divisionName: string, cityName: string): Office; +getOffice(divisionName: string, city: CityName | `${CityName}`): Office; ``` ## Parameters @@ -17,7 +17,7 @@ getOffice(divisionName: string, cityName: string): Office; | Parameter | Type | Description | | --- | --- | --- | | divisionName | string | Name of the division | -| cityName | string | Name of the city | +| city | [CityName](./bitburner.cityname.md) \| \`${[CityName](./bitburner.cityname.md)}\` | Name of the city | Returns: diff --git a/markdown/bitburner.officeapi.getofficesizeupgradecost.md b/markdown/bitburner.officeapi.getofficesizeupgradecost.md index 1488a0d85..0defaf090 100644 --- a/markdown/bitburner.officeapi.getofficesizeupgradecost.md +++ b/markdown/bitburner.officeapi.getofficesizeupgradecost.md @@ -9,7 +9,7 @@ Cost to Upgrade office size. Signature: ```typescript -getOfficeSizeUpgradeCost(divisionName: string, cityName: string, asize: number): number; +getOfficeSizeUpgradeCost(divisionName: string, city: CityName | `${CityName}`, asize: number): number; ``` ## Parameters @@ -17,7 +17,7 @@ getOfficeSizeUpgradeCost(divisionName: string, cityName: string, asize: number): | Parameter | Type | Description | | --- | --- | --- | | divisionName | string | Name of the division | -| cityName | string | Name of the city | +| city | [CityName](./bitburner.cityname.md) \| \`${[CityName](./bitburner.cityname.md)}\` | Name of the city | | asize | number | | Returns: diff --git a/markdown/bitburner.officeapi.hireemployee.md b/markdown/bitburner.officeapi.hireemployee.md index 5874c9e0c..47325a6aa 100644 --- a/markdown/bitburner.officeapi.hireemployee.md +++ b/markdown/bitburner.officeapi.hireemployee.md @@ -11,8 +11,8 @@ Hire an employee. ```typescript hireEmployee( divisionName: string, - cityName: string, - employeePosition?: EmployeePositions | `${EmployeePositions}`, + city: CityName | `${CityName}`, + employeePosition?: CorpEmployeePosition, ): boolean; ``` @@ -21,8 +21,8 @@ hireEmployee( | Parameter | Type | Description | | --- | --- | --- | | divisionName | string | Name of the division | -| cityName | string | Name of the city | -| employeePosition | [EmployeePositions](./bitburner.employeepositions.md) \| \`${[EmployeePositions](./bitburner.employeepositions.md)}\` | Position to place into. Defaults to "Unassigned". | +| city | [CityName](./bitburner.cityname.md) \| \`${[CityName](./bitburner.cityname.md)}\` | Name of the city | +| employeePosition | [CorpEmployeePosition](./bitburner.corpemployeeposition.md) | Position to place into. Defaults to "Unassigned". | Returns: diff --git a/markdown/bitburner.officeapi.md b/markdown/bitburner.officeapi.md index 60db20d04..a08b02ab4 100644 --- a/markdown/bitburner.officeapi.md +++ b/markdown/bitburner.officeapi.md @@ -20,17 +20,17 @@ requires the Office API upgrade from your corporation. | Method | Description | | --- | --- | -| [buyCoffee(divisionName, cityName)](./bitburner.officeapi.buycoffee.md) | Buy coffee for your employees | -| [getHireAdVertCost(divisionName)](./bitburner.officeapi.gethireadvertcost.md) | Get data about an employee | -| [getHireAdVertCount(adivisionName)](./bitburner.officeapi.gethireadvertcount.md) | Get the number of times you have Hired AdVert | -| [getOffice(divisionName, cityName)](./bitburner.officeapi.getoffice.md) | Get data about an office | -| [getOfficeSizeUpgradeCost(divisionName, cityName, asize)](./bitburner.officeapi.getofficesizeupgradecost.md) | Cost to Upgrade office size. | +| [buyCoffee(divisionName, city)](./bitburner.officeapi.buycoffee.md) | Buy coffee for your employees | +| [getHireAdVertCost(divisionName)](./bitburner.officeapi.gethireadvertcost.md) | Get the cost to hire AdVert. | +| [getHireAdVertCount(divisionName)](./bitburner.officeapi.gethireadvertcount.md) | Get the number of times you have hired AdVert. | +| [getOffice(divisionName, city)](./bitburner.officeapi.getoffice.md) | Get data about an office | +| [getOfficeSizeUpgradeCost(divisionName, city, asize)](./bitburner.officeapi.getofficesizeupgradecost.md) | Cost to Upgrade office size. | | [getResearchCost(divisionName, researchName)](./bitburner.officeapi.getresearchcost.md) | Get the cost to unlock research | | [hasResearched(divisionName, researchName)](./bitburner.officeapi.hasresearched.md) | Gets if you have unlocked a research | | [hireAdVert(divisionName)](./bitburner.officeapi.hireadvert.md) | Hire AdVert. | -| [hireEmployee(divisionName, cityName, employeePosition)](./bitburner.officeapi.hireemployee.md) | Hire an employee. | +| [hireEmployee(divisionName, city, employeePosition)](./bitburner.officeapi.hireemployee.md) | Hire an employee. | | [research(divisionName, researchName)](./bitburner.officeapi.research.md) | Purchase a research | -| [setAutoJobAssignment(divisionName, cityName, job, amount)](./bitburner.officeapi.setautojobassignment.md) | Set the auto job assignment for a job | -| [throwParty(divisionName, cityName, costPerEmployee)](./bitburner.officeapi.throwparty.md) | Throw a party for your employees | -| [upgradeOfficeSize(divisionName, cityName, size)](./bitburner.officeapi.upgradeofficesize.md) | Upgrade office size. | +| [setAutoJobAssignment(divisionName, city, job, amount)](./bitburner.officeapi.setautojobassignment.md) | Set the auto job assignment for a job | +| [throwParty(divisionName, city, costPerEmployee)](./bitburner.officeapi.throwparty.md) | Throw a party for your employees | +| [upgradeOfficeSize(divisionName, city, size)](./bitburner.officeapi.upgradeofficesize.md) | Upgrade office size. | diff --git a/markdown/bitburner.officeapi.setautojobassignment.md b/markdown/bitburner.officeapi.setautojobassignment.md index ed92c21f8..db5113da4 100644 --- a/markdown/bitburner.officeapi.setautojobassignment.md +++ b/markdown/bitburner.officeapi.setautojobassignment.md @@ -9,7 +9,7 @@ Set the auto job assignment for a job Signature: ```typescript -setAutoJobAssignment(divisionName: string, cityName: string, job: string, amount: number): boolean; +setAutoJobAssignment(divisionName: string, city: CityName | `${CityName}`, job: string, amount: number): boolean; ``` ## Parameters @@ -17,7 +17,7 @@ setAutoJobAssignment(divisionName: string, cityName: string, job: string, amount | Parameter | Type | Description | | --- | --- | --- | | divisionName | string | Name of the division | -| cityName | string | Name of the city | +| city | [CityName](./bitburner.cityname.md) \| \`${[CityName](./bitburner.cityname.md)}\` | Name of the city | | job | string | Name of the job | | amount | number | Number of employees to assign to that job | diff --git a/markdown/bitburner.officeapi.throwparty.md b/markdown/bitburner.officeapi.throwparty.md index 5b8543a90..9c4b7cd40 100644 --- a/markdown/bitburner.officeapi.throwparty.md +++ b/markdown/bitburner.officeapi.throwparty.md @@ -9,7 +9,7 @@ Throw a party for your employees Signature: ```typescript -throwParty(divisionName: string, cityName: string, costPerEmployee: number): number; +throwParty(divisionName: string, city: CityName | `${CityName}`, costPerEmployee: number): number; ``` ## Parameters @@ -17,7 +17,7 @@ throwParty(divisionName: string, cityName: string, costPerEmployee: number): num | Parameter | Type | Description | | --- | --- | --- | | divisionName | string | Name of the division | -| cityName | string | Name of the city | +| city | [CityName](./bitburner.cityname.md) \| \`${[CityName](./bitburner.cityname.md)}\` | Name of the city | | costPerEmployee | number | Amount to spend per employee. | Returns: diff --git a/markdown/bitburner.officeapi.upgradeofficesize.md b/markdown/bitburner.officeapi.upgradeofficesize.md index 25c7f46af..e99a3f638 100644 --- a/markdown/bitburner.officeapi.upgradeofficesize.md +++ b/markdown/bitburner.officeapi.upgradeofficesize.md @@ -9,7 +9,7 @@ Upgrade office size. Signature: ```typescript -upgradeOfficeSize(divisionName: string, cityName: string, size: number): void; +upgradeOfficeSize(divisionName: string, city: CityName | `${CityName}`, size: number): void; ``` ## Parameters @@ -17,7 +17,7 @@ upgradeOfficeSize(divisionName: string, cityName: string, size: number): void; | Parameter | Type | Description | | --- | --- | --- | | divisionName | string | Name of the division | -| cityName | string | Name of the city | +| city | [CityName](./bitburner.cityname.md) \| \`${[CityName](./bitburner.cityname.md)}\` | Name of the city | | size | number | Amount of positions to open | Returns: diff --git a/markdown/bitburner.person.city.md b/markdown/bitburner.person.city.md index c335af9c0..3f83b97b1 100644 --- a/markdown/bitburner.person.city.md +++ b/markdown/bitburner.person.city.md @@ -7,5 +7,5 @@ Signature: ```typescript -city: string; +city: CityName; ``` diff --git a/markdown/bitburner.person.md b/markdown/bitburner.person.md index 3a152f97c..c9f44349a 100644 --- a/markdown/bitburner.person.md +++ b/markdown/bitburner.person.md @@ -15,7 +15,7 @@ interface Person | Property | Type | Description | | --- | --- | --- | -| [city](./bitburner.person.city.md) | string | | +| [city](./bitburner.person.city.md) | [CityName](./bitburner.cityname.md) | | | [exp](./bitburner.person.exp.md) | [Skills](./bitburner.skills.md) | | | [hp](./bitburner.person.hp.md) | [HP](./bitburner.hp.md) | | | [mults](./bitburner.person.mults.md) | [Multipliers](./bitburner.multipliers.md) | | diff --git a/markdown/bitburner.product.citydata.md b/markdown/bitburner.product.citydata.md index aad8ca9c2..fac1296f2 100644 --- a/markdown/bitburner.product.citydata.md +++ b/markdown/bitburner.product.citydata.md @@ -9,5 +9,5 @@ Data refers to the production, sale, and quantity of the products These values a Signature: ```typescript -cityData: { [key: string]: number[] }; +cityData: Record; ``` diff --git a/markdown/bitburner.product.md b/markdown/bitburner.product.md index be31c122d..c694eb033 100644 --- a/markdown/bitburner.product.md +++ b/markdown/bitburner.product.md @@ -16,7 +16,7 @@ interface Product | Property | Type | Description | | --- | --- | --- | -| [cityData](./bitburner.product.citydata.md) | { \[key: string\]: number\[\] } | Data refers to the production, sale, and quantity of the products These values are specific to a city For each city, the data is \[qty, prod, sell\] | +| [cityData](./bitburner.product.citydata.md) | Record<[CityName](./bitburner.cityname.md) \| \`${[CityName](./bitburner.cityname.md)}\`, number\[\]> | Data refers to the production, sale, and quantity of the products These values are specific to a city For each city, the data is \[qty, prod, sell\] | | [cmp](./bitburner.product.cmp.md) | number \| undefined | Competition for the product, only present if "Market Research - Competition" unlocked | | [developmentProgress](./bitburner.product.developmentprogress.md) | number | Creation progress - A number between 0-100 representing percentage | | [dmd](./bitburner.product.dmd.md) | number \| undefined | Demand for the product, only present if "Market Research - Demand" unlocked | diff --git a/markdown/bitburner.singularity.commitcrime.md b/markdown/bitburner.singularity.commitcrime.md index 8a9c44fd9..7ff0da6fc 100644 --- a/markdown/bitburner.singularity.commitcrime.md +++ b/markdown/bitburner.singularity.commitcrime.md @@ -31,5 +31,5 @@ RAM cost: 5 GB \* 16/4/1 This function is used to automatically attempt to commit crimes. If you are already in the middle of some ‘working’ action (such as working for a company or training at a gym), then running this function will automatically cancel that action and give you your earnings. -This function returns the number of milliseconds it takes to attempt the specified crime (e.g It takes 60 seconds to attempt the ‘Rob Store’ crime, so running `commitCrime('ROBSTORE')` will return 60,000). +This function returns the number of milliseconds it takes to attempt the specified crime (e.g It takes 60 seconds to attempt the ‘Rob Store’ crime, so running `commitCrime('Rob Store')` will return 60,000). diff --git a/markdown/bitburner.singularity.traveltocity.md b/markdown/bitburner.singularity.traveltocity.md index 89a5faa9c..5936c8a6a 100644 --- a/markdown/bitburner.singularity.traveltocity.md +++ b/markdown/bitburner.singularity.traveltocity.md @@ -9,14 +9,14 @@ Travel to another city. Signature: ```typescript -travelToCity(city: string): boolean; +travelToCity(city: CityName | `${CityName}`): boolean; ``` ## Parameters | Parameter | Type | Description | | --- | --- | --- | -| city | string | City to travel to. | +| city | [CityName](./bitburner.cityname.md) \| \`${[CityName](./bitburner.cityname.md)}\` | City to travel to. | Returns: diff --git a/markdown/bitburner.sleeve.md b/markdown/bitburner.sleeve.md index e1d6e419a..28040a996 100644 --- a/markdown/bitburner.sleeve.md +++ b/markdown/bitburner.sleeve.md @@ -36,5 +36,5 @@ If you are not in BitNode-10, then you must have Source-File 10 in order to use | [setToShockRecovery(sleeveNumber)](./bitburner.sleeve.settoshockrecovery.md) | Set a sleeve to shock recovery. | | [setToSynchronize(sleeveNumber)](./bitburner.sleeve.settosynchronize.md) | Set a sleeve to synchronize. | | [setToUniversityCourse(sleeveNumber, university, className)](./bitburner.sleeve.settouniversitycourse.md) | Set a sleeve to take a class at a university. | -| [travel(sleeveNumber, cityName)](./bitburner.sleeve.travel.md) | Make a sleeve travel to another city. | +| [travel(sleeveNumber, city)](./bitburner.sleeve.travel.md) | Make a sleeve travel to another city. | diff --git a/markdown/bitburner.sleeve.settocommitcrime.md b/markdown/bitburner.sleeve.settocommitcrime.md index eb6919eb1..835be4e00 100644 --- a/markdown/bitburner.sleeve.settocommitcrime.md +++ b/markdown/bitburner.sleeve.settocommitcrime.md @@ -31,29 +31,15 @@ RAM cost: 4 GB Return a boolean indicating whether or not this action was set successfully (false if an invalid action is specified). -## Example 1 +## Example ```ts -// NS1 -// Assign the first 3 sleeves to commit various crimes. -var crime = ["MUG", "ROBSTORE", "SHOPLIFT"]; -for (var i = 0; i < crime.length; i++) { - tprintf("Sleeve %d commits crime: %s", i, crime[i]); - sleeve.setToCommitCrime(i, crime[i]); -} -``` - -## Example 2 - - -```ts -// NS2 -// Assign the first 3 sleeves to commit various crimes. -const crime = ["MUG", "ROBSTORE", "SHOPLIFT"]; -for (let i = 0; i < crime.length; i++) { - ns.tprintf("Sleeve %d commits crime: %s", i, crime[i]); - ns.sleeve.setToCommitCrime(i, crime[i]); -} +// Assigns the first sleeve to Homicide. +ns.sleeve.setToCommitCrime(0, "Homicide"); + +// Assigns the second sleeve to Grand Theft Auto, using enum +const crimes = ns.enums.CrimeType; +ns.sleeve.setToCommitCrime(1, crimes.grandTheftAuto) ``` diff --git a/markdown/bitburner.sleeve.travel.md b/markdown/bitburner.sleeve.travel.md index e3d98cbfa..8ff1d85cb 100644 --- a/markdown/bitburner.sleeve.travel.md +++ b/markdown/bitburner.sleeve.travel.md @@ -9,7 +9,7 @@ Make a sleeve travel to another city. Signature: ```typescript -travel(sleeveNumber: number, cityName: string): boolean; +travel(sleeveNumber: number, city: CityName | `${CityName}`): boolean; ``` ## Parameters @@ -17,7 +17,7 @@ travel(sleeveNumber: number, cityName: string): boolean; | Parameter | Type | Description | | --- | --- | --- | | sleeveNumber | number | Index of the sleeve to travel. | -| cityName | string | Name of the destination city. | +| city | [CityName](./bitburner.cityname.md) \| \`${[CityName](./bitburner.cityname.md)}\` | Name of the destination city. | Returns: diff --git a/markdown/bitburner.tix.getprice.md b/markdown/bitburner.tix.getprice.md index 01d1b1b40..6c199342a 100644 --- a/markdown/bitburner.tix.getprice.md +++ b/markdown/bitburner.tix.getprice.md @@ -34,26 +34,11 @@ The stock’s price is the average of its bid and ask prices. This function requ 1. TIX API Access -## Example 1 +## Example -```ts -// NS1 -stock.getPrice("FSIG"); - -// Choose the first stock symbol from the array of stock symbols. Get the price -// of the corresponding stock. -var sym = stock.getSymbols()[0]; -tprint("Stock symbol: " + sym); -tprint("Stock price: " + stock.getPrice(sym)); -``` - -## Example 2 - - -```ts -// NS2 -ns.stock.getPrice("FSIG"); +```js +const fourSigmaStockPrice = ns.stock.getPrice("FSIG"); // Choose the first stock symbol from the array of stock symbols. Get the price // of the corresponding stock. diff --git a/markdown/bitburner.warehouse.loc.md b/markdown/bitburner.warehouse.loc.md index 1985da2f3..28d61e1c5 100644 --- a/markdown/bitburner.warehouse.loc.md +++ b/markdown/bitburner.warehouse.loc.md @@ -9,5 +9,5 @@ City in which the warehouse is located Signature: ```typescript -loc: string; +loc: CityName; ``` diff --git a/markdown/bitburner.warehouse.md b/markdown/bitburner.warehouse.md index f2248aa39..5b46fc8f7 100644 --- a/markdown/bitburner.warehouse.md +++ b/markdown/bitburner.warehouse.md @@ -17,7 +17,7 @@ interface Warehouse | Property | Type | Description | | --- | --- | --- | | [level](./bitburner.warehouse.level.md) | number | Amount of size upgrade bought | -| [loc](./bitburner.warehouse.loc.md) | string | City in which the warehouse is located | +| [loc](./bitburner.warehouse.loc.md) | [CityName](./bitburner.cityname.md) | City in which the warehouse is located | | [size](./bitburner.warehouse.size.md) | number | Total space in the warehouse | | [sizeUsed](./bitburner.warehouse.sizeused.md) | number | Used space in the warehouse | | [smartSupplyEnabled](./bitburner.warehouse.smartsupplyenabled.md) | boolean | Smart Supply status in the warehouse | diff --git a/markdown/bitburner.warehouseapi.bulkpurchase.md b/markdown/bitburner.warehouseapi.bulkpurchase.md index 3f55a3cac..861e41285 100644 --- a/markdown/bitburner.warehouseapi.bulkpurchase.md +++ b/markdown/bitburner.warehouseapi.bulkpurchase.md @@ -9,7 +9,7 @@ Set material to bulk buy Signature: ```typescript -bulkPurchase(divisionName: string, cityName: string, materialName: string, amt: number): void; +bulkPurchase(divisionName: string, city: CityName | `${CityName}`, materialName: string, amt: number): void; ``` ## Parameters @@ -17,7 +17,7 @@ bulkPurchase(divisionName: string, cityName: string, materialName: string, amt: | Parameter | Type | Description | | --- | --- | --- | | divisionName | string | Name of the division | -| cityName | string | Name of the city | +| city | [CityName](./bitburner.cityname.md) \| \`${[CityName](./bitburner.cityname.md)}\` | Name of the city | | materialName | string | Name of the material | | amt | number | Amount of material to buy | diff --git a/markdown/bitburner.warehouseapi.buymaterial.md b/markdown/bitburner.warehouseapi.buymaterial.md index e11506cae..4dd91bafa 100644 --- a/markdown/bitburner.warehouseapi.buymaterial.md +++ b/markdown/bitburner.warehouseapi.buymaterial.md @@ -9,7 +9,7 @@ Set material buy data Signature: ```typescript -buyMaterial(divisionName: string, cityName: string, materialName: string, amt: number): void; +buyMaterial(divisionName: string, city: CityName | `${CityName}`, materialName: string, amt: number): void; ``` ## Parameters @@ -17,7 +17,7 @@ buyMaterial(divisionName: string, cityName: string, materialName: string, amt: n | Parameter | Type | Description | | --- | --- | --- | | divisionName | string | Name of the division | -| cityName | string | Name of the city | +| city | [CityName](./bitburner.cityname.md) \| \`${[CityName](./bitburner.cityname.md)}\` | Name of the city | | materialName | string | Name of the material | | amt | number | Amount of material to buy | diff --git a/markdown/bitburner.warehouseapi.cancelexportmaterial.md b/markdown/bitburner.warehouseapi.cancelexportmaterial.md index 344740dc9..bbc0c9709 100644 --- a/markdown/bitburner.warehouseapi.cancelexportmaterial.md +++ b/markdown/bitburner.warehouseapi.cancelexportmaterial.md @@ -11,9 +11,9 @@ Cancel material export ```typescript cancelExportMaterial( sourceDivision: string, - sourceCity: string, + sourceCity: CityName | `${CityName}`, targetDivision: string, - targetCity: string, + targetCity: CityName | `${CityName}`, materialName: string, amt: number, ): void; @@ -24,9 +24,9 @@ cancelExportMaterial( | Parameter | Type | Description | | --- | --- | --- | | sourceDivision | string | Source division | -| sourceCity | string | Source city | +| sourceCity | [CityName](./bitburner.cityname.md) \| \`${[CityName](./bitburner.cityname.md)}\` | Source city | | targetDivision | string | Target division | -| targetCity | string | Target city | +| targetCity | [CityName](./bitburner.cityname.md) \| \`${[CityName](./bitburner.cityname.md)}\` | Target city | | materialName | string | Name of the material | | amt | number | Amount of material to export. | diff --git a/markdown/bitburner.warehouseapi.exportmaterial.md b/markdown/bitburner.warehouseapi.exportmaterial.md index 7fae1f948..4c7cfef4f 100644 --- a/markdown/bitburner.warehouseapi.exportmaterial.md +++ b/markdown/bitburner.warehouseapi.exportmaterial.md @@ -11,9 +11,9 @@ Set material export data ```typescript exportMaterial( sourceDivision: string, - sourceCity: string, + sourceCity: CityName | `${CityName}`, targetDivision: string, - targetCity: string, + targetCity: CityName | `${CityName}`, materialName: string, amt: number, ): void; @@ -24,9 +24,9 @@ exportMaterial( | Parameter | Type | Description | | --- | --- | --- | | sourceDivision | string | Source division | -| sourceCity | string | Source city | +| sourceCity | [CityName](./bitburner.cityname.md) \| \`${[CityName](./bitburner.cityname.md)}\` | Source city | | targetDivision | string | Target division | -| targetCity | string | Target city | +| targetCity | [CityName](./bitburner.cityname.md) \| \`${[CityName](./bitburner.cityname.md)}\` | Target city | | materialName | string | Name of the material | | amt | number | Amount of material to export. | diff --git a/markdown/bitburner.warehouseapi.getmaterial.md b/markdown/bitburner.warehouseapi.getmaterial.md index 4aa393c22..523fc64ef 100644 --- a/markdown/bitburner.warehouseapi.getmaterial.md +++ b/markdown/bitburner.warehouseapi.getmaterial.md @@ -9,7 +9,7 @@ Get material data Signature: ```typescript -getMaterial(divisionName: string, cityName: string, materialName: string): Material; +getMaterial(divisionName: string, city: CityName | `${CityName}`, materialName: string): Material; ``` ## Parameters @@ -17,7 +17,7 @@ getMaterial(divisionName: string, cityName: string, materialName: string): Mater | Parameter | Type | Description | | --- | --- | --- | | divisionName | string | Name of the division | -| cityName | string | | +| city | [CityName](./bitburner.cityname.md) \| \`${[CityName](./bitburner.cityname.md)}\` | Name of the city | | materialName | string | Name of the material | Returns: diff --git a/markdown/bitburner.warehouseapi.getpurchasewarehousecost.md b/markdown/bitburner.warehouseapi.getpurchasewarehousecost.md deleted file mode 100644 index e8fbc61d0..000000000 --- a/markdown/bitburner.warehouseapi.getpurchasewarehousecost.md +++ /dev/null @@ -1,19 +0,0 @@ - - -[Home](./index.md) > [bitburner](./bitburner.md) > [WarehouseAPI](./bitburner.warehouseapi.md) > [getPurchaseWarehouseCost](./bitburner.warehouseapi.getpurchasewarehousecost.md) - -## WarehouseAPI.getPurchaseWarehouseCost() method - -Gets the cost to purchase a warehouse - -Signature: - -```typescript -getPurchaseWarehouseCost(): number; -``` -Returns: - -number - -cost - diff --git a/markdown/bitburner.warehouseapi.getupgradewarehousecost.md b/markdown/bitburner.warehouseapi.getupgradewarehousecost.md index 131013517..a5e3e6d6a 100644 --- a/markdown/bitburner.warehouseapi.getupgradewarehousecost.md +++ b/markdown/bitburner.warehouseapi.getupgradewarehousecost.md @@ -9,16 +9,16 @@ Gets the cost to upgrade a warehouse to the next level Signature: ```typescript -getUpgradeWarehouseCost(adivisionName: string, acityName: string, amt?: number): number; +getUpgradeWarehouseCost(divisionName: string, city: CityName | `${CityName}`, amt?: number): number; ``` ## Parameters | Parameter | Type | Description | | --- | --- | --- | -| adivisionName | string | | -| acityName | string | | -| amt | number | amount of upgrades defaults to 1 | +| divisionName | string | Name of the division | +| city | [CityName](./bitburner.cityname.md) \| \`${[CityName](./bitburner.cityname.md)}\` | Name of the city | +| amt | number | amount of upgrades. Optional, defaults to 1 | Returns: diff --git a/markdown/bitburner.warehouseapi.getwarehouse.md b/markdown/bitburner.warehouseapi.getwarehouse.md index de2373f7e..336582981 100644 --- a/markdown/bitburner.warehouseapi.getwarehouse.md +++ b/markdown/bitburner.warehouseapi.getwarehouse.md @@ -9,7 +9,7 @@ Get warehouse data Signature: ```typescript -getWarehouse(divisionName: string, cityName: string): Warehouse; +getWarehouse(divisionName: string, city: CityName | `${CityName}`): Warehouse; ``` ## Parameters @@ -17,7 +17,7 @@ getWarehouse(divisionName: string, cityName: string): Warehouse; | Parameter | Type | Description | | --- | --- | --- | | divisionName | string | Name of the division | -| cityName | string | Name of the city | +| city | [CityName](./bitburner.cityname.md) \| \`${[CityName](./bitburner.cityname.md)}\` | Name of the city | Returns: diff --git a/markdown/bitburner.warehouseapi.haswarehouse.md b/markdown/bitburner.warehouseapi.haswarehouse.md index 653d8f61e..c8d6a16ec 100644 --- a/markdown/bitburner.warehouseapi.haswarehouse.md +++ b/markdown/bitburner.warehouseapi.haswarehouse.md @@ -9,15 +9,15 @@ Check if you have a warehouse in city Signature: ```typescript -hasWarehouse(adivisionName: string, acityName: string): boolean; +hasWarehouse(divisionName: string, city: CityName | `${CityName}`): boolean; ``` ## Parameters | Parameter | Type | Description | | --- | --- | --- | -| adivisionName | string | | -| acityName | string | | +| divisionName | string | | +| city | [CityName](./bitburner.cityname.md) \| \`${[CityName](./bitburner.cityname.md)}\` | | Returns: diff --git a/markdown/bitburner.warehouseapi.limitmaterialproduction.md b/markdown/bitburner.warehouseapi.limitmaterialproduction.md index 67fb1983b..93233e565 100644 --- a/markdown/bitburner.warehouseapi.limitmaterialproduction.md +++ b/markdown/bitburner.warehouseapi.limitmaterialproduction.md @@ -9,7 +9,12 @@ Limit Material Production. Signature: ```typescript -limitMaterialProduction(divisionName: string, cityName: string, materialName: string, qty: number): void; +limitMaterialProduction( + divisionName: string, + city: CityName | `${CityName}`, + materialName: string, + qty: number, + ): void; ``` ## Parameters @@ -17,7 +22,7 @@ limitMaterialProduction(divisionName: string, cityName: string, materialName: st | Parameter | Type | Description | | --- | --- | --- | | divisionName | string | Name of the division. | -| cityName | string | Name of the city. | +| city | [CityName](./bitburner.cityname.md) \| \`${[CityName](./bitburner.cityname.md)}\` | Name of the city. | | materialName | string | Name of the material. | | qty | number | Amount to limit to. Pass a negative value to remove the limit instead. | diff --git a/markdown/bitburner.warehouseapi.limitproductproduction.md b/markdown/bitburner.warehouseapi.limitproductproduction.md index 77f211deb..f83fdf313 100644 --- a/markdown/bitburner.warehouseapi.limitproductproduction.md +++ b/markdown/bitburner.warehouseapi.limitproductproduction.md @@ -9,7 +9,7 @@ Limit Product Production. Signature: ```typescript -limitProductProduction(divisionName: string, cityName: string, productName: string, qty: number): void; +limitProductProduction(divisionName: string, city: CityName | `${CityName}`, productName: string, qty: number): void; ``` ## Parameters @@ -17,7 +17,7 @@ limitProductProduction(divisionName: string, cityName: string, productName: stri | Parameter | Type | Description | | --- | --- | --- | | divisionName | string | Name of the division. | -| cityName | string | Name of the city. | +| city | [CityName](./bitburner.cityname.md) \| \`${[CityName](./bitburner.cityname.md)}\` | Name of the city. | | productName | string | Name of the product. | | qty | number | Amount to limit to. Pass a negative value to remove the limit instead. | diff --git a/markdown/bitburner.warehouseapi.makeproduct.md b/markdown/bitburner.warehouseapi.makeproduct.md index b279ffdce..e35e1bade 100644 --- a/markdown/bitburner.warehouseapi.makeproduct.md +++ b/markdown/bitburner.warehouseapi.makeproduct.md @@ -11,7 +11,7 @@ Create a new product ```typescript makeProduct( divisionName: string, - cityName: string, + city: CityName | `${CityName}`, productName: string, designInvest: number, marketingInvest: number, @@ -23,7 +23,7 @@ makeProduct( | Parameter | Type | Description | | --- | --- | --- | | divisionName | string | Name of the division | -| cityName | string | Name of the city | +| city | [CityName](./bitburner.cityname.md) \| \`${[CityName](./bitburner.cityname.md)}\` | Name of the city | | productName | string | Name of the product | | designInvest | number | Amount to invest for the design of the product. | | marketingInvest | number | Amount to invest for the marketing of the product. | diff --git a/markdown/bitburner.warehouseapi.md b/markdown/bitburner.warehouseapi.md index 47131265b..b19d41d7d 100644 --- a/markdown/bitburner.warehouseapi.md +++ b/markdown/bitburner.warehouseapi.md @@ -20,28 +20,27 @@ Requires the Warehouse API upgrade from your corporation. | Method | Description | | --- | --- | -| [bulkPurchase(divisionName, cityName, materialName, amt)](./bitburner.warehouseapi.bulkpurchase.md) | Set material to bulk buy | -| [buyMaterial(divisionName, cityName, materialName, amt)](./bitburner.warehouseapi.buymaterial.md) | Set material buy data | +| [bulkPurchase(divisionName, city, materialName, amt)](./bitburner.warehouseapi.bulkpurchase.md) | Set material to bulk buy | +| [buyMaterial(divisionName, city, materialName, amt)](./bitburner.warehouseapi.buymaterial.md) | Set material buy data | | [cancelExportMaterial(sourceDivision, sourceCity, targetDivision, targetCity, materialName, amt)](./bitburner.warehouseapi.cancelexportmaterial.md) | Cancel material export | | [discontinueProduct(divisionName, productName)](./bitburner.warehouseapi.discontinueproduct.md) | Discontinue a product. | | [exportMaterial(sourceDivision, sourceCity, targetDivision, targetCity, materialName, amt)](./bitburner.warehouseapi.exportmaterial.md) | Set material export data | -| [getMaterial(divisionName, cityName, materialName)](./bitburner.warehouseapi.getmaterial.md) | Get material data | +| [getMaterial(divisionName, city, materialName)](./bitburner.warehouseapi.getmaterial.md) | Get material data | | [getProduct(divisionName, productName)](./bitburner.warehouseapi.getproduct.md) | Get product data | -| [getPurchaseWarehouseCost()](./bitburner.warehouseapi.getpurchasewarehousecost.md) | Gets the cost to purchase a warehouse | -| [getUpgradeWarehouseCost(adivisionName, acityName, amt)](./bitburner.warehouseapi.getupgradewarehousecost.md) | Gets the cost to upgrade a warehouse to the next level | -| [getWarehouse(divisionName, cityName)](./bitburner.warehouseapi.getwarehouse.md) | Get warehouse data | -| [hasWarehouse(adivisionName, acityName)](./bitburner.warehouseapi.haswarehouse.md) | Check if you have a warehouse in city | -| [limitMaterialProduction(divisionName, cityName, materialName, qty)](./bitburner.warehouseapi.limitmaterialproduction.md) | Limit Material Production. | -| [limitProductProduction(divisionName, cityName, productName, qty)](./bitburner.warehouseapi.limitproductproduction.md) | Limit Product Production. | -| [makeProduct(divisionName, cityName, productName, designInvest, marketingInvest)](./bitburner.warehouseapi.makeproduct.md) | Create a new product | -| [purchaseWarehouse(divisionName, cityName)](./bitburner.warehouseapi.purchasewarehouse.md) | Purchase warehouse for a new city | -| [sellMaterial(divisionName, cityName, materialName, amt, price)](./bitburner.warehouseapi.sellmaterial.md) | Set material sell data. | -| [sellProduct(divisionName, cityName, productName, amt, price, all)](./bitburner.warehouseapi.sellproduct.md) | Set product sell data. | -| [setMaterialMarketTA1(divisionName, cityName, materialName, on)](./bitburner.warehouseapi.setmaterialmarketta1.md) | Set market TA 1 for a material. | -| [setMaterialMarketTA2(divisionName, cityName, materialName, on)](./bitburner.warehouseapi.setmaterialmarketta2.md) | Set market TA 2 for a material. | +| [getUpgradeWarehouseCost(divisionName, city, amt)](./bitburner.warehouseapi.getupgradewarehousecost.md) | Gets the cost to upgrade a warehouse to the next level | +| [getWarehouse(divisionName, city)](./bitburner.warehouseapi.getwarehouse.md) | Get warehouse data | +| [hasWarehouse(divisionName, city)](./bitburner.warehouseapi.haswarehouse.md) | Check if you have a warehouse in city | +| [limitMaterialProduction(divisionName, city, materialName, qty)](./bitburner.warehouseapi.limitmaterialproduction.md) | Limit Material Production. | +| [limitProductProduction(divisionName, city, productName, qty)](./bitburner.warehouseapi.limitproductproduction.md) | Limit Product Production. | +| [makeProduct(divisionName, city, productName, designInvest, marketingInvest)](./bitburner.warehouseapi.makeproduct.md) | Create a new product | +| [purchaseWarehouse(divisionName, city)](./bitburner.warehouseapi.purchasewarehouse.md) | Purchase warehouse for a new city | +| [sellMaterial(divisionName, city, materialName, amt, price)](./bitburner.warehouseapi.sellmaterial.md) | Set material sell data. | +| [sellProduct(divisionName, city, productName, amt, price, all)](./bitburner.warehouseapi.sellproduct.md) | Set product sell data. | +| [setMaterialMarketTA1(divisionName, city, materialName, on)](./bitburner.warehouseapi.setmaterialmarketta1.md) | Set market TA 1 for a material. | +| [setMaterialMarketTA2(divisionName, city, materialName, on)](./bitburner.warehouseapi.setmaterialmarketta2.md) | Set market TA 2 for a material. | | [setProductMarketTA1(divisionName, productName, on)](./bitburner.warehouseapi.setproductmarketta1.md) | Set market TA 1 for a product. | | [setProductMarketTA2(divisionName, productName, on)](./bitburner.warehouseapi.setproductmarketta2.md) | Set market TA 2 for a product. | -| [setSmartSupply(divisionName, cityName, enabled)](./bitburner.warehouseapi.setsmartsupply.md) | Set smart supply | -| [setSmartSupplyUseLeftovers(divisionName, cityName, materialName, enabled)](./bitburner.warehouseapi.setsmartsupplyuseleftovers.md) | Set whether smart supply uses leftovers before buying | -| [upgradeWarehouse(divisionName, cityName, amt)](./bitburner.warehouseapi.upgradewarehouse.md) | Upgrade warehouse | +| [setSmartSupply(divisionName, city, enabled)](./bitburner.warehouseapi.setsmartsupply.md) | Set smart supply | +| [setSmartSupplyUseLeftovers(divisionName, city, materialName, enabled)](./bitburner.warehouseapi.setsmartsupplyuseleftovers.md) | Set whether smart supply uses leftovers before buying | +| [upgradeWarehouse(divisionName, city, amt)](./bitburner.warehouseapi.upgradewarehouse.md) | Upgrade warehouse | diff --git a/markdown/bitburner.warehouseapi.purchasewarehouse.md b/markdown/bitburner.warehouseapi.purchasewarehouse.md index 57642376f..9cc7742f3 100644 --- a/markdown/bitburner.warehouseapi.purchasewarehouse.md +++ b/markdown/bitburner.warehouseapi.purchasewarehouse.md @@ -9,7 +9,7 @@ Purchase warehouse for a new city Signature: ```typescript -purchaseWarehouse(divisionName: string, cityName: string): void; +purchaseWarehouse(divisionName: string, city: CityName | `${CityName}`): void; ``` ## Parameters @@ -17,7 +17,7 @@ purchaseWarehouse(divisionName: string, cityName: string): void; | Parameter | Type | Description | | --- | --- | --- | | divisionName | string | Name of the division | -| cityName | string | Name of the city | +| city | [CityName](./bitburner.cityname.md) \| \`${[CityName](./bitburner.cityname.md)}\` | Name of the city | Returns: diff --git a/markdown/bitburner.warehouseapi.sellmaterial.md b/markdown/bitburner.warehouseapi.sellmaterial.md index 3595cf80d..78758479a 100644 --- a/markdown/bitburner.warehouseapi.sellmaterial.md +++ b/markdown/bitburner.warehouseapi.sellmaterial.md @@ -9,7 +9,13 @@ Set material sell data. Signature: ```typescript -sellMaterial(divisionName: string, cityName: string, materialName: string, amt: string, price: string): void; +sellMaterial( + divisionName: string, + city: CityName | `${CityName}`, + materialName: string, + amt: string, + price: string, + ): void; ``` ## Parameters @@ -17,7 +23,7 @@ sellMaterial(divisionName: string, cityName: string, materialName: string, amt: | Parameter | Type | Description | | --- | --- | --- | | divisionName | string | Name of the division | -| cityName | string | Name of the city | +| city | [CityName](./bitburner.cityname.md) \| \`${[CityName](./bitburner.cityname.md)}\` | Name of the city | | materialName | string | Name of the material | | amt | string | Amount to sell, can be "MAX" | | price | string | Price to sell, can be "MP" | diff --git a/markdown/bitburner.warehouseapi.sellproduct.md b/markdown/bitburner.warehouseapi.sellproduct.md index a5a5e7fff..eed38f42f 100644 --- a/markdown/bitburner.warehouseapi.sellproduct.md +++ b/markdown/bitburner.warehouseapi.sellproduct.md @@ -11,7 +11,7 @@ Set product sell data. ```typescript sellProduct( divisionName: string, - cityName: string, + city: CityName | `${CityName}`, productName: string, amt: string, price: string, @@ -24,7 +24,7 @@ sellProduct( | Parameter | Type | Description | | --- | --- | --- | | divisionName | string | Name of the division | -| cityName | string | Name of the city | +| city | [CityName](./bitburner.cityname.md) \| \`${[CityName](./bitburner.cityname.md)}\` | Name of the city | | productName | string | Name of the product | | amt | string | Amount to sell, can be "MAX" | | price | string | Price to sell, can be "MP" | diff --git a/markdown/bitburner.warehouseapi.setmaterialmarketta1.md b/markdown/bitburner.warehouseapi.setmaterialmarketta1.md index 0016fb239..3d0d158a7 100644 --- a/markdown/bitburner.warehouseapi.setmaterialmarketta1.md +++ b/markdown/bitburner.warehouseapi.setmaterialmarketta1.md @@ -9,7 +9,7 @@ Set market TA 1 for a material. Signature: ```typescript -setMaterialMarketTA1(divisionName: string, cityName: string, materialName: string, on: boolean): void; +setMaterialMarketTA1(divisionName: string, city: CityName | `${CityName}`, materialName: string, on: boolean): void; ``` ## Parameters @@ -17,7 +17,7 @@ setMaterialMarketTA1(divisionName: string, cityName: string, materialName: strin | Parameter | Type | Description | | --- | --- | --- | | divisionName | string | Name of the division | -| cityName | string | Name of the city | +| city | [CityName](./bitburner.cityname.md) \| \`${[CityName](./bitburner.cityname.md)}\` | Name of the city | | materialName | string | Name of the material | | on | boolean | market ta enabled | diff --git a/markdown/bitburner.warehouseapi.setmaterialmarketta2.md b/markdown/bitburner.warehouseapi.setmaterialmarketta2.md index aed035e71..3c9546691 100644 --- a/markdown/bitburner.warehouseapi.setmaterialmarketta2.md +++ b/markdown/bitburner.warehouseapi.setmaterialmarketta2.md @@ -9,7 +9,7 @@ Set market TA 2 for a material. Signature: ```typescript -setMaterialMarketTA2(divisionName: string, cityName: string, materialName: string, on: boolean): void; +setMaterialMarketTA2(divisionName: string, city: CityName | `${CityName}`, materialName: string, on: boolean): void; ``` ## Parameters @@ -17,7 +17,7 @@ setMaterialMarketTA2(divisionName: string, cityName: string, materialName: strin | Parameter | Type | Description | | --- | --- | --- | | divisionName | string | Name of the division | -| cityName | string | Name of the city | +| city | [CityName](./bitburner.cityname.md) \| \`${[CityName](./bitburner.cityname.md)}\` | Name of the city | | materialName | string | Name of the material | | on | boolean | market ta enabled | diff --git a/markdown/bitburner.warehouseapi.setsmartsupply.md b/markdown/bitburner.warehouseapi.setsmartsupply.md index 3c34c18d1..6daa5d4ca 100644 --- a/markdown/bitburner.warehouseapi.setsmartsupply.md +++ b/markdown/bitburner.warehouseapi.setsmartsupply.md @@ -9,7 +9,7 @@ Set smart supply Signature: ```typescript -setSmartSupply(divisionName: string, cityName: string, enabled: boolean): void; +setSmartSupply(divisionName: string, city: CityName | `${CityName}`, enabled: boolean): void; ``` ## Parameters @@ -17,7 +17,7 @@ setSmartSupply(divisionName: string, cityName: string, enabled: boolean): void; | Parameter | Type | Description | | --- | --- | --- | | divisionName | string | Name of the division | -| cityName | string | Name of the city | +| city | [CityName](./bitburner.cityname.md) \| \`${[CityName](./bitburner.cityname.md)}\` | Name of the city | | enabled | boolean | smart supply enabled | Returns: diff --git a/markdown/bitburner.warehouseapi.setsmartsupplyuseleftovers.md b/markdown/bitburner.warehouseapi.setsmartsupplyuseleftovers.md index b1c00312c..60efe8471 100644 --- a/markdown/bitburner.warehouseapi.setsmartsupplyuseleftovers.md +++ b/markdown/bitburner.warehouseapi.setsmartsupplyuseleftovers.md @@ -9,7 +9,12 @@ Set whether smart supply uses leftovers before buying Signature: ```typescript -setSmartSupplyUseLeftovers(divisionName: string, cityName: string, materialName: string, enabled: boolean): void; +setSmartSupplyUseLeftovers( + divisionName: string, + city: CityName | `${CityName}`, + materialName: string, + enabled: boolean, + ): void; ``` ## Parameters @@ -17,7 +22,7 @@ setSmartSupplyUseLeftovers(divisionName: string, cityName: string, materialName: | Parameter | Type | Description | | --- | --- | --- | | divisionName | string | Name of the division | -| cityName | string | Name of the city | +| city | [CityName](./bitburner.cityname.md) \| \`${[CityName](./bitburner.cityname.md)}\` | Name of the city | | materialName | string | Name of the material | | enabled | boolean | smart supply use leftovers enabled | diff --git a/markdown/bitburner.warehouseapi.upgradewarehouse.md b/markdown/bitburner.warehouseapi.upgradewarehouse.md index cd6d59c2b..7f867bbbb 100644 --- a/markdown/bitburner.warehouseapi.upgradewarehouse.md +++ b/markdown/bitburner.warehouseapi.upgradewarehouse.md @@ -9,7 +9,7 @@ Upgrade warehouse Signature: ```typescript -upgradeWarehouse(divisionName: string, cityName: string, amt?: number): void; +upgradeWarehouse(divisionName: string, city: CityName | `${CityName}`, amt?: number): void; ``` ## Parameters @@ -17,7 +17,7 @@ upgradeWarehouse(divisionName: string, cityName: string, amt?: number): void; | Parameter | Type | Description | | --- | --- | --- | | divisionName | string | Name of the division | -| cityName | string | Name of the city | +| city | [CityName](./bitburner.cityname.md) \| \`${[CityName](./bitburner.cityname.md)}\` | Name of the city | | amt | number | amount of upgrades defaults to 1 | Returns: diff --git a/markdown/bitburner.workformulas.companygains.md b/markdown/bitburner.workformulas.companygains.md index 8b1dc5be4..6ea7f8cf4 100644 --- a/markdown/bitburner.workformulas.companygains.md +++ b/markdown/bitburner.workformulas.companygains.md @@ -7,12 +7,7 @@ Signature: ```typescript -companyGains( - person: Person, - companyName: string, - workType: CompanyPosName | `${CompanyPosName}`, - favor: number, - ): WorkStats; +companyGains(person: Person, companyName: string, workType: JobName | `${JobName}`, favor: number): WorkStats; ``` ## Parameters @@ -21,7 +16,7 @@ companyGains( | --- | --- | --- | | person | [Person](./bitburner.person.md) | | | companyName | string | | -| workType | [CompanyPosName](./bitburner.companyposname.md) \| \`${[CompanyPosName](./bitburner.companyposname.md)}\` | | +| workType | [JobName](./bitburner.jobname.md) \| \`${[JobName](./bitburner.jobname.md)}\` | | | favor | number | | Returns: diff --git a/src/Achievements/Achievements.ts b/src/Achievements/Achievements.ts index b90c1eaa9..abbe8c9f0 100644 --- a/src/Achievements/Achievements.ts +++ b/src/Achievements/Achievements.ts @@ -3,7 +3,7 @@ import { AugmentationNames } from "../Augmentation/data/AugmentationNames"; import { SkillNames } from "../Bladeburner/data/SkillNames"; import { Skills } from "../Bladeburner/Skills"; import { CONSTANTS } from "../Constants"; -import { IndustryType } from "../Corporation/IndustryData"; +import { IndustryType } from "../Corporation/data/Enums"; import { Exploit } from "../Exploits/Exploit"; import { Factions } from "../Faction/Factions"; import { AllGangs } from "../Gang/AllGangs"; @@ -12,7 +12,7 @@ import { HacknetNodeConstants, HacknetServerConstants } from "../Hacknet/data/Co import { hasHacknetServers } from "../Hacknet/HacknetHelpers"; import { HacknetNode } from "../Hacknet/HacknetNode"; import { HacknetServer } from "../Hacknet/HacknetServer"; -import { CityName } from "../Locations/data/CityNames"; +import { CityName } from "../Enums"; import { Player } from "@player"; import { Programs } from "../Programs/Programs"; import { GetAllServers, GetServer } from "../Server/AllServers"; diff --git a/src/Augmentation/Augmentation.tsx b/src/Augmentation/Augmentation.tsx index f767ef763..df2896e5f 100644 --- a/src/Augmentation/Augmentation.tsx +++ b/src/Augmentation/Augmentation.tsx @@ -68,13 +68,8 @@ export interface IConstructorParams { } function generateStatsDescription(mults: Multipliers, programs?: string[], startingMoney?: number): JSX.Element { - const f = (x: number, decimals = 0): string => { - // look, I don't know how to make a "smart decimals" - // todo, make it smarter - if (x === 1.0777 - 1) return "7.77%"; - if (x === 1.777 - 1) return "77.7%"; - return numeralWrapper.formatPercentage(x, decimals); - }; + // For a percentage that is <10, show x.xx%, otherwise show xx.x% + const f = (x: number) => numeralWrapper.formatPercentage(x, x - 1 < 0.1 ? 2 : 1); let desc = <>Effects:; if ( diff --git a/src/BitNode/BitNode.tsx b/src/BitNode/BitNode.tsx index 7bfc575c1..c5640d5d5 100644 --- a/src/BitNode/BitNode.tsx +++ b/src/BitNode/BitNode.tsx @@ -2,7 +2,7 @@ import React from "react"; import { Player } from "@player"; import { BitNodeMultipliers, IBitNodeMultipliers } from "./BitNodeMultipliers"; import { FactionNames } from "../Faction/data/FactionNames"; -import { CityName } from "../Locations/data/CityNames"; +import { CityName } from "../Enums"; class BitNode { // A short description, or tagline, about the BitNode diff --git a/src/Bladeburner/Bladeburner.tsx b/src/Bladeburner/Bladeburner.tsx index e0139fb38..1bc19e035 100644 --- a/src/Bladeburner/Bladeburner.tsx +++ b/src/Bladeburner/Bladeburner.tsx @@ -35,6 +35,8 @@ import { KEY } from "../utils/helpers/keyCodes"; import { isSleeveInfiltrateWork } from "../PersonObjects/Sleeve/Work/SleeveInfiltrateWork"; import { isSleeveSupportWork } from "../PersonObjects/Sleeve/Work/SleeveSupportWork"; import { WorkStats, newWorkStats } from "../Work/WorkStats"; +import { CityName } from "../Enums"; +import { getRandomMember } from "../utils/helpers/enum"; export interface BlackOpsAttempt { error?: string; @@ -68,8 +70,9 @@ export class Bladeburner { type: ActionTypes["Idle"], }); - cities: Record = {}; - city: string = BladeburnerConstants.CityNames[2]; + cities: Record; + city = CityName.Sector12; + // Todo: better types for all these Record types. Will need custom types or enums for the named string categories (e.g. skills). skills: Record = {}; skillMultipliers: Record = {}; staminaBonus = 0; @@ -98,9 +101,9 @@ export class Bladeburner { consoleLogs: string[] = ["Bladeburner Console", "Type 'help' to see console commands"]; constructor() { - for (let i = 0; i < BladeburnerConstants.CityNames.length; ++i) { - this.cities[BladeburnerConstants.CityNames[i]] = new City(BladeburnerConstants.CityNames[i]); - } + this.cities = {} as Record; + // This for loop ensures the above type is met for this.cities. + for (const city of Object.values(CityName)) this.cities[city] = new City(city); this.updateSkillMultipliers(); // Calls resetSkillMultipliers() @@ -111,9 +114,7 @@ export class Bladeburner { } getCurrentCity(): City { - const city = this.cities[this.city]; - if (!city) throw new Error("Invalid city in Bladeburner.getCurrentCity()"); - return city; + return this.cities[this.city]; } calculateStaminaPenalty(): number { @@ -157,7 +158,8 @@ export class Bladeburner { return { isAvailable: true, action }; } - /** This function is only for the player. Sleeves use their own functions to perform blade work. */ + /** This function is only for the player. Sleeves use their own functions to perform blade work. + * Todo: partial unification of player and sleeve methods? */ startAction(actionId: ActionIdentifier): void { if (actionId == null) return; this.action = actionId; @@ -849,16 +851,13 @@ export class Bladeburner { } } - triggerMigration(sourceCityName: string): void { - let destCityName = BladeburnerConstants.CityNames[getRandomInt(0, 5)]; - while (destCityName === sourceCityName) { - destCityName = BladeburnerConstants.CityNames[getRandomInt(0, 5)]; - } + triggerMigration(sourceCityName: CityName): void { + let destCityName = getRandomMember(CityName); + while (destCityName === sourceCityName) destCityName = getRandomMember(CityName); + const destCity = this.cities[destCityName]; const sourceCity = this.cities[sourceCityName]; - if (destCity == null || sourceCity == null) { - throw new Error("Failed to find City with name: " + destCityName); - } + const rand = Math.random(); let percentage = getRandomInt(3, 15) / 100; @@ -873,7 +872,7 @@ export class Bladeburner { destCity.pop += count; } - triggerPotentialMigration(sourceCityName: string, chance: number): void { + triggerPotentialMigration(sourceCityName: CityName, chance: number): void { if (chance == null || isNaN(chance)) { console.error("Invalid 'chance' parameter passed into Bladeburner.triggerPotentialMigration()"); } @@ -889,18 +888,13 @@ export class Bladeburner { const chance = Math.random(); // Choose random source/destination city for events - const sourceCityName = BladeburnerConstants.CityNames[getRandomInt(0, 5)]; + const sourceCityName = getRandomMember(CityName); const sourceCity = this.cities[sourceCityName]; - if (!sourceCity) throw new Error("Invalid sourceCity in Bladeburner.randomEvent()"); - let destCityName = BladeburnerConstants.CityNames[getRandomInt(0, 5)]; - while (destCityName === sourceCityName) { - destCityName = BladeburnerConstants.CityNames[getRandomInt(0, 5)]; - } + let destCityName = getRandomMember(CityName); + while (destCityName === sourceCityName) destCityName = getRandomMember(CityName); const destCity = this.cities[destCityName]; - if (!sourceCity || !destCity) throw new Error("Invalid sourceCity or destCity in Bladeburner.randomEvent()"); - if (chance <= 0.05) { // New Synthoid Community, 5% ++sourceCity.comms; @@ -1571,7 +1565,7 @@ export class Bladeburner { if (this.logging.general) { this.log(`${person.whoAmI()}: Incited violence in the synthoid communities.`); } - for (const cityName of Object.keys(this.cities)) { + for (const cityName of Object.values(CityName)) { const city = this.cities[cityName]; city.chaos += 10; city.chaos += city.chaos / (Math.log(city.chaos) / Math.log(10)); @@ -2007,7 +2001,7 @@ export class Bladeburner { } // Chaos goes down very slowly - for (const cityName of BladeburnerConstants.CityNames) { + for (const cityName of Object.values(CityName)) { const city = this.cities[cityName]; if (!city) throw new Error("Invalid city when processing passive chaos reduction in Bladeburner.process"); city.chaos -= 0.0001 * seconds; diff --git a/src/Bladeburner/City.ts b/src/Bladeburner/City.ts index 6affac207..cf218d875 100644 --- a/src/Bladeburner/City.ts +++ b/src/Bladeburner/City.ts @@ -2,6 +2,7 @@ import { BladeburnerConstants } from "./data/Constants"; import { getRandomInt } from "../utils/helpers/getRandomInt"; import { Generic_fromJSON, Generic_toJSON, IReviverValue, Reviver } from "../utils/JSONReviver"; import { addOffset } from "../utils/helpers/addOffset"; +import { CityName } from "../Enums"; interface IChangePopulationByCountParams { /** How much the estimate should change by. */ @@ -17,7 +18,7 @@ interface IChangePopulationByPercentageParams { export class City { /** Name of the city. */ - name = ""; + name: CityName; /** Population of the city. */ pop = 0; @@ -31,7 +32,7 @@ export class City { /** Chaos level of the city. */ chaos = 0; - constructor(name: string = BladeburnerConstants.CityNames[2]) { + constructor(name = CityName.Sector12) { this.name = name; // Synthoid population and estimate diff --git a/src/Bladeburner/data/BlackOperations.tsx b/src/Bladeburner/data/BlackOperations.tsx index f0f419b4f..b8a396def 100644 --- a/src/Bladeburner/data/BlackOperations.tsx +++ b/src/Bladeburner/data/BlackOperations.tsx @@ -1,6 +1,6 @@ import React from "react"; import { FactionNames } from "../../Faction/data/FactionNames"; -import { CityName } from "../../Locations/data/CityNames"; +import { CityName } from "../../Enums"; import { BlackOperationNames } from "./BlackOperationNames"; interface IBlackOp { diff --git a/src/Bladeburner/data/Constants.ts b/src/Bladeburner/data/Constants.ts index 96151f7fc..eeec14345 100644 --- a/src/Bladeburner/data/Constants.ts +++ b/src/Bladeburner/data/Constants.ts @@ -1,13 +1,4 @@ -import { CityName } from "./../../Locations/data/CityNames"; export const BladeburnerConstants = { - 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/Console.tsx b/src/Bladeburner/ui/Console.tsx index 5c5565e08..fec48d64c 100644 --- a/src/Bladeburner/ui/Console.tsx +++ b/src/Bladeburner/ui/Console.tsx @@ -183,7 +183,7 @@ interface ILogProps { function Logs({ entries }: ILogProps): React.ReactElement { const scrollHook = useRef(null); - // TODO: Text gets shifted up as new entries appear, if the user scrolled up it should attempt to keep the text focused + // TODO unplanned: Text gets shifted up as new entries appear, if the user scrolled up it should attempt to keep the text focused function scrollToBottom(): void { if (!scrollHook.current) return; scrollHook.current.scrollTop = scrollHook.current.scrollHeight; diff --git a/src/Bladeburner/ui/TravelModal.tsx b/src/Bladeburner/ui/TravelModal.tsx index fb7bcaef5..675418b65 100644 --- a/src/Bladeburner/ui/TravelModal.tsx +++ b/src/Bladeburner/ui/TravelModal.tsx @@ -2,7 +2,7 @@ import React from "react"; import { Bladeburner } from "../Bladeburner"; import { WorldMap } from "../../ui/React/WorldMap"; import { Modal } from "../../ui/React/Modal"; -import { CityName } from "../../Locations/data/CityNames"; +import { CityName } from "../../Enums"; import { Settings } from "../../Settings/Settings"; import Typography from "@mui/material/Typography"; import Button from "@mui/material/Button"; @@ -14,7 +14,7 @@ interface IProps { } export function TravelModal(props: IProps): React.ReactElement { - function travel(city: string): void { + function travel(city: CityName): void { props.bladeburner.city = city; props.onClose(); } @@ -27,13 +27,13 @@ export function TravelModal(props: IProps): React.ReactElement { for your Bladeburner duties does not affect your location in the game otherwise. {Settings.DisableASCIIArt ? ( - Object.values(CityName).map((city: CityName) => ( + Object.values(CityName).map((city) => ( )) ) : ( - travel(city)} /> + )} diff --git a/src/Casino/Blackjack.tsx b/src/Casino/Blackjack.tsx index 885eb192f..ce6e86da4 100644 --- a/src/Casino/Blackjack.tsx +++ b/src/Casino/Blackjack.tsx @@ -70,8 +70,6 @@ export class Blackjack extends React.Component, State> { return; } - // Take money from player right away so that players don't just "leave" to avoid the loss (I mean they could - // always reload without saving but w.e) TODO: Save/Restore the RNG state to limit the value of save-scumming. win(-this.state.bet); const playerHand = new Hand([this.deck.safeDrawCard(), this.deck.safeDrawCard()]); diff --git a/src/Company/Company.ts b/src/Company/Company.ts index 07be49826..aee521ac9 100644 --- a/src/Company/Company.ts +++ b/src/Company/Company.ts @@ -1,5 +1,5 @@ import { CompanyPosition } from "./CompanyPosition"; -import * as posNames from "./data/companypositionnames"; +import * as posNames from "./data/JobTracks"; import { favorToRep, repToFavor } from "../Faction/formulas/favor"; import { Generic_fromJSON, Generic_toJSON, IReviverValue, Reviver } from "../utils/JSONReviver"; diff --git a/src/Company/CompanyPosition.ts b/src/Company/CompanyPosition.ts index ecb3ac039..ad4748293 100644 --- a/src/Company/CompanyPosition.ts +++ b/src/Company/CompanyPosition.ts @@ -1,12 +1,13 @@ -import { Person as IPerson } from "../ScriptEditor/NetscriptDefinitions"; +import { Person as IPerson } from "@nsdefs"; import { CONSTANTS } from "../Constants"; -import * as names from "./data/companypositionnames"; +import * as names from "./data/JobTracks"; +import { JobName } from "../Enums"; /* tslint:disable:completed-docs */ export interface IConstructorParams { - name: string; - nextPosition: string | null; + name: JobName; + nextPosition: JobName | null; baseSalary: number; repMultiplier: number; @@ -35,10 +36,10 @@ export interface IConstructorParams { export class CompanyPosition { /** Position title */ - name: string; + name: JobName; /** Title of next position to be promoted to */ - nextPosition: string | null; + nextPosition: JobName | null; /** * Base salary for this position ($ per 200ms game cycle) diff --git a/src/Company/data/CompaniesMetadata.ts b/src/Company/data/CompaniesMetadata.ts index f6ce72ba0..0809c6703 100644 --- a/src/Company/data/CompaniesMetadata.ts +++ b/src/Company/data/CompaniesMetadata.ts @@ -1,7 +1,7 @@ -import * as posNames from "./companypositionnames"; +import * as posNames from "./JobTracks"; import { IConstructorParams } from "../Company"; -import { LocationName } from "../../utils/enums"; +import { LocationName } from "../../Enums"; // Create Objects containing Company Positions by category // Will help in metadata construction later diff --git a/src/Company/data/CompanyPositionsMetadata.ts b/src/Company/data/CompanyPositionsMetadata.ts index 4cfeaccc9..dbd9e3c7f 100644 --- a/src/Company/data/CompanyPositionsMetadata.ts +++ b/src/Company/data/CompanyPositionsMetadata.ts @@ -1,6 +1,6 @@ // Metadata used for constructing Company Positions import { IConstructorParams } from "../CompanyPosition"; -import * as posNames from "./companypositionnames"; +import * as posNames from "./JobTracks"; export const companyPositionMetadata: IConstructorParams[] = [ { diff --git a/src/Company/data/JobTracks.ts b/src/Company/data/JobTracks.ts new file mode 100644 index 000000000..c90dc9776 --- /dev/null +++ b/src/Company/data/JobTracks.ts @@ -0,0 +1,45 @@ +import { JobName } from "../../Enums"; +export const SoftwareCompanyPositions: JobName[] = [ + JobName.software0, + JobName.software1, + JobName.software2, + JobName.software3, + JobName.software4, + JobName.software5, + JobName.software6, + JobName.software7, +]; + +export const ITCompanyPositions: JobName[] = [JobName.IT0, JobName.IT1, JobName.IT2, JobName.IT3]; + +export const SecurityEngineerCompanyPositions: JobName[] = [JobName.securityEng]; + +export const NetworkEngineerCompanyPositions: JobName[] = [JobName.networkEng0, JobName.networkEng1]; + +export const BusinessCompanyPositions: JobName[] = [ + JobName.business0, + JobName.business1, + JobName.business2, + JobName.business3, + JobName.business4, + JobName.business5, +]; + +export const SecurityCompanyPositions: JobName[] = [ + JobName.security0, + JobName.security1, + JobName.security2, + JobName.security3, + JobName.security4, + JobName.security5, +]; + +export const AgentCompanyPositions: JobName[] = [JobName.agent0, JobName.agent1, JobName.agent2]; + +export const MiscCompanyPositions: JobName[] = [JobName.waiter, JobName.employee]; + +export const SoftwareConsultantCompanyPositions: JobName[] = [JobName.softwareConsult0, JobName.softwareConsult1]; + +export const BusinessConsultantCompanyPositions: JobName[] = [JobName.businessConsult0, JobName.businessConsult1]; + +export const PartTimeCompanyPositions: JobName[] = [JobName.waiterPT, JobName.employeePT]; diff --git a/src/Company/data/companypositionnames.ts b/src/Company/data/companypositionnames.ts deleted file mode 100644 index 9dc1a5b04..000000000 --- a/src/Company/data/companypositionnames.ts +++ /dev/null @@ -1,46 +0,0 @@ -// TODO: Convert all to CompanyPosNames[] and make everything that uses these expect a CompanyPosNames enum member. - -export const SoftwareCompanyPositions: string[] = [ - "Software Engineering Intern", - "Junior Software Engineer", - "Senior Software Engineer", - "Lead Software Developer", - "Head of Software", - "Head of Engineering", - "Vice President of Technology", - "Chief Technology Officer", -]; - -export const ITCompanyPositions: string[] = ["IT Intern", "IT Analyst", "IT Manager", "Systems Administrator"]; - -export const SecurityEngineerCompanyPositions: string[] = ["Security Engineer"]; - -export const NetworkEngineerCompanyPositions: string[] = ["Network Engineer", "Network Administrator"]; - -export const BusinessCompanyPositions: string[] = [ - "Business Intern", - "Business Analyst", - "Business Manager", - "Operations Manager", - "Chief Financial Officer", - "Chief Executive Officer", -]; - -export const SecurityCompanyPositions: string[] = [ - "Police Officer", - "Police Chief", - "Security Guard", - "Security Officer", - "Security Supervisor", - "Head of Security", -]; - -export const AgentCompanyPositions: string[] = ["Field Agent", "Secret Agent", "Special Operative"]; - -export const MiscCompanyPositions: string[] = ["Waiter", "Employee"]; - -export const SoftwareConsultantCompanyPositions: string[] = ["Software Consultant", "Senior Software Consultant"]; - -export const BusinessConsultantCompanyPositions: string[] = ["Business Consultant", "Senior Business Consultant"]; - -export const PartTimeCompanyPositions: string[] = ["Part-time Waiter", "Part-time Employee"]; diff --git a/src/Constants.ts b/src/Constants.ts index 74096c713..2db5ed7c8 100644 --- a/src/Constants.ts +++ b/src/Constants.ts @@ -232,18 +232,22 @@ export const CONSTANTS: { Donations: 41, LatestUpdate: ` - v2.2.0 - 2022-12-01 + v2.2.0 - 2022-12-21 BREAKING CHANGES: - * ns.codingcontract.attempt no longer returns a boolean, it returns empty string on failure or the reward string - on success, so comparing the result directly to true/false will no longer work. The result can still be used as - a condition directly. + * ns.getPlayer no longer provides properties tor, inBladeburner, or hasCorporation. This information can be looked + up using standlone functions: ns.hasTorRouter(), ns.bladeburner.inBladeburner(), ns.corporation.hasCorporation(). * (NS2 only) ns functions use the this value from ns: if you move the function to its own variable off of ns, it needs to be bound to ns. e.g.: const tprint = ns.tprint.bind(ns); * ns.formulas.work.classGains removed, replaced with ns.formulas.work.universityGains and ns.formulas.work.gymGains * ns.sleeve.getSleeveStats and ns.sleeve.getSleeveInformation removed, ns.sleeve.getSleeve added and the returned sleeve can be used with formulas API the same way the getPlayer return can be. + * ns.corporation.getEmployee and ns.corporation.assignJob have been removed because employees are no longer + represented as individual objects internally. + * ns.codingcontract.attempt no longer returns a boolean, it returns empty string on failure or the reward string + on success, so comparing the result directly to true/false will no longer work. The result can still be used as + a condition directly. DEVELOPMENT * Development repo moved to https://github.com/bitburner-official/bitburner-src @@ -251,29 +255,42 @@ export const CONSTANTS: { * Development is active again for non-bugfix. * A bunch of fixes and setup related to moving to a new repo (@hydroflame) + TUTORIAL + * Removed NS1/NS2 selection. Tutorial now only references .js files (NS1 is essentially deprecated) (@Mughur) + * Fix Ram Text (by @jaculler) + NETSCRIPT - * Faster API wrapping on script launch. (by @d0sboots & @Snarling) - * Expose more enums for player use under ns.enums (by @Snarling) - * tFormat: Fix display for negative time (by @Snarling) - CODING CONTRACT - * ns.codingcontract.attempt always returns a string (by @Snarling) - FORMULAS - * ns.formulas.work.classGains removed, replaced with ns.formulas.work.universityGains and - ns.formulas.work.gymGains (@Snarling) - * Add ns.formulas.work.companyGains function (by @AlexeyKozhemiakin) - PORTS - * added portHandle.nextWrite() (by @LJNeon) - * Make ns.writePort synchronous (by @Snarling) - SLEEVE - * ns.sleeve.getSleeve added. getPlayer and getSleeve can both be used for formulas. (by @Snarling) - STOCK - * ns.stock.getOrganization added for getting org from stock symbol (by @SamuraiNinjaGuy) + * Added ns.pid property to access a script's PID without a function call. (@jeek) + * Much faster API wrapping on script launch. (@d0sboots) To support this, ns functions need to keep their "this" + value from their parent object. + * Expose more enums for player use under ns.enums (@Snarling) + * tFormat: Fix display for negative time + * ns.getPlayer: removed tor, inBladeburner, and hasCorporation properties + * Added ns.hasTorRouter() function. + -- CODING CONTRACT + * ns.codingcontract.attempt always returns a string (@Snarling) + -- CORPORATION + * Removed ns.corporation.getEmployee and ns.corporation.assignJob, due to employees no longer being objects. + * Added ns.corporation.hasCorporation(); + * Reworked how ram costs are applied for corporation. + -- FORMULAS + * ns.formulas.work.classGains removed, replaced with ns.formulas.work.universityGains and + ns.formulas.work.gymGains (@Snarling) + * Add ns.formulas.work.companyGains function (@AlexeyKozhemiakin) + -- PORTS + * added portHandle.nextWrite() (@LJNeon) + * Make ns.writePort synchronous (@Snarling) + -- SLEEVE + * ns.sleeve.getSleeve added. getPlayer and getSleeve can both be used for formulas. (@Snarling) + -- STOCK + * ns.stock.getOrganization added for getting org from stock symbol (@SamuraiNinjaGuy) SCRIPTS - * Fixed bug where zombie scripts could be created after a soft reset (by @Snarling) + * Fixed bug where zombie scripts could be created after a soft reset (@Snarling) + * Scripts now have a maximum ram cost of 1024GB per thread. SCRIPT LOGS - * Add ctrl-a support for selecting all text in tail window (by @Snarling) + * Add ctrl-a support for selecting all text in tail window (@Snarling) CORPORATION * Remove corp employees as objects (by @Kelenius) @@ -297,12 +314,13 @@ export const CONSTANTS: { * Connect command will connect to player owned servers from anywhere. (by @Snarling) UI - * Fix keyboard shortcuts for other keyboard layouts (by @d0sboots) + * Improve UI performance of sidebar and character overview using memoization (@d0sboots) * Fixed spacing of text in Trade for reputation button after Infiltration (by @PyroGenesis) * Fix spacing on ANSI background escape codes (by @Snarling) * Fix several instances where newlines were not being displayed properly (by @quacksouls) * SoftResetButton.tsx Tooltip changed to make more sense (by @rai68) * GANG: Fix Gang UI to correctly report the bonus time multiplier as 25x (by @TheMas3212) + * Change formatting for skill levels to use localeStr (@G4mingJon4s) DOC * Fix incorrect examples for grow (by @quacksouls) @@ -315,19 +333,22 @@ export const CONSTANTS: { * Update documentation for ns.args (by @Snarling) * De-uglify ns.print examples (by @LJNeon) + STATS + * Fix logic for increasing HP based on defense skill levels (by @mattgarretson) + + INFILTRATION + * Fix SlashGame scaling. (by @Snarling) + + GANG + * When starting a gang, any in progress work with that faction will end. (@G4mingJon4s) + MISC + * Remove google analytics (@hydroflame) * Some error handling streamlining (by @Snarling) * fix: check both ts and js source now (by @Tanimodori) * chore: sync version in package-lock.json (by @Tanimodori) * Better safety when loading game for multiple save corruption issues (by @Snarling) * Nerf Noodle bar - STATS - * Fix logic for increasing HP based on defense skill levels (by @mattgarretson) - - TUTORIAL - * Fix Ram Text (by @jaculler) - - INFILTRATION - * Fix SlashGame scaling. (by @Snarling)`, + `, }; diff --git a/src/Corporation/Actions.ts b/src/Corporation/Actions.ts index a16f8bdd0..8faa0818a 100644 --- a/src/Corporation/Actions.ts +++ b/src/Corporation/Actions.ts @@ -1,9 +1,9 @@ import { Player } from "@player"; import { MaterialInfo } from "./MaterialInfo"; import { Corporation } from "./Corporation"; -import { IndustryResearchTrees, IndustryType, IndustriesData } from "./IndustryData"; +import { IndustryResearchTrees, IndustriesData } from "./IndustryData"; import { Industry } from "./Industry"; -import { CorporationConstants } from "./data/Constants"; +import * as corpConstants from "./data/Constants"; import { OfficeSpace } from "./OfficeSpace"; import { Material } from "./Material"; import { Product } from "./Product"; @@ -11,12 +11,13 @@ import { Warehouse } from "./Warehouse"; import { CorporationUnlockUpgrade } from "./data/CorporationUnlockUpgrades"; import { CorporationUpgrade } from "./data/CorporationUpgrades"; import { Cities } from "../Locations/Cities"; -import { EmployeePositions } from "./EmployeePositions"; +import { EmployeePositions, IndustryType } from "./data/Enums"; import { ResearchMap } from "./ResearchMap"; import { isRelevantMaterial } from "./ui/Helpers"; import { checkEnum } from "../utils/helpers/enum"; -import { CityName } from "../Locations/data/CityNames"; +import { CityName } from "../Enums"; import { getRandomInt } from "../utils/helpers/getRandomInt"; +import { CorpResearchName } from "@nsdefs"; export function NewIndustry(corporation: Corporation, industry: IndustryType, name: string): void { if (corporation.divisions.find(({ type }) => industry == type)) @@ -48,16 +49,16 @@ export function NewIndustry(corporation: Corporation, industry: IndustryType, na } export function NewCity(corporation: Corporation, division: Industry, city: CityName): void { - if (corporation.funds < CorporationConstants.OfficeInitialCost) { + if (corporation.funds < corpConstants.officeInitialCost) { throw new Error("You don't have enough company funds to open a new office!"); } if (division.offices[city]) { throw new Error(`You have already expanded into ${city} for ${division.name}`); } - corporation.funds = corporation.funds - CorporationConstants.OfficeInitialCost; + corporation.funds = corporation.funds - corpConstants.officeInitialCost; division.offices[city] = new OfficeSpace({ loc: city, - size: CorporationConstants.OfficeInitialSize, + size: corpConstants.officeInitialSize, }); } @@ -84,8 +85,8 @@ export function LevelUpgrade(corporation: Corporation, upgrade: CorporationUpgra } export function IssueDividends(corporation: Corporation, rate: number): void { - if (isNaN(rate) || rate < 0 || rate > CorporationConstants.DividendMaxRate) { - throw new Error(`Invalid value. Must be an number between 0 and ${CorporationConstants.DividendMaxRate}`); + if (isNaN(rate) || rate < 0 || rate > corpConstants.dividendMaxRate) { + throw new Error(`Invalid value. Must be an number between 0 and ${corpConstants.dividendMaxRate}`); } corporation.dividendRate = rate; @@ -104,7 +105,7 @@ export function IssueNewShares(corporation: Corporation, amount: number): [numbe const newSharePrice = Math.round(corporation.sharePrice * 0.9); const profit = amount * newSharePrice; - corporation.issueNewSharesCooldown = CorporationConstants.IssueNewSharesCooldown; + corporation.issueNewSharesCooldown = corpConstants.issueNewSharesCooldown; const privateOwnedRatio = 1 - (corporation.numShares + corporation.issuedShares) / corporation.totalShares; const maxPrivateShares = Math.round((amount / 2) * privateOwnedRatio); @@ -269,9 +270,7 @@ export function SetSmartSupply(warehouse: Warehouse, smartSupply: boolean): void } export function SetSmartSupplyUseLeftovers(warehouse: Warehouse, material: Material, useLeftover: boolean): void { - if (!Object.keys(warehouse.smartSupplyUseLeftovers).includes(material.name.replace(/ /g, ""))) - throw new Error(`Invalid material '${material.name}'`); - warehouse.smartSupplyUseLeftovers[material.name.replace(/ /g, "")] = useLeftover; + warehouse.smartSupplyUseLeftovers[material.name] = useLeftover; } export function BuyMaterial(material: Material, amt: number): void { @@ -282,7 +281,7 @@ export function BuyMaterial(material: Material, amt: number): void { } export function BulkPurchase(corp: Corporation, warehouse: Warehouse, material: Material, amt: number): void { - const matSize = MaterialInfo[material.name][1]; + const matSize = MaterialInfo[material.name].size; const maxAmount = (warehouse.size - warehouse.sizeUsed) / matSize; if (isNaN(amt) || amt < 0) { throw new Error(`Invalid input amount`); @@ -314,7 +313,7 @@ export function SellShares(corporation: Corporation, numShares: number): number corporation.issuedShares += numShares; corporation.sharePrice = newSharePrice; corporation.shareSalesUntilPriceUpdate = newSharesUntilUpdate; - corporation.shareSaleCooldown = CorporationConstants.SellSharesCooldown; + corporation.shareSaleCooldown = corpConstants.sellSharesCooldown; Player.gainMoney(profit, "corporation"); return profit; } @@ -338,14 +337,14 @@ export function AutoAssignJob(office: OfficeSpace, job: string, count: number): } export function UpgradeOfficeSize(corp: Corporation, office: OfficeSpace, size: number): void { - const initialPriceMult = Math.round(office.size / CorporationConstants.OfficeInitialSize); + const initialPriceMult = Math.round(office.size / corpConstants.officeInitialSize); const costMultiplier = 1.09; // Calculate cost to upgrade size by 15 employees let mult = 0; - for (let i = 0; i < size / CorporationConstants.OfficeInitialSize; ++i) { + for (let i = 0; i < size / corpConstants.officeInitialSize; ++i) { mult += Math.pow(costMultiplier, initialPriceMult + i); } - const cost = CorporationConstants.OfficeInitialCost * mult; + const cost = corpConstants.officeInitialCost * mult; if (corp.funds < cost) return; office.size += size; corp.funds = corp.funds - cost; @@ -374,20 +373,20 @@ export function ThrowParty(corp: Corporation, office: OfficeSpace, costPerEmploy } export function PurchaseWarehouse(corp: Corporation, division: Industry, city: CityName): void { - if (corp.funds < CorporationConstants.WarehouseInitialCost) return; + if (corp.funds < corpConstants.warehouseInitialCost) return; if (division.warehouses[city]) return; division.warehouses[city] = new Warehouse({ corp: corp, industry: division, loc: city, - size: CorporationConstants.WarehouseInitialSize, + size: corpConstants.warehouseInitialSize, }); - corp.funds = corp.funds - CorporationConstants.WarehouseInitialCost; + corp.funds = corp.funds - corpConstants.warehouseInitialCost; } export function UpgradeWarehouseCost(warehouse: Warehouse, amt: number): number { return Array.from(Array(amt).keys()).reduce( - (acc, index) => acc + CorporationConstants.WarehouseUpgradeBaseCost * Math.pow(1.07, warehouse.level + 1 + index), + (acc, index) => acc + corpConstants.warehouseSizeUpgradeCostBase * Math.pow(1.07, warehouse.level + 1 + index), 0, ); } @@ -461,7 +460,7 @@ export function MakeProduct( products[product.name] = product; } -export function Research(division: Industry, researchName: string): void { +export function Research(division: Industry, researchName: CorpResearchName): void { const researchTree = IndustryResearchTrees[division.type]; if (researchTree === undefined) throw new Error(`No research tree for industry '${division.type}'`); const allResearch = researchTree.getAllNodes(); @@ -469,9 +468,9 @@ export function Research(division: Industry, researchName: string): void { const research = ResearchMap[researchName]; if (division.researched[researchName]) return; - if (division.sciResearch.qty < research.cost) + if (division.sciResearch < research.cost) throw new Error(`You do not have enough Scientific Research for ${research.name}`); - division.sciResearch.qty -= research.cost; + division.sciResearch -= research.cost; // Get the Node from the Research Tree and set its 'researched' property researchTree.research(researchName); @@ -481,12 +480,10 @@ export function Research(division: Industry, researchName: string): void { // whether research is done by script or UI. All other stats gets calculated in every cycle // Warehouse size gets updated only when something increases it. if (researchName == "Drones - Transport") { - for (let i = 0; i < CorporationConstants.Cities.length; ++i) { - const city = CorporationConstants.Cities[i]; + for (const city of Object.values(CityName)) { const warehouse = division.warehouses[city]; - if (!warehouse) { - continue; - } + if (!warehouse) continue; + if (Player.corporation) { // Stores cycles in a "buffer". Processed separately using Engine Counters warehouse.updateSize(Player.corporation, division); diff --git a/src/Corporation/Corporation.tsx b/src/Corporation/Corporation.tsx index 6f0d71595..b394d2870 100644 --- a/src/Corporation/Corporation.tsx +++ b/src/Corporation/Corporation.tsx @@ -1,7 +1,7 @@ import { CorporationState } from "./CorporationState"; import { CorporationUnlockUpgrade, CorporationUnlockUpgrades } from "./data/CorporationUnlockUpgrades"; import { CorporationUpgrade, CorporationUpgrades } from "./data/CorporationUpgrades"; -import { CorporationConstants } from "./data/Constants"; +import * as corpConstants from "./data/Constants"; import { Industry } from "./Industry"; import { BitNodeMultipliers } from "../BitNode/BitNodeMultipliers"; @@ -12,7 +12,8 @@ import { Player } from "@player"; import { dialogBoxCreate } from "../ui/React/DialogBox"; import { Reviver, Generic_toJSON, Generic_fromJSON, IReviverValue } from "../utils/JSONReviver"; import { isString } from "../utils/helpers/isString"; -import { CityName } from "../Locations/data/CityNames"; +import { CityName } from "../Enums"; +import { CorpStateName } from "@nsdefs"; interface IParams { name?: string; @@ -30,9 +31,9 @@ export class Corporation { expenses = 0; fundingRound = 0; public = false; //Publicly traded - totalShares = CorporationConstants.INITIALSHARES; // Total existing shares - numShares = CorporationConstants.INITIALSHARES; // Total shares owned by player - shareSalesUntilPriceUpdate = CorporationConstants.SHARESPERPRICEUPDATE; + totalShares = corpConstants.initialShares; // Total existing shares + numShares = corpConstants.initialShares; // Total shares owned by player + shareSalesUntilPriceUpdate = corpConstants.sharesPerPriceUpdate; shareSaleCooldown = 0; // Game cycles until player can sell shares again issueNewSharesCooldown = 0; // Game cycles until player can issue shares again dividendRate = 0; @@ -68,7 +69,7 @@ export class Corporation { this.funds = this.funds + amt; } - getState(): string { + getState(): CorpStateName { return this.state.getState(); } @@ -77,10 +78,10 @@ export class Corporation { } process(): void { - if (this.storedCycles >= CorporationConstants.CyclesPerIndustryStateCycle) { + if (this.storedCycles >= corpConstants.gameCyclesPerCorpStateCycle) { const state = this.getState(); const marketCycles = 1; - const gameCycles = marketCycles * CorporationConstants.CyclesPerIndustryStateCycle; + const gameCycles = marketCycles * corpConstants.gameCyclesPerCorpStateCycle; this.storedCycles -= gameCycles; this.divisions.forEach((ind) => { @@ -116,7 +117,7 @@ export class Corporation { const profit = this.revenue - this.expenses; this.cycleValuation = this.determineCycleValuation(); this.determineValuation(); - const cycleProfit = profit * (marketCycles * CorporationConstants.SecsPerMarketCycle); + const cycleProfit = profit * (marketCycles * corpConstants.secondsPerMarketCycle); if (isNaN(this.funds) || this.funds === Infinity || this.funds === -Infinity) { dialogBoxCreate( "There was an error calculating your Corporations funds and they got reset to 0. " + @@ -130,11 +131,7 @@ export class Corporation { this.updateDividendTax(); if (this.dividendRate > 0 && cycleProfit > 0) { // Validate input again, just to be safe - if ( - isNaN(this.dividendRate) || - this.dividendRate < 0 || - this.dividendRate > CorporationConstants.DividendMaxRate - ) { + if (isNaN(this.dividendRate) || this.dividendRate < 0 || this.dividendRate > corpConstants.dividendMaxRate) { console.error(`Invalid Corporation dividend rate: ${this.dividendRate}`); } else { const totalDividends = this.dividendRate * cycleProfit; @@ -165,7 +162,7 @@ export class Corporation { getCycleDividends(): number { const profit = this.revenue - this.expenses; - const cycleProfit = profit * CorporationConstants.SecsPerMarketCycle; + const cycleProfit = profit * corpConstants.secondsPerMarketCycle; const totalDividends = this.dividendRate * cycleProfit; const dividendsPerShare = totalDividends / this.totalShares; const dividends = this.numShares * dividendsPerShare; @@ -197,9 +194,9 @@ export class Corporation { determineValuation(): void { this.valuationsList.push(this.cycleValuation); //Add current valuation to the list - if (this.valuationsList.length > CorporationConstants.ValuationLength) this.valuationsList.shift(); + if (this.valuationsList.length > corpConstants.valuationLength) this.valuationsList.shift(); let val = this.valuationsList.reduce((a, b) => a + b); //Calculate valuations sum - val /= CorporationConstants.ValuationLength; //Calculate the average + val /= corpConstants.valuationLength; //Calculate the average this.valuation = val; } @@ -242,7 +239,7 @@ export class Corporation { let profit = 0; let targetPrice = this.getTargetSharePrice(); - const maxIterations = Math.ceil(numShares / CorporationConstants.SHARESPERPRICEUPDATE); + const maxIterations = Math.ceil(numShares / corpConstants.sharesPerPriceUpdate); if (isNaN(maxIterations) || maxIterations > 10e6) { console.error( `Something went wrong or unexpected when calculating share sale. Max iterations calculated to be ${maxIterations}`, @@ -257,7 +254,7 @@ export class Corporation { break; } else { profit += sharePrice * sharesUntilUpdate; - sharesUntilUpdate = CorporationConstants.SHARESPERPRICEUPDATE; + sharesUntilUpdate = corpConstants.sharesPerPriceUpdate; sharesTracker -= sharesUntilUpdate; sharesSold += sharesUntilUpdate; targetPrice = this.valuation / (2 * (this.totalShares + sharesSold - this.numShares)); diff --git a/src/Corporation/CorporationState.ts b/src/Corporation/CorporationState.ts index d8b913f95..df0060b62 100644 --- a/src/Corporation/CorporationState.ts +++ b/src/Corporation/CorporationState.ts @@ -1,8 +1,6 @@ +import { CorpStateName } from "@nsdefs"; import { Generic_fromJSON, Generic_toJSON, IReviverValue, Reviver } from "../utils/JSONReviver"; - -// Array of all valid states -const AllCorporationStates: string[] = ["START", "PURCHASE", "PRODUCTION", "SALE", "EXPORT"]; - +import { stateNames } from "./data/Constants"; export class CorporationState { // Number representing what state the Corporation is in. The number // is an index for the array that holds all Corporation States @@ -11,18 +9,18 @@ export class CorporationState { // Get the name of the current state // NOTE: This does NOT return the number stored in the 'state' property, // which is just an index for the array of all possible Corporation States. - getState(): string { - return AllCorporationStates[this.state]; + getState(): CorpStateName { + return stateNames[this.state]; } // Transition to the next state nextState(): void { - if (this.state < 0 || this.state >= AllCorporationStates.length) { + if (this.state < 0 || this.state >= stateNames.length) { this.state = 0; } ++this.state; - if (this.state >= AllCorporationStates.length) { + if (this.state >= stateNames.length) { this.state = 0; } } diff --git a/src/Corporation/EmployeePositions.ts b/src/Corporation/EmployeePositions.ts deleted file mode 100644 index c33eae207..000000000 --- a/src/Corporation/EmployeePositions.ts +++ /dev/null @@ -1,9 +0,0 @@ -export enum EmployeePositions { - Operations = "Operations", - Engineer = "Engineer", - Business = "Business", - Management = "Management", - RandD = "Research & Development", - Training = "Training", - Unassigned = "Unassigned", -} diff --git a/src/Corporation/Export.ts b/src/Corporation/Export.ts index ab706f566..2a83d28a2 100644 --- a/src/Corporation/Export.ts +++ b/src/Corporation/Export.ts @@ -1,4 +1,4 @@ -import { CityName } from "../Locations/data/CityNames"; +import { CityName } from "../Enums"; export interface Export { ind: string; diff --git a/src/Corporation/Industry.ts b/src/Corporation/Industry.ts index 7f8199e6f..ff5ba93d3 100644 --- a/src/Corporation/Industry.ts +++ b/src/Corporation/Industry.ts @@ -1,9 +1,8 @@ import { Reviver, Generic_toJSON, Generic_fromJSON, IReviverValue } from "../utils/JSONReviver"; -import { CityName } from "../Locations/data/CityNames"; -import { IndustryType, IndustryResearchTrees, IndustriesData } from "./IndustryData"; -import { CorporationConstants } from "./data/Constants"; -import { EmployeePositions } from "./EmployeePositions"; -import { Material } from "./Material"; +import { CityName } from "../Enums"; +import { IndustryResearchTrees, IndustriesData } from "./IndustryData"; +import * as corpConstants from "./data/Constants"; +import { EmployeePositions, IndustryType } from "./data/Enums"; import { getRandomInt } from "../utils/helpers/getRandomInt"; import { calculateEffectWithFactors } from "../utils/calculateEffectWithFactors"; import { OfficeSpace } from "./OfficeSpace"; @@ -13,24 +12,25 @@ import { isString } from "../utils/helpers/isString"; import { MaterialInfo } from "./MaterialInfo"; import { Warehouse } from "./Warehouse"; import { Corporation } from "./Corporation"; +import { CorpMaterialName, CorpResearchName, CorpStateName } from "@nsdefs"; interface IParams { name?: string; corp?: Corporation; - type?: IndustryType | "Computer" | "Utilities"; + type?: IndustryType; } export class Industry { name: string; type: IndustryType; - sciResearch = new Material({ name: "Scientific Research" }); - researched: { [key: string]: boolean | undefined } = {}; - reqMats: { [key: string]: number | undefined } = {}; + sciResearch = 0; + researched: Partial> = {}; + reqMats: Partial> = {}; //An array of the name of materials being produced - prodMats: string[]; + prodMats: CorpMaterialName[]; - products: { [key: string]: Product | undefined } = {}; + products: Partial> = {}; makesProducts: boolean; awareness = 0; @@ -57,7 +57,7 @@ export class Industry { thisCycleRevenue: number; thisCycleExpenses: number; - state = "START"; + state: CorpStateName = "START"; newInd = true; //Maps locations to warehouses. 0 if no warehouse at that location @@ -69,7 +69,7 @@ export class Industry { [CityName.Chongqing]: 0, [CityName.Sector12]: new OfficeSpace({ loc: CityName.Sector12, - size: CorporationConstants.OfficeInitialSize, + size: corpConstants.officeInitialSize, }), [CityName.NewTokyo]: 0, [CityName.Ishima]: 0, @@ -79,8 +79,6 @@ export class Industry { numAdVerts = 0; constructor(params: IParams = {}) { - if (params.type === "Utilities") params.type = IndustryType.Utilities; - if (params.type === "Computer") params.type = IndustryType.Computers; this.type = params.type || IndustryType.Agriculture; this.name = params.name ? params.name : ""; @@ -97,7 +95,7 @@ export class Industry { corp: params.corp, industry: this, loc: CityName.Sector12, - size: CorporationConstants.WarehouseInitialSize, + size: corpConstants.warehouseInitialSize, }), [CityName.NewTokyo]: 0, [CityName.Ishima]: 0, @@ -108,14 +106,14 @@ export class Industry { if (!data) throw new Error(`Invalid industry: "${this.type}"`); this.startingCost = data.startingCost; this.makesProducts = data.product ? true : false; - this.reFac = data.reFac ?? 0; - this.sciFac = data.sciFac ?? 0; - this.hwFac = data.hwFac ?? 0; - this.robFac = data.robFac ?? 0; - this.aiFac = data.aiFac ?? 0; - this.advFac = data.advFac ?? 0; - this.reqMats = data.reqMats; - this.prodMats = data.prodMats ?? []; + this.reFac = data.realEstateFactor ?? 0; + this.sciFac = data.scienceFactor ?? 0; + this.hwFac = data.hardwareFactor ?? 0; + this.robFac = data.robotFactor ?? 0; + this.aiFac = data.aiCoreFactor ?? 0; + this.advFac = data.advertisingFactor ?? 0; + this.reqMats = data.requiredMaterials; + this.prodMats = data.producedMaterials ?? []; } getMaximumNumberProducts(): number { @@ -126,7 +124,7 @@ export class Industry { if (this.hasResearch("uPgrade: Capacity.I")) ++additional; if (this.hasResearch("uPgrade: Capacity.II")) ++additional; - return CorporationConstants.BaseMaxProducts + additional; + return corpConstants.maxProductsBase + additional; } hasMaximumNumberProducts(): boolean { @@ -137,18 +135,17 @@ export class Industry { //materials/products (such as quality, etc.) calculateProductionFactors(): void { let multSum = 0; - for (let i = 0; i < CorporationConstants.Cities.length; ++i) { - const city = CorporationConstants.Cities[i]; + for (const city of Object.values(CityName)) { const warehouse = this.warehouses[city]; if (!warehouse) continue; const materials = warehouse.materials; const cityMult = - Math.pow(0.002 * materials.RealEstate.qty + 1, this.reFac) * + Math.pow(0.002 * materials["Real Estate"].qty + 1, this.reFac) * Math.pow(0.002 * materials.Hardware.qty + 1, this.hwFac) * Math.pow(0.002 * materials.Robots.qty + 1, this.robFac) * - Math.pow(0.002 * materials.AICores.qty + 1, this.aiFac); + Math.pow(0.002 * materials["AI Cores"].qty + 1, this.aiFac); multSum += Math.pow(cityMult, 0.73); } @@ -167,7 +164,7 @@ export class Industry { } } - process(marketCycles = 1, state: string, corporation: Corporation): void { + process(marketCycles = 1, state: CorpStateName, corporation: Corporation): void { this.state = state; //At the start of a cycle, store and reset revenue/expenses @@ -181,8 +178,8 @@ export class Industry { this.thisCycleRevenue = 0; this.thisCycleExpenses = 0; } - this.lastCycleRevenue = this.thisCycleRevenue / (marketCycles * CorporationConstants.SecsPerMarketCycle); - this.lastCycleExpenses = this.thisCycleExpenses / (marketCycles * CorporationConstants.SecsPerMarketCycle); + this.lastCycleRevenue = this.thisCycleRevenue / (marketCycles * corpConstants.secondsPerMarketCycle); + this.lastCycleExpenses = this.thisCycleExpenses / (marketCycles * corpConstants.secondsPerMarketCycle); this.thisCycleRevenue = 0; this.thisCycleExpenses = 0; @@ -244,28 +241,25 @@ export class Industry { prodMats = this.prodMats; //Only 'process the market' for materials that this industry deals with - for (let i = 0; i < CorporationConstants.Cities.length; ++i) { + for (const city of Object.values(CityName)) { //If this industry has a warehouse in this city, process the market //for every material this industry requires or produces - if (this.warehouses[CorporationConstants.Cities[i]]) { - const wh = this.warehouses[CorporationConstants.Cities[i]]; - if (wh === 0) continue; - for (const name of Object.keys(reqMats)) { + if (this.warehouses[city]) { + const wh = this.warehouses[city] as Warehouse; // Warehouse type is known due to if check above + for (const name of Object.keys(reqMats) as CorpMaterialName[]) { if (reqMats.hasOwnProperty(name)) { wh.materials[name].processMarket(); } } //Produced materials are stored in an array - for (let foo = 0; foo < prodMats.length; ++foo) { - wh.materials[prodMats[foo]].processMarket(); - } + for (const matName of prodMats) wh.materials[matName].processMarket(); //Process these twice because these boost production - wh.materials["Hardware"].processMarket(); - wh.materials["Robots"].processMarket(); - wh.materials["AICores"].processMarket(); - wh.materials["RealEstate"].processMarket(); + wh.materials.Hardware.processMarket(); + wh.materials.Robots.processMarket(); + wh.materials["AI Cores"].processMarket(); + wh.materials["Real Estate"].processMarket(); } } } @@ -302,8 +296,7 @@ export class Industry { expenses = 0; this.calculateProductionFactors(); - for (let i = 0; i < CorporationConstants.Cities.length; ++i) { - const city = CorporationConstants.Cities[i]; + for (const city of Object.values(CityName)) { const office = this.offices[city]; if (office === 0) continue; @@ -314,7 +307,7 @@ export class Industry { switch (this.state) { case "PURCHASE": { /* Process purchase of materials */ - for (const matName of Object.keys(warehouse.materials)) { + for (const matName of Object.values(corpConstants.materialNames)) { if (!warehouse.materials.hasOwnProperty(matName)) continue; const mat = warehouse.materials[matName]; let buyAmt = 0; @@ -322,9 +315,9 @@ export class Industry { if (warehouse.smartSupplyEnabled && Object.keys(this.reqMats).includes(matName)) { continue; } - buyAmt = mat.buy * CorporationConstants.SecsPerMarketCycle * marketCycles; + buyAmt = mat.buy * corpConstants.secondsPerMarketCycle * marketCycles; - maxAmt = Math.floor((warehouse.size - warehouse.sizeUsed) / MaterialInfo[matName][1]); + maxAmt = Math.floor((warehouse.size - warehouse.sizeUsed) / MaterialInfo[matName].size); buyAmt = Math.min(buyAmt, maxAmt); if (buyAmt > 0) { @@ -335,8 +328,8 @@ export class Industry { } //End process purchase of materials // smart supply - const smartBuy: { [key: string]: number | undefined } = {}; - for (const matName of Object.keys(warehouse.materials)) { + const smartBuy: Partial> = {}; + for (const matName of Object.values(corpConstants.materialNames)) { if (!warehouse.materials.hasOwnProperty(matName)) continue; if (!warehouse.smartSupplyEnabled || !Object.keys(this.reqMats).includes(matName)) continue; const mat = warehouse.materials[matName]; @@ -345,15 +338,15 @@ export class Industry { const reqMat = this.reqMats[matName]; if (reqMat === undefined) throw new Error(`reqMat "${matName}" is undefined`); mat.buy = reqMat * warehouse.smartSupplyStore; - let buyAmt = mat.buy * CorporationConstants.SecsPerMarketCycle * marketCycles; - const maxAmt = Math.floor((warehouse.size - warehouse.sizeUsed) / MaterialInfo[matName][1]); + let buyAmt = mat.buy * corpConstants.secondsPerMarketCycle * marketCycles; + const maxAmt = Math.floor((warehouse.size - warehouse.sizeUsed) / MaterialInfo[matName].size); buyAmt = Math.min(buyAmt, maxAmt); if (buyAmt > 0) smartBuy[matName] = buyAmt; } // Find which material were trying to create the least amount of product with. let worseAmt = 1e99; - for (const matName of Object.keys(smartBuy)) { + for (const matName of Object.keys(smartBuy) as CorpMaterialName[]) { const buyAmt = smartBuy[matName]; if (buyAmt === undefined) throw new Error(`Somehow smartbuy matname is undefined`); const reqMat = this.reqMats[matName]; @@ -363,7 +356,7 @@ export class Industry { } // Align all the materials to the smallest amount. - for (const matName of Object.keys(smartBuy)) { + for (const matName of Object.keys(smartBuy) as CorpMaterialName[]) { const reqMat = this.reqMats[matName]; if (reqMat === undefined) throw new Error(`reqMat "${matName}" is undefined`); smartBuy[matName] = worseAmt * reqMat; @@ -371,25 +364,24 @@ export class Industry { // Calculate the total size of all things were trying to buy let totalSize = 0; - for (const matName of Object.keys(smartBuy)) { + for (const matName of Object.keys(smartBuy) as CorpMaterialName[]) { const buyAmt = smartBuy[matName]; if (buyAmt === undefined) throw new Error(`Somehow smartbuy matname is undefined`); - totalSize += buyAmt * MaterialInfo[matName][1]; + totalSize += buyAmt * MaterialInfo[matName].size; } // Shrink to the size of available space. const freeSpace = warehouse.size - warehouse.sizeUsed; if (totalSize > freeSpace) { - for (const matName of Object.keys(smartBuy)) { + for (const matName of Object.keys(smartBuy) as CorpMaterialName[]) { const buyAmt = smartBuy[matName]; if (buyAmt === undefined) throw new Error(`Somehow smartbuy matname is undefined`); smartBuy[matName] = Math.floor((buyAmt * freeSpace) / totalSize); } } - // TODO: Change all these Object.keys where the value is also needed to Object.entries. // Use the materials already in the warehouse if the option is on. - for (const matName of Object.keys(smartBuy)) { + for (const matName of Object.keys(smartBuy) as CorpMaterialName[]) { if (!warehouse.smartSupplyUseLeftovers[matName]) continue; const mat = warehouse.materials[matName]; const buyAmt = smartBuy[matName]; @@ -398,7 +390,7 @@ export class Industry { } // buy them - for (const [matName, buyAmt] of Object.entries(smartBuy)) { + for (const [matName, buyAmt] of Object.entries(smartBuy) as [CorpMaterialName, number][]) { const mat = warehouse.materials[matName]; if (buyAmt === undefined) throw new Error(`Somehow smartbuy matname is undefined`); mat.qty += buyAmt; @@ -427,17 +419,17 @@ export class Industry { } else { prod = maxProd; } - prod *= CorporationConstants.SecsPerMarketCycle * marketCycles; //Convert production from per second to per market cycle + prod *= corpConstants.secondsPerMarketCycle * marketCycles; //Convert production from per second to per market cycle // Calculate net change in warehouse storage making the produced materials will cost let totalMatSize = 0; for (let tmp = 0; tmp < this.prodMats.length; ++tmp) { - totalMatSize += MaterialInfo[this.prodMats[tmp]][1]; + totalMatSize += MaterialInfo[this.prodMats[tmp]].size; } - for (const reqMatName of Object.keys(this.reqMats)) { + for (const reqMatName of Object.keys(this.reqMats) as CorpMaterialName[]) { const normQty = this.reqMats[reqMatName]; if (normQty === undefined) continue; - totalMatSize -= MaterialInfo[reqMatName][1] * normQty; + totalMatSize -= MaterialInfo[reqMatName].size * normQty; } // If not enough space in warehouse, limit the amount of produced materials if (totalMatSize > 0) { @@ -450,11 +442,11 @@ export class Industry { } // Keep track of production for smart supply (/s) - warehouse.smartSupplyStore += prod / (CorporationConstants.SecsPerMarketCycle * marketCycles); + warehouse.smartSupplyStore += prod / (corpConstants.secondsPerMarketCycle * marketCycles); // Make sure we have enough resource to make our materials let producableFrac = 1; - for (const reqMatName of Object.keys(this.reqMats)) { + for (const reqMatName of Object.keys(this.reqMats) as CorpMaterialName[]) { if (this.reqMats.hasOwnProperty(reqMatName)) { const reqMat = this.reqMats[reqMatName]; if (reqMat === undefined) continue; @@ -471,24 +463,24 @@ export class Industry { // Make our materials if they are producable if (producableFrac > 0 && prod > 0) { - for (const reqMatName of Object.keys(this.reqMats)) { + for (const reqMatName of Object.keys(this.reqMats) as CorpMaterialName[]) { const reqMat = this.reqMats[reqMatName]; if (reqMat === undefined) continue; const reqMatQtyNeeded = reqMat * prod * producableFrac; warehouse.materials[reqMatName].qty -= reqMatQtyNeeded; warehouse.materials[reqMatName].prd = 0; warehouse.materials[reqMatName].prd -= - reqMatQtyNeeded / (CorporationConstants.SecsPerMarketCycle * marketCycles); + reqMatQtyNeeded / (corpConstants.secondsPerMarketCycle * marketCycles); } for (let j = 0; j < this.prodMats.length; ++j) { warehouse.materials[this.prodMats[j]].qty += prod * producableFrac; warehouse.materials[this.prodMats[j]].qlt = office.employeeProd[EmployeePositions.Engineer] / 90 + - Math.pow(this.sciResearch.qty, this.sciFac) + - Math.pow(warehouse.materials["AICores"].qty, this.aiFac) / 10e3; + Math.pow(this.sciResearch, this.sciFac) + + Math.pow(warehouse.materials["AI Cores"].qty, this.aiFac) / 10e3; } } else { - for (const reqMatName of Object.keys(this.reqMats)) { + for (const reqMatName of Object.keys(this.reqMats) as CorpMaterialName[]) { if (this.reqMats.hasOwnProperty(reqMatName)) { warehouse.materials[reqMatName].prd = 0; } @@ -496,7 +488,7 @@ export class Industry { } //Per second - const fooProd = (prod * producableFrac) / (CorporationConstants.SecsPerMarketCycle * marketCycles); + const fooProd = (prod * producableFrac) / (corpConstants.secondsPerMarketCycle * marketCycles); for (let fooI = 0; fooI < this.prodMats.length; ++fooI) { warehouse.materials[this.prodMats[fooI]].prd = fooProd; } @@ -504,7 +496,7 @@ export class Industry { //If this doesn't produce any materials, then it only creates //Products. Creating products will consume materials. The //Production of all consumed materials must be set to 0 - for (const reqMatName of Object.keys(this.reqMats)) { + for (const reqMatName of Object.keys(this.reqMats) as CorpMaterialName[]) { warehouse.materials[reqMatName].prd = 0; } } @@ -512,7 +504,7 @@ export class Industry { case "SALE": /* Process sale of materials */ - for (const matName of Object.keys(warehouse.materials)) { + for (const matName of Object.values(corpConstants.materialNames)) { if (warehouse.materials.hasOwnProperty(matName)) { const mat = warehouse.materials[matName]; if (mat.sCost < 0 || mat.sllman[0] === false) { @@ -617,7 +609,7 @@ export class Industry { sellAmt = Math.min(mat.maxsll, mat.sllman[1] as number); } - sellAmt = sellAmt * CorporationConstants.SecsPerMarketCycle * marketCycles; + sellAmt = sellAmt * corpConstants.secondsPerMarketCycle * marketCycles; sellAmt = Math.min(mat.qty, sellAmt); if (sellAmt < 0) { console.warn(`sellAmt calculated to be negative for ${matName} in ${city}`); @@ -627,7 +619,7 @@ export class Industry { if (sellAmt && sCost >= 0) { mat.qty -= sellAmt; revenue += sellAmt * sCost; - mat.sll = sellAmt / (CorporationConstants.SecsPerMarketCycle * marketCycles); + mat.sll = sellAmt / (corpConstants.secondsPerMarketCycle * marketCycles); } else { mat.sll = 0; } @@ -636,7 +628,7 @@ export class Industry { break; case "EXPORT": - for (const matName of Object.keys(warehouse.materials)) { + for (const matName of Object.values(corpConstants.materialNames)) { if (warehouse.materials.hasOwnProperty(matName)) { const mat = warehouse.materials[matName]; mat.totalExp = 0; //Reset export @@ -644,7 +636,7 @@ export class Industry { const exp = mat.exp[expI]; const amtStr = exp.amt.replace( /MAX/g, - (mat.qty / (CorporationConstants.SecsPerMarketCycle * marketCycles) + "").toUpperCase(), + (mat.qty / (corpConstants.secondsPerMarketCycle * marketCycles) + "").toUpperCase(), ); let amt = 0; try { @@ -661,7 +653,7 @@ export class Industry { ); continue; } - amt = amt * CorporationConstants.SecsPerMarketCycle * marketCycles; + amt = amt * corpConstants.secondsPerMarketCycle * marketCycles; if (mat.qty < amt) { amt = mat.qty; @@ -685,12 +677,11 @@ export class Industry { return [0, 0]; } else { const maxAmt = Math.floor( - (expWarehouse.size - expWarehouse.sizeUsed) / MaterialInfo[matName][1], + (expWarehouse.size - expWarehouse.sizeUsed) / MaterialInfo[matName].size, ); amt = Math.min(maxAmt, amt); } - expWarehouse.materials[matName].imp += - amt / (CorporationConstants.SecsPerMarketCycle * marketCycles); + expWarehouse.materials[matName].imp += amt / (corpConstants.secondsPerMarketCycle * marketCycles); expWarehouse.materials[matName].qty += amt; expWarehouse.materials[matName].qlt = mat.qlt; mat.qty -= amt; @@ -701,7 +692,7 @@ export class Industry { } } //totalExp should be per second - mat.totalExp /= CorporationConstants.SecsPerMarketCycle * marketCycles; + mat.totalExp /= corpConstants.secondsPerMarketCycle * marketCycles; } } @@ -719,7 +710,7 @@ export class Industry { //Produce Scientific Research based on R&D employees //Scientific Research can be produced without a warehouse if (office) { - this.sciResearch.qty += + this.sciResearch += 0.004 * Math.pow(office.employeeProd[EmployeePositions.RandD], 0.5) * corporation.getScientificResearchMultiplier() * @@ -768,8 +759,7 @@ export class Industry { //Processes FINISHED products processProduct(marketCycles = 1, product: Product, corporation: Corporation): number { let totalProfit = 0; - for (let i = 0; i < CorporationConstants.Cities.length; ++i) { - const city = CorporationConstants.Cities[i]; + for (const city of Object.values(CityName)) { const office = this.offices[city]; if (office === 0) continue; const warehouse = this.warehouses[city]; @@ -792,14 +782,14 @@ export class Industry { } else { prod = maxProd; } - prod *= CorporationConstants.SecsPerMarketCycle * marketCycles; + prod *= corpConstants.secondsPerMarketCycle * marketCycles; //Calculate net change in warehouse storage making the Products will cost let netStorageSize = product.siz; - for (const reqMatName of Object.keys(product.reqMats)) { + for (const reqMatName of Object.keys(product.reqMats) as CorpMaterialName[]) { if (product.reqMats.hasOwnProperty(reqMatName)) { - const normQty = product.reqMats[reqMatName]; - netStorageSize -= MaterialInfo[reqMatName][1] * normQty; + const normQty = product.reqMats[reqMatName] as number; + netStorageSize -= MaterialInfo[reqMatName].size * normQty; } } @@ -809,48 +799,42 @@ export class Industry { prod = Math.min(maxAmt, prod); } - warehouse.smartSupplyStore += prod / (CorporationConstants.SecsPerMarketCycle * marketCycles); + warehouse.smartSupplyStore += prod / (corpConstants.secondsPerMarketCycle * marketCycles); //Make sure we have enough resources to make our Products let producableFrac = 1; - for (const reqMatName of Object.keys(product.reqMats)) { - if (product.reqMats.hasOwnProperty(reqMatName)) { - const req = product.reqMats[reqMatName] * prod; - if (warehouse.materials[reqMatName].qty < req) { - producableFrac = Math.min(producableFrac, warehouse.materials[reqMatName].qty / req); - } + for (const [reqMatName, reqQty] of Object.entries(product.reqMats) as [CorpMaterialName, number][]) { + const req = reqQty * prod; + if (warehouse.materials[reqMatName].qty < req) { + producableFrac = Math.min(producableFrac, warehouse.materials[reqMatName].qty / req); } } //Make our Products if they are producable if (producableFrac > 0 && prod > 0) { - for (const reqMatName of Object.keys(product.reqMats)) { - if (product.reqMats.hasOwnProperty(reqMatName)) { - const reqMatQtyNeeded = product.reqMats[reqMatName] * prod * producableFrac; - warehouse.materials[reqMatName].qty -= reqMatQtyNeeded; - warehouse.materials[reqMatName].prd -= - reqMatQtyNeeded / (CorporationConstants.SecsPerMarketCycle * marketCycles); - } + for (const [reqMatName, reqQty] of Object.entries(product.reqMats) as [CorpMaterialName, number][]) { + const reqMatQtyNeeded = reqQty * prod * producableFrac; + warehouse.materials[reqMatName].qty -= reqMatQtyNeeded; + warehouse.materials[reqMatName].prd -= + reqMatQtyNeeded / (corpConstants.secondsPerMarketCycle * marketCycles); } //Quantity product.data[city][0] += prod * producableFrac; } //Keep track of production Per second - product.data[city][1] = (prod * producableFrac) / (CorporationConstants.SecsPerMarketCycle * marketCycles); + product.data[city][1] = (prod * producableFrac) / (corpConstants.secondsPerMarketCycle * marketCycles); break; } case "SALE": { //Process sale of Products product.pCost = 0; //Estimated production cost - for (const reqMatName of Object.keys(product.reqMats)) { - if (product.reqMats.hasOwnProperty(reqMatName)) { - product.pCost += product.reqMats[reqMatName] * warehouse.materials[reqMatName].bCost; - } + for (const [reqMatName, reqQty] of Object.entries(product.reqMats) as [CorpMaterialName, number][]) { + product.pCost += reqQty * warehouse.materials[reqMatName].bCost; } // Since its a product, its production cost is increased for labor - product.pCost *= CorporationConstants.ProductProductionCostRatio; + product.pCost *= corpConstants.baseProductProfitMult; // Sale multipliers const businessFactor = this.getBusinessFactor(office); //Business employee productivity @@ -948,12 +932,12 @@ export class Industry { if (sellAmt < 0) { sellAmt = 0; } - sellAmt = sellAmt * CorporationConstants.SecsPerMarketCycle * marketCycles; + sellAmt = sellAmt * corpConstants.secondsPerMarketCycle * marketCycles; sellAmt = Math.min(product.data[city][0], sellAmt); //data[0] is qty if (sellAmt && sCost) { product.data[city][0] -= sellAmt; //data[0] is qty totalProfit += sellAmt * sCost; - product.data[city][2] = sellAmt / (CorporationConstants.SecsPerMarketCycle * marketCycles); //data[2] is sell property + product.data[city][2] = sellAmt / (corpConstants.secondsPerMarketCycle * marketCycles); //data[2] is sell property } else { product.data[city][2] = 0; //data[2] is sell property } @@ -975,14 +959,12 @@ export class Industry { resetImports(state: string): void { //At the start of the export state, set the imports of everything to 0 if (state === "EXPORT") { - for (let i = 0; i < CorporationConstants.Cities.length; ++i) { - const city = CorporationConstants.Cities[i]; - if (!this.warehouses[city]) { - continue; - } + for (const city of Object.values(CityName)) { + if (!this.warehouses[city]) continue; + const warehouse = this.warehouses[city]; if (warehouse === 0) continue; - for (const matName of Object.keys(warehouse.materials)) { + for (const matName of Object.values(corpConstants.materialNames)) { if (warehouse.materials.hasOwnProperty(matName)) { const mat = warehouse.materials[matName]; mat.imp = 0; @@ -1068,7 +1050,7 @@ export class Industry { } // Returns a boolean indicating whether this Industry has the specified Research - hasResearch(name: string): boolean { + hasResearch(name: CorpResearchName): boolean { return this.researched[name] === true; } @@ -1079,7 +1061,7 @@ export class Industry { // Since ResearchTree data isn't saved, we'll update the Research Tree data // based on the stored 'researched' property in the Industry object if (Object.keys(researchTree.researched).length !== Object.keys(this.researched).length) { - for (const research of Object.keys(this.researched)) { + for (const research of Object.keys(this.researched) as CorpResearchName[]) { researchTree.research(research); } } @@ -1163,6 +1145,11 @@ export class Industry { /** Initializes a Industry object from a JSON save state. */ static fromJSON(value: IReviverValue): Industry { + //Gracefully load saves which have old names for industries + if (value.data.type === "RealEstate") value.data.type = IndustryType.RealEstate; + if (value.data.type === "Utilities") value.data.type = IndustryType.Utilities; + if (value.data.type === "Computers") value.data.type = IndustryType.Computers; + if (value.data.type === "Computer") value.data.type = IndustryType.Computers; return Generic_fromJSON(Industry, value.data); } } diff --git a/src/Corporation/IndustryData.tsx b/src/Corporation/IndustryData.tsx index b1dbaecc4..5820b18b6 100644 --- a/src/Corporation/IndustryData.tsx +++ b/src/Corporation/IndustryData.tsx @@ -3,292 +3,277 @@ import { ResearchTree } from "./ResearchTree"; import { Corporation } from "./Corporation"; import { getBaseResearchTreeCopy, getProductIndustryResearchTreeCopy } from "./data/BaseResearchTree"; import { MoneyCost } from "./ui/MoneyCost"; +import { CorpIndustryData, CorpIndustryName } from "@nsdefs"; +import { IndustryType } from "./data/Enums"; -export enum IndustryType { - Energy = "Energy", - Utilities = "Water Utilities", - Agriculture = "Agriculture", - Fishing = "Fishing", - Mining = "Mining", - Food = "Food", - Tobacco = "Tobacco", - Chemical = "Chemical", - Pharmaceutical = "Pharmaceutical", - Computers = "Computer Hardware", - Robotics = "Robotics", - Software = "Software", - Healthcare = "Healthcare", - RealEstate = "RealEstate", -} - -export interface IProductRatingWeight { - Aesthetics?: number; - Durability?: number; - Features?: number; - Quality?: number; - Performance?: number; - Reliability?: number; -} - -type IndustryData = { - startingCost: number; - description: string; - /** Product name for industry. Empty string for industries with no products. */ - product?: { name: string; verb: string; desc: string }; - ProductRatingWeights?: IProductRatingWeight; - recommendStarting: boolean; - reqMats: Record; - /** Real estate factor */ - reFac?: number; - /** Scientific research factor (affects quality) */ - sciFac?: number; - /** Hardware factor */ - hwFac?: number; - /** Robots factor */ - robFac?: number; - /** AI Cores factor */ - aiFac?: number; - /** Advertising factor (affects sales) */ - advFac?: number; - prodMats?: string[]; -}; - -export const IndustriesData: Record = { +export const IndustriesData: Record = { [IndustryType.Agriculture]: { startingCost: 40e9, description: "Cultivate crops and breed livestock to produce food.", recommendStarting: true, - reFac: 0.72, - sciFac: 0.5, - hwFac: 0.2, - robFac: 0.3, - aiFac: 0.3, - advFac: 0.04, - reqMats: { Water: 0.5, Energy: 0.5 }, - prodMats: ["Plants", "Food"], + realEstateFactor: 0.72, + scienceFactor: 0.5, + hardwareFactor: 0.2, + robotFactor: 0.3, + aiCoreFactor: 0.3, + advertisingFactor: 0.04, + requiredMaterials: { Water: 0.5, Energy: 0.5 }, + producedMaterials: ["Plants", "Food"], }, [IndustryType.Chemical]: { startingCost: 70e9, description: "Produce industrial chemicals.", recommendStarting: false, - reFac: 0.25, - sciFac: 0.75, - hwFac: 0.2, - robFac: 0.25, - aiFac: 0.2, - advFac: 0.07, - reqMats: { Plants: 1, Energy: 0.5, Water: 0.5 }, - prodMats: ["Chemicals"], + realEstateFactor: 0.25, + scienceFactor: 0.75, + hardwareFactor: 0.2, + robotFactor: 0.25, + aiCoreFactor: 0.2, + advertisingFactor: 0.07, + requiredMaterials: { Plants: 1, Energy: 0.5, Water: 0.5 }, + producedMaterials: ["Chemicals"], }, [IndustryType.Computers]: { startingCost: 500e9, description: "Develop and manufacture new computer hardware and networking infrastructures.", - product: { name: "Product", verb: "Create", desc: "Design and manufacture a new computer hardware product!" }, - ProductRatingWeights: { - Quality: 0.15, - Performance: 0.25, - Durability: 0.25, - Reliability: 0.2, - Aesthetics: 0.05, - Features: 0.1, + product: { + name: "Product", + verb: "Create", + desc: "Design and manufacture a new computer hardware product!", + ratingWeights: { + quality: 0.15, + performance: 0.25, + durability: 0.25, + reliability: 0.2, + aesthetics: 0.05, + features: 0.1, + }, }, recommendStarting: false, - reFac: 0.2, - sciFac: 0.62, - robFac: 0.36, - aiFac: 0.19, - advFac: 0.17, - reqMats: { Metal: 2, Energy: 1 }, - prodMats: ["Hardware"], + realEstateFactor: 0.2, + scienceFactor: 0.62, + robotFactor: 0.36, + aiCoreFactor: 0.19, + advertisingFactor: 0.17, + requiredMaterials: { Metal: 2, Energy: 1 }, + producedMaterials: ["Hardware"], }, [IndustryType.Energy]: { startingCost: 225e9, description: "Engage in the production and distribution of energy.", recommendStarting: false, - reFac: 0.65, - sciFac: 0.7, - robFac: 0.05, - aiFac: 0.3, - advFac: 0.08, - reqMats: { Hardware: 0.1, Metal: 0.2 }, - prodMats: ["Energy"], + realEstateFactor: 0.65, + scienceFactor: 0.7, + robotFactor: 0.05, + aiCoreFactor: 0.3, + advertisingFactor: 0.08, + requiredMaterials: { Hardware: 0.1, Metal: 0.2 }, + producedMaterials: ["Energy"], }, [IndustryType.Fishing]: { startingCost: 80e9, description: "Produce food through the breeding and processing of fish and fish products.", recommendStarting: false, - reFac: 0.15, - sciFac: 0.35, - hwFac: 0.35, - robFac: 0.5, - aiFac: 0.2, - advFac: 0.08, - reqMats: { Energy: 0.5 }, - prodMats: ["Food"], + realEstateFactor: 0.15, + scienceFactor: 0.35, + hardwareFactor: 0.35, + robotFactor: 0.5, + aiCoreFactor: 0.2, + advertisingFactor: 0.08, + requiredMaterials: { Energy: 0.5 }, + producedMaterials: ["Food"], }, [IndustryType.Food]: { startingCost: 10e9, description: "Create your own restaurants all around the world.", - product: { name: "Restaurant", verb: "Build", desc: "Build and manage a new restaurant!" }, - ProductRatingWeights: { - Quality: 0.7, - Durability: 0.1, - Aesthetics: 0.2, + product: { + name: "Restaurant", + verb: "Build", + desc: "Build and manage a new restaurant!", + ratingWeights: { + quality: 0.7, + durability: 0.1, + aesthetics: 0.2, + }, }, recommendStarting: true, - sciFac: 0.12, - hwFac: 0.15, - robFac: 0.3, - aiFac: 0.25, - advFac: 0.25, - reFac: 0.05, - reqMats: { Food: 0.5, Water: 0.5, Energy: 0.2 }, + scienceFactor: 0.12, + hardwareFactor: 0.15, + robotFactor: 0.3, + aiCoreFactor: 0.25, + advertisingFactor: 0.25, + realEstateFactor: 0.05, + requiredMaterials: { Food: 0.5, Water: 0.5, Energy: 0.2 }, }, [IndustryType.Healthcare]: { startingCost: 750e9, description: "Create and manage hospitals.", - product: { name: "Hospital", verb: "Build", desc: "Build and manage a new hospital!" }, - ProductRatingWeights: { - Quality: 0.4, - Performance: 0.1, - Durability: 0.1, - Reliability: 0.3, - Features: 0.1, + product: { + name: "Hospital", + verb: "Build", + desc: "Build and manage a new hospital!", + ratingWeights: { + quality: 0.4, + performance: 0.1, + durability: 0.1, + reliability: 0.3, + features: 0.1, + }, }, recommendStarting: false, - reFac: 0.1, - sciFac: 0.75, - advFac: 0.11, - hwFac: 0.1, - robFac: 0.1, - aiFac: 0.1, - reqMats: { Robots: 10, AICores: 5, Energy: 5, Water: 5 }, + realEstateFactor: 0.1, + scienceFactor: 0.75, + advertisingFactor: 0.11, + hardwareFactor: 0.1, + robotFactor: 0.1, + aiCoreFactor: 0.1, + requiredMaterials: { Robots: 10, "AI Cores": 5, Energy: 5, Water: 5 }, }, [IndustryType.Mining]: { startingCost: 300e9, description: "Extract and process metals from the earth.", recommendStarting: false, - reFac: 0.3, - sciFac: 0.26, - hwFac: 0.4, - robFac: 0.45, - aiFac: 0.45, - advFac: 0.06, - reqMats: { Energy: 0.8 }, - prodMats: ["Metal"], + realEstateFactor: 0.3, + scienceFactor: 0.26, + hardwareFactor: 0.4, + robotFactor: 0.45, + aiCoreFactor: 0.45, + advertisingFactor: 0.06, + requiredMaterials: { Energy: 0.8 }, + producedMaterials: ["Metal"], }, [IndustryType.Pharmaceutical]: { startingCost: 200e9, description: "Discover, develop, and create new pharmaceutical drugs.", - product: { name: "Drug", verb: "Develop", desc: "Design and develop a new pharmaceutical drug!" }, - ProductRatingWeights: { - Quality: 0.2, - Performance: 0.2, - Durability: 0.1, - Reliability: 0.3, - Features: 0.2, + product: { + name: "Drug", + verb: "Develop", + desc: "Design and develop a new pharmaceutical drug!", + ratingWeights: { + quality: 0.2, + performance: 0.2, + durability: 0.1, + reliability: 0.3, + features: 0.2, + }, }, recommendStarting: false, - reFac: 0.05, - sciFac: 0.8, - hwFac: 0.15, - robFac: 0.25, - aiFac: 0.2, - advFac: 0.16, - reqMats: { Chemicals: 2, Energy: 1, Water: 0.5 }, - prodMats: ["Drugs"], + realEstateFactor: 0.05, + scienceFactor: 0.8, + hardwareFactor: 0.15, + robotFactor: 0.25, + aiCoreFactor: 0.2, + advertisingFactor: 0.16, + requiredMaterials: { Chemicals: 2, Energy: 1, Water: 0.5 }, + producedMaterials: ["Drugs"], }, [IndustryType.RealEstate]: { startingCost: 600e9, description: "Develop and manage real estate properties.", - product: { name: "Property", verb: "Develop", desc: "Develop a new piece of real estate property!" }, - ProductRatingWeights: { - Quality: 0.2, - Durability: 0.25, - Reliability: 0.1, - Aesthetics: 0.35, - Features: 0.1, + product: { + name: "Property", + verb: "Develop", + desc: "Develop a new piece of real estate property!", + ratingWeights: { + quality: 0.2, + durability: 0.25, + reliability: 0.1, + aesthetics: 0.35, + features: 0.1, + }, }, recommendStarting: false, - robFac: 0.6, - aiFac: 0.6, - advFac: 0.25, - sciFac: 0.05, - hwFac: 0.05, - reqMats: { Metal: 5, Energy: 5, Water: 2, Hardware: 4 }, - prodMats: ["Real Estate"], + robotFactor: 0.6, + aiCoreFactor: 0.6, + advertisingFactor: 0.25, + scienceFactor: 0.05, + hardwareFactor: 0.05, + requiredMaterials: { Metal: 5, Energy: 5, Water: 2, Hardware: 4 }, + producedMaterials: ["Real Estate"], }, [IndustryType.Robotics]: { startingCost: 1e12, description: "Develop and create robots.", - product: { name: "Robot", verb: "Design", desc: "Design and create a new robot or robotic system!" }, - ProductRatingWeights: { - Quality: 0.1, - Performance: 0.2, - Durability: 0.2, - Reliability: 0.2, - Aesthetics: 0.1, - Features: 0.2, + product: { + name: "Robot", + verb: "Design", + desc: "Design and create a new robot or robotic system!", + ratingWeights: { + quality: 0.1, + performance: 0.2, + durability: 0.2, + reliability: 0.2, + aesthetics: 0.1, + features: 0.2, + }, }, recommendStarting: false, - reFac: 0.32, - sciFac: 0.65, - aiFac: 0.36, - advFac: 0.18, - hwFac: 0.19, - reqMats: { Hardware: 5, Energy: 3 }, - prodMats: ["Robots"], + realEstateFactor: 0.32, + scienceFactor: 0.65, + aiCoreFactor: 0.36, + advertisingFactor: 0.18, + hardwareFactor: 0.19, + requiredMaterials: { Hardware: 5, Energy: 3 }, + producedMaterials: ["Robots"], }, [IndustryType.Software]: { startingCost: 25e9, description: "Develop computer software and create AI Cores.", - product: { name: "Software", verb: "Develop", desc: "Develop a new piece of software!" }, - ProductRatingWeights: { - Quality: 0.2, - Performance: 0.2, - Reliability: 0.2, - Durability: 0.2, - Features: 0.2, + product: { + name: "Software", + verb: "Develop", + desc: "Develop a new piece of software!", + ratingWeights: { + quality: 0.2, + performance: 0.2, + reliability: 0.2, + durability: 0.2, + features: 0.2, + }, }, recommendStarting: false, - sciFac: 0.62, - advFac: 0.16, - hwFac: 0.25, - reFac: 0.15, - aiFac: 0.18, - robFac: 0.05, - reqMats: { Hardware: 0.5, Energy: 0.5 }, - prodMats: ["AI Cores"], + scienceFactor: 0.62, + advertisingFactor: 0.16, + hardwareFactor: 0.25, + realEstateFactor: 0.15, + aiCoreFactor: 0.18, + robotFactor: 0.05, + requiredMaterials: { Hardware: 0.5, Energy: 0.5 }, + producedMaterials: ["AI Cores"], }, [IndustryType.Tobacco]: { startingCost: 20e9, description: "Create and distribute tobacco and tobacco-related products.", - product: { name: "Product", verb: "Create", desc: "Create a new tobacco product!" }, - ProductRatingWeights: { - Quality: 0.7, - Durability: 0.1, - Aesthetics: 0.2, + product: { + name: "Product", + verb: "Create", + desc: "Create a new tobacco product!", + ratingWeights: { + quality: 0.7, + durability: 0.1, + aesthetics: 0.2, + }, }, recommendStarting: true, - reFac: 0.15, - sciFac: 0.75, - hwFac: 0.15, - robFac: 0.2, - aiFac: 0.15, - advFac: 0.2, - reqMats: { Plants: 1, Water: 0.2 }, + realEstateFactor: 0.15, + scienceFactor: 0.75, + hardwareFactor: 0.15, + robotFactor: 0.2, + aiCoreFactor: 0.15, + advertisingFactor: 0.2, + requiredMaterials: { Plants: 1, Water: 0.2 }, }, [IndustryType.Utilities]: { startingCost: 150e9, description: "Distribute water and provide wastewater services.", recommendStarting: false, - reFac: 0.5, - sciFac: 0.6, - robFac: 0.4, - aiFac: 0.4, - advFac: 0.08, - reqMats: { Hardware: 0.1, Metal: 0.1 }, - prodMats: ["Water"], + realEstateFactor: 0.5, + scienceFactor: 0.6, + robotFactor: 0.4, + aiCoreFactor: 0.4, + advertisingFactor: 0.08, + requiredMaterials: { Hardware: 0.1, Metal: 0.1 }, + producedMaterials: ["Water"], }, }; diff --git a/src/Corporation/Material.ts b/src/Corporation/Material.ts index b2042a8b3..15228126e 100644 --- a/src/Corporation/Material.ts +++ b/src/Corporation/Material.ts @@ -1,13 +1,16 @@ +import { CorpMaterialName } from "@nsdefs"; import { Generic_fromJSON, Generic_toJSON, IReviverValue, Reviver } from "../utils/JSONReviver"; +import { materialNames } from "./data/Constants"; import { Export } from "./Export"; +import { MaterialInfo } from "./MaterialInfo"; interface IConstructorParams { - name?: string; + name: CorpMaterialName; } export class Material { // Name of material - name = "InitName"; + name: CorpMaterialName; // Amount of material owned qty = 0; @@ -65,127 +68,21 @@ export class Material { // Determines the maximum amount of this material that can be sold in one market cycle maxsll = 0; - constructor(params: IConstructorParams = {}) { - if (params.name) { - this.name = params.name; - } - this.init(); + constructor(params?: IConstructorParams) { + this.name = params?.name ?? materialNames[0]; + this.dmd = MaterialInfo[this.name].demandBase; + this.dmdR = MaterialInfo[this.name].demandRange; + this.cmp = MaterialInfo[this.name].competitionBase; + this.cmpR = MaterialInfo[this.name].competitionRange; + this.bCost = MaterialInfo[this.name].baseCost; + this.mv = MaterialInfo[this.name].maxVolatility; + this.mku = MaterialInfo[this.name].baseMarkup; } getMarkupLimit(): number { return this.qlt / this.mku; } - init(): void { - switch (this.name) { - case "Water": - this.dmd = 75; - this.dmdR = [65, 85]; - this.cmp = 50; - this.cmpR = [40, 60]; - this.bCost = 1500; - this.mv = 0.2; - this.mku = 6; - break; - case "Energy": - this.dmd = 90; - this.dmdR = [80, 99]; - this.cmp = 80; - this.cmpR = [65, 95]; - this.bCost = 2000; - this.mv = 0.2; - this.mku = 6; - break; - case "Food": - this.dmd = 80; - this.dmdR = [70, 90]; - this.cmp = 60; - this.cmpR = [35, 85]; - this.bCost = 5000; - this.mv = 1; - this.mku = 3; - break; - case "Plants": - this.dmd = 70; - this.dmdR = [20, 90]; - this.cmp = 50; - this.cmpR = [30, 70]; - this.bCost = 3000; - this.mv = 0.6; - this.mku = 3.75; - break; - case "Metal": - this.dmd = 80; - this.dmdR = [75, 85]; - this.cmp = 70; - this.cmpR = [60, 80]; - this.bCost = 2650; - this.mv = 1; - this.mku = 6; - break; - case "Hardware": - this.dmd = 85; - this.dmdR = [80, 90]; - this.cmp = 80; - this.cmpR = [65, 95]; - this.bCost = 8e3; - this.mv = 0.5; //Less mv bc its processed twice - this.mku = 1; - break; - case "Chemicals": - this.dmd = 55; - this.dmdR = [40, 70]; - this.cmp = 60; - this.cmpR = [40, 80]; - this.bCost = 9e3; - this.mv = 1.2; - this.mku = 2; - break; - case "Real Estate": - this.dmd = 50; - this.dmdR = [5, 99]; - this.cmp = 50; - this.cmpR = [25, 75]; - this.bCost = 80e3; - this.mv = 1.5; //Less mv bc its processed twice - this.mku = 1.5; - break; - case "Drugs": - this.dmd = 60; - this.dmdR = [45, 75]; - this.cmp = 70; - this.cmpR = [40, 99]; - this.bCost = 40e3; - this.mv = 1.6; - this.mku = 1; - break; - case "Robots": - this.dmd = 90; - this.dmdR = [80, 99]; - this.cmp = 90; - this.cmpR = [80, 99]; - this.bCost = 75e3; - this.mv = 0.5; //Less mv bc its processed twice - this.mku = 1; - break; - case "AI Cores": - this.dmd = 90; - this.dmdR = [80, 99]; - this.cmp = 90; - this.cmpR = [80, 99]; - this.bCost = 15e3; - this.mv = 0.8; //Less mv bc its processed twice - this.mku = 0.5; - break; - case "Scientific Research": - case "InitName": - break; - default: - console.error(`Invalid material type in init(): ${this.name}`); - break; - } - } - // Process change in demand, competition, and buy cost of this material processMarket(): void { // The price will change in accordance with demand and competition. @@ -235,6 +132,8 @@ export class Material { // Initializes a Material object from a JSON save state. static fromJSON(value: IReviverValue): Material { + // Gracefully load save files from when Scientific Research was considered a Material (pre 2.2). + if (value.data.name === "Scientific Research") return value.data.qty; return Generic_fromJSON(Material, value.data); } } diff --git a/src/Corporation/MaterialInfo.ts b/src/Corporation/MaterialInfo.ts index b5c0633cb..b67b802e9 100644 --- a/src/Corporation/MaterialInfo.ts +++ b/src/Corporation/MaterialInfo.ts @@ -1,14 +1,126 @@ +import { CorpMaterialConstantData, CorpMaterialName } from "@nsdefs"; + // Map of material (by name) to their sizes (how much space it takes in warehouse) -export const MaterialInfo: Record = { - Water: ["Water", 0.05, false], - Energy: ["Energy", 0.01, false], - Food: ["Food", 0.03, false], - Plants: ["Plants", 0.05, false], - Metal: ["Metal", 0.1, false], - Hardware: ["Hardware", 0.06, true], - Chemicals: ["Chemicals", 0.05, false], - Drugs: ["Drugs", 0.02, false], - Robots: ["Robots", 0.5, true], - AICores: ["AI Cores", 0.1, true], - RealEstate: ["Real Estate", 0.005, true], +export const MaterialInfo: Record = { + Water: { + name: "Water", + size: 0.05, + demandBase: 75, + demandRange: [65, 85], + competitionBase: 50, + competitionRange: [40, 60], + baseCost: 1500, + maxVolatility: 0.2, + baseMarkup: 6, + }, + Energy: { + name: "Energy", + size: 0.01, + demandBase: 90, + demandRange: [80, 99], + competitionBase: 80, + competitionRange: [65, 95], + baseCost: 2000, + maxVolatility: 0.2, + baseMarkup: 6, + }, + Food: { + name: "Food", + size: 0.03, + demandBase: 80, + demandRange: [70, 90], + competitionBase: 60, + competitionRange: [35, 85], + baseCost: 5000, + maxVolatility: 1, + baseMarkup: 3, + }, + Plants: { + name: "Plants", + size: 0.05, + demandBase: 70, + demandRange: [20, 90], + competitionBase: 50, + competitionRange: [30, 70], + baseCost: 3000, + maxVolatility: 0.6, + baseMarkup: 3.75, + }, + Metal: { + name: "Metal", + size: 0.1, + demandBase: 80, + demandRange: [75, 85], + competitionBase: 70, + competitionRange: [60, 80], + baseCost: 2650, + maxVolatility: 1, + baseMarkup: 6, + }, + Hardware: { + name: "Hardware", + size: 0.06, + demandBase: 85, + demandRange: [80, 90], + competitionBase: 80, + competitionRange: [65, 95], + baseCost: 8e3, + maxVolatility: 0.5, + baseMarkup: 1, + }, + Chemicals: { + name: "Chemicals", + size: 0.05, + demandBase: 55, + demandRange: [40, 70], + competitionBase: 60, + competitionRange: [40, 80], + baseCost: 9e3, + maxVolatility: 1.2, + baseMarkup: 2, + }, + Drugs: { + name: "Drugs", + size: 0.02, + demandBase: 60, + demandRange: [45, 75], + competitionBase: 70, + competitionRange: [40, 99], + baseCost: 40e3, + maxVolatility: 1.6, + baseMarkup: 1, + }, + Robots: { + name: "Robots", + size: 0.5, + demandBase: 90, + demandRange: [80, 99], + competitionBase: 90, + competitionRange: [80, 99], + baseCost: 75e3, + maxVolatility: 0.5, + baseMarkup: 1, + }, + "AI Cores": { + name: "AI Cores", + size: 0.1, + demandBase: 90, + demandRange: [80, 99], + competitionBase: 90, + competitionRange: [80, 99], + baseCost: 15e3, + maxVolatility: 0.8, + baseMarkup: 0.5, + }, + "Real Estate": { + name: "Real Estate", + size: 0.005, + demandBase: 50, + demandRange: [5, 99], + competitionBase: 50, + competitionRange: [25, 75], + baseCost: 80e3, + maxVolatility: 1.5, + baseMarkup: 1.5, + }, }; diff --git a/src/Corporation/OfficeSpace.ts b/src/Corporation/OfficeSpace.ts index 2d0007865..7d20d0bba 100644 --- a/src/Corporation/OfficeSpace.ts +++ b/src/Corporation/OfficeSpace.ts @@ -1,22 +1,23 @@ -import { EmployeePositions } from "./EmployeePositions"; -import { CorporationConstants } from "./data/Constants"; +import { EmployeePositions } from "./data/Enums"; +import * as corpConstants from "./data/Constants"; import { Generic_fromJSON, Generic_toJSON, IReviverValue, Reviver } from "../utils/JSONReviver"; import { Industry } from "./Industry"; import { Corporation } from "./Corporation"; import { getRandomInt } from "../utils/helpers/getRandomInt"; +import { CityName } from "../Enums"; interface IParams { - loc?: string; + loc?: CityName; size?: number; } export class OfficeSpace { - loc: string; + loc: CityName; size: number; - minEne = 0; - minHap = 0; - minMor = 0; + minEne = 5; + minHap = 5; + minMor = 5; maxEne = 100; maxHap = 100; @@ -70,7 +71,7 @@ export class OfficeSpace { }; constructor(params: IParams = {}) { - this.loc = params.loc ? params.loc : ""; + this.loc = params.loc ? params.loc : CityName.Sector12; this.size = params.size ? params.size : 1; } @@ -161,7 +162,7 @@ export class OfficeSpace { this.totalSalary = 0; } else { this.totalSalary = - CorporationConstants.EmployeeSalaryMultiplier * + corpConstants.employeeSalaryMultiplier * marketCycles * this.totalEmployees * (this.avgInt + this.avgCha + this.totalExp / this.totalEmployees + this.avgCre + this.avgEff); @@ -247,7 +248,7 @@ export class OfficeSpace { } getCoffeeCost(): number { - return 500e3 * this.totalEmployees; + return corpConstants.coffeeCostPerEmployee * this.totalEmployees; } setCoffee(): boolean { diff --git a/src/Corporation/Product.ts b/src/Corporation/Product.ts index 4d3ea2df2..85de60b76 100644 --- a/src/Corporation/Product.ts +++ b/src/Corporation/Product.ts @@ -1,4 +1,4 @@ -import { EmployeePositions } from "./EmployeePositions"; +import { EmployeePositions } from "./data/Enums"; import { MaterialInfo } from "./MaterialInfo"; import { Industry } from "./Industry"; import { IndustriesData } from "./IndustryData"; @@ -7,7 +7,9 @@ import { createCityMap } from "../Locations/createCityMap"; import { Generic_fromJSON, Generic_toJSON, IReviverValue, Reviver } from "../utils/JSONReviver"; import { getRandomInt } from "../utils/helpers/getRandomInt"; -import { CityName } from "../Locations/data/CityNames"; +import { CityName } from "../Enums"; +import { materialNames } from "./data/Constants"; +import { CorpMaterialName } from "@nsdefs"; interface IConstructorParams { name?: string; @@ -25,7 +27,7 @@ interface IConstructorParams { features?: number; loc?: string; size?: number; - req?: Record; + req?: Partial>; } export class Product { @@ -93,7 +95,7 @@ export class Product { // Material requirements. An object that maps the name of a material to how much it requires // to make 1 unit of the product. - reqMats: Record = {}; + reqMats: Partial> = {}; // Data to keep track of whether production/sale of this Product is // manually limited. These values are specific to a city @@ -170,7 +172,7 @@ export class Product { const designMult = 1 + Math.pow(this.designCost, 0.1) / 100; const balanceMult = 1.2 * engrRatio + 0.9 * mgmtRatio + 1.3 * rndRatio + 1.5 * opsRatio + busRatio; - const sciMult = 1 + Math.pow(industry.sciResearch.qty, industry.sciFac) / 800; + const sciMult = 1 + Math.pow(industry.sciResearch, industry.sciFac) / 800; const totalMult = balanceMult * designMult * sciMult; this.qlt = @@ -230,7 +232,7 @@ export class Product { //Calculate the product's required materials //For now, just set it to be the same as the requirements to make materials - for (const matName of Object.keys(industry.reqMats)) { + for (const matName of Object.keys(industry.reqMats) as CorpMaterialName[]) { if (industry.reqMats.hasOwnProperty(matName)) { const reqMat = industry.reqMats[matName]; if (reqMat === undefined) continue; @@ -241,23 +243,23 @@ export class Product { //Calculate the product's size //For now, just set it to be the same size as the requirements to make materials this.siz = 0; - for (const matName of Object.keys(industry.reqMats)) { + for (const matName of Object.values(materialNames)) { const reqMat = industry.reqMats[matName]; if (reqMat === undefined) continue; - this.siz += MaterialInfo[matName][1] * reqMat; + this.siz += MaterialInfo[matName].size * reqMat; } } calculateRating(industry: Industry): void { - const weights = IndustriesData[industry.type].ProductRatingWeights; + const weights = IndustriesData[industry.type].product?.ratingWeights; if (!weights) return console.error(`Could not find product rating weights for: ${industry}`); this.rat = 0; - this.rat += weights.Quality ? this.qlt * weights.Quality : 0; - this.rat += weights.Performance ? this.per * weights.Performance : 0; - this.rat += weights.Durability ? this.dur * weights.Durability : 0; - this.rat += weights.Reliability ? this.rel * weights.Reliability : 0; - this.rat += weights.Aesthetics ? this.aes * weights.Aesthetics : 0; - this.rat += weights.Features ? this.fea * weights.Features : 0; + this.rat += weights.quality ? this.qlt * weights.quality : 0; + this.rat += weights.performance ? this.per * weights.performance : 0; + this.rat += weights.durability ? this.dur * weights.durability : 0; + this.rat += weights.reliability ? this.rel * weights.reliability : 0; + this.rat += weights.aesthetics ? this.aes * weights.aesthetics : 0; + this.rat += weights.features ? this.fea * weights.features : 0; } // Serialize the current object to a JSON save state. @@ -267,6 +269,18 @@ export class Product { // Initializes a Product object from a JSON save state. static fromJSON(value: IReviverValue): Product { + // TODO: Remove all corp graceful loading measures during major corp rebalance / rework. + // For that version, Player.corporation will just get reset to null when loading from older version. + + // Gracefully load saves from when RealEstate and AICores didn't have spaces + if (value.data.reqMats?.RealEstate) { + value.data.reqMats["Real Estate"] = value.data.reqMats.RealEstate; + delete value.data.reqMats.RealEstate; + } + if (value.data.reqMats?.AICores) { + value.data.reqMats["AI Cores"] = value.data.reqMats.AICores; + delete value.data.reqMats.AICores; + } return Generic_fromJSON(Product, value.data); } } diff --git a/src/Corporation/Research.ts b/src/Corporation/Research.ts index 85432166c..3e6faeff3 100644 --- a/src/Corporation/Research.ts +++ b/src/Corporation/Research.ts @@ -1,5 +1,8 @@ +import { CorpResearchName } from "@nsdefs"; +import { researchNames } from "./data/Constants"; + export interface IConstructorParams { - name: string; + name: CorpResearchName; cost: number; desc: string; advertisingMult?: number; @@ -16,7 +19,7 @@ export interface IConstructorParams { export class Research { // Name of research. This will be used to identify researches in the Research Tree - name = ""; + name: CorpResearchName; // How much scientific research it costs to unlock this cost = 0; @@ -36,7 +39,7 @@ export class Research { sciResearchMult = 1; storageMult = 1; - constructor(p: IConstructorParams = { name: "", cost: 0, desc: "" }) { + constructor(p: IConstructorParams = { name: researchNames[0], cost: 0, desc: "" }) { this.name = p.name; this.cost = p.cost; this.desc = p.desc; diff --git a/src/Corporation/ResearchTree.ts b/src/Corporation/ResearchTree.ts index f0d88a706..b915b738d 100644 --- a/src/Corporation/ResearchTree.ts +++ b/src/Corporation/ResearchTree.ts @@ -3,13 +3,15 @@ // Each Node in the Research Trees only holds the name(s) of Research, // not an actual Research object. The name can be used to obtain a reference // to the corresponding Research object using the ResearchMap +import { CorpResearchName } from "@nsdefs"; +import { researchNames } from "./data/Constants"; import { Research } from "./Research"; import { ResearchMap } from "./ResearchMap"; interface IConstructorParams { children?: Node[]; cost: number; - text: string; + text: CorpResearchName; parent?: Node | null; } @@ -32,9 +34,9 @@ export class Node { parent: Node | null = null; // Name of the Research held in this Node - text = ""; + text: CorpResearchName; - constructor(p: IConstructorParams = { cost: 0, text: "" }) { + constructor(p: IConstructorParams = { cost: 0, text: researchNames[0] }) { if (ResearchMap[p.text] == null) { throw new Error(`Invalid Research name used when constructing ResearchTree Node: ${p.text}`); } @@ -90,8 +92,8 @@ export class ResearchTree { root: Node | null = null; // Gets an array with the 'text' values of ALL Nodes in the Research Tree - getAllNodes(): string[] { - const res: string[] = []; + getAllNodes(): CorpResearchName[] { + const res: CorpResearchName[] = []; const queue: Node[] = []; if (this.root == null) { @@ -211,7 +213,7 @@ export class ResearchTree { // Search for a Node with the given name ('text' property on the Node) // Returns 'null' if it cannot be found - findNode(name: string): Node | null { + findNode(name: CorpResearchName): Node | null { if (this.root == null) { return null; } @@ -219,7 +221,7 @@ export class ResearchTree { } // Marks a Node as researched - research(name: string): void { + research(name: CorpResearchName): void { if (this.root == null) { return; } diff --git a/src/Corporation/Warehouse.ts b/src/Corporation/Warehouse.ts index 1b370aac7..6ee6d8f25 100644 --- a/src/Corporation/Warehouse.ts +++ b/src/Corporation/Warehouse.ts @@ -4,11 +4,14 @@ import { Industry } from "./Industry"; import { MaterialInfo } from "./MaterialInfo"; import { Generic_fromJSON, Generic_toJSON, IReviverValue, Reviver } from "../utils/JSONReviver"; import { exceptionAlert } from "../utils/helpers/exceptionAlert"; +import { CityName } from "../Enums"; +import { CorpMaterialName } from "@nsdefs"; +import { materialNames } from "./data/Constants"; interface IConstructorParams { corp?: Corporation; industry?: Industry; - loc?: string; + loc?: CityName; size?: number; } @@ -17,10 +20,10 @@ export class Warehouse { level = 1; // City that this Warehouse is in - loc: string; + loc: CityName; // Map of Materials held by this Warehouse - materials: Record; + materials: Record; // Maximum amount warehouse can hold size: number; @@ -32,7 +35,7 @@ export class Warehouse { smartSupplyEnabled = false; // Decide if smart supply should use the materials already in the warehouse when deciding on the amount to buy. - smartSupplyUseLeftovers: { [key: string]: boolean | undefined } = {}; + smartSupplyUseLeftovers: Record; // Stores the amount of product to be produced. Used for Smart Supply unlock. // The production tracked by smart supply is always based on the previous cycle, @@ -40,36 +43,15 @@ export class Warehouse { smartSupplyStore = 0; constructor(params: IConstructorParams = {}) { - this.loc = params.loc ? params.loc : ""; + this.loc = params.loc ? params.loc : CityName.Sector12; this.size = params.size ? params.size : 0; - this.materials = { - Water: new Material({ name: "Water" }), - Energy: new Material({ name: "Energy" }), - Food: new Material({ name: "Food" }), - Plants: new Material({ name: "Plants" }), - Metal: new Material({ name: "Metal" }), - Hardware: new Material({ name: "Hardware" }), - Chemicals: new Material({ name: "Chemicals" }), - Drugs: new Material({ name: "Drugs" }), - Robots: new Material({ name: "Robots" }), - AICores: new Material({ name: "AI Cores" }), - RealEstate: new Material({ name: "Real Estate" }), - }; - - this.smartSupplyUseLeftovers = { - Water: true, - Energy: true, - Food: true, - Plants: true, - Metal: true, - Hardware: true, - Chemicals: true, - Drugs: true, - Robots: true, - AICores: true, - RealEstate: true, - }; + this.materials = {} as Record; + this.smartSupplyUseLeftovers = {} as Record; + for (const matName of materialNames) { + this.materials[matName] = new Material({ name: matName }); + this.smartSupplyUseLeftovers[matName] = true; + } if (params.corp && params.industry) { this.updateSize(params.corp, params.industry); @@ -84,11 +66,9 @@ export class Warehouse { // Re-calculate how much space is being used by this Warehouse updateMaterialSizeUsed(): void { this.sizeUsed = 0; - for (const matName of Object.keys(this.materials)) { + for (const matName of Object.values(materialNames)) { const mat = this.materials[matName]; - if (MaterialInfo.hasOwnProperty(matName)) { - this.sizeUsed += mat.qty * MaterialInfo[matName][1]; - } + this.sizeUsed += mat.qty * MaterialInfo[matName].size; } if (this.sizeUsed > this.size) { console.warn("Warehouse size used greater than capacity, something went wrong"); @@ -110,6 +90,19 @@ export class Warehouse { // Initializes a Warehouse object from a JSON save state. static fromJSON(value: IReviverValue): Warehouse { + //Gracefully load saves where AICores and RealEstate material names sometimes did not use spaces + if (value.data?.materials?.AICores) { + value.data.materials["AI Cores"] = value.data.materials.AICores; + value.data.smartSupplyUseLeftovers["AI Cores"] = value.data.smartSupplyUseLeftovers.AICores; + delete value.data.materials.AICores; + delete value.data.smartSupplyUseLeftovers.AICores; + } + if (value.data?.materials?.RealEstate) { + value.data.materials["Real Estate"] = value.data.materials.RealEstate; + value.data.smartSupplyUseLeftovers["Real Estate"] = value.data.smartSupplyUseLeftovers.RealEstate; + delete value.data.materials.RealEstate; + delete value.data.smartSupplyUseLeftovers.RealEstate; + } return Generic_fromJSON(Warehouse, value.data); } } diff --git a/src/Corporation/data/Constants.ts b/src/Corporation/data/Constants.ts index fd2eaa37d..6d2cd931b 100644 --- a/src/Corporation/data/Constants.ts +++ b/src/Corporation/data/Constants.ts @@ -1,47 +1,28 @@ -import { CityName } from "./../../Locations/data/CityNames"; -const CyclesPerMarketCycle = 50; -const AllCorporationStates = ["START", "PURCHASE", "PRODUCTION", "SALE", "EXPORT"]; -export const CorporationConstants = { - INITIALSHARES: 1e9, //Total number of shares you have at your company - SHARESPERPRICEUPDATE: 1e6, //When selling large number of shares, price is dynamically updated for every batch of this amount - IssueNewSharesCooldown: 216e3, // 12 Hour in terms of game cycles - SellSharesCooldown: 18e3, // 1 Hour in terms of game cycles +import { + CorpEmployeePosition, + CorpIndustryName, + CorpMaterialName, + CorpResearchName, + CorpStateName, + CorpUnlockName, + CorpUpgradeName, +} from "@nsdefs"; +import { CONSTANTS } from "../../Constants"; +import { IndustryType, EmployeePositions } from "./Enums"; - CyclesPerMarketCycle: CyclesPerMarketCycle, - CyclesPerIndustryStateCycle: CyclesPerMarketCycle / AllCorporationStates.length, - SecsPerMarketCycle: CyclesPerMarketCycle / 5, +// For typed strings, we need runtime objects to do API typechecking against. - Cities: [ - CityName.Aevum, - CityName.Chongqing, - CityName.Sector12, - CityName.NewTokyo, - CityName.Ishima, - CityName.Volhaven, - ], +// This structure + import * as corpConstants allows easier type definitions for individual properties. - WarehouseInitialCost: 5e9, //Initial purchase cost of warehouse - WarehouseInitialSize: 100, - WarehouseUpgradeBaseCost: 1e9, - - OfficeInitialCost: 4e9, - OfficeInitialSize: 3, - OfficeUpgradeBaseCost: 1e9, - - BribeThreshold: 100e12, //Money needed to be able to bribe for faction rep - BribeToRepRatio: 1e9, //Bribe Value divided by this = rep gain - - ProductProductionCostRatio: 5, //Ratio of material cost of a product to its production cost - - DividendMaxRate: 1, - - EmployeeSalaryMultiplier: 3, // Employee stats multiplied by this to determine initial salary - CyclesPerEmployeeRaise: 400, // All employees get a raise every X market cycles - EmployeeRaiseAmount: 50, // Employee salary increases by this (additive) - - BaseMaxProducts: 3, // Initial value for maximum number of products allowed - AllCorporationStates: AllCorporationStates, - AllMaterials: [ +/** Names of all corporation game states */ +export const stateNames: CorpStateName[] = ["START", "PURCHASE", "PRODUCTION", "SALE", "EXPORT"], + // TODO: remove IndustryType and EmployeePositions enums and just use the typed strings. + /** Names of all corporation employee positions */ + employeePositions: CorpEmployeePosition[] = Object.values(EmployeePositions), + /** Names of all industries. */ + industryNames: CorpIndustryName[] = Object.values(IndustryType), + /** Names of all materials */ + materialNames: CorpMaterialName[] = [ "Water", "Energy", "Food", @@ -54,7 +35,8 @@ export const CorporationConstants = { "AI Cores", "Real Estate", ], - AllUnlocks: [ + /** Names of all one-time corporation-wide unlocks */ + unlockNames: CorpUnlockName[] = [ "Export", "Smart Supply", "Market Research - Demand", @@ -65,7 +47,7 @@ export const CorporationConstants = { "Warehouse API", "Office API", ], - AllUpgrades: [ + upgradeNames: CorpUpgradeName[] = [ "Smart Factories", "Smart Storage", "DreamSense", @@ -77,7 +59,8 @@ export const CorporationConstants = { "ABC SalesBots", "Project Insight", ], - BaseResearch: [ + /** Names of all reasearches common to all industries */ + researchNamesBase: CorpResearchName[] = [ "Hi-Tech R&D Laboratory", "AutoBrew", "AutoPartyManager", @@ -97,9 +80,42 @@ export const CorporationConstants = { "Self-Correcting Assemblers", "Sti.mu", ], - ProdResearch: ["uPgrade: Capacity.I", "uPgrade: Capacity.II", "uPgrade: Dashboard", "uPgrade: Fulcrum"], - FundingRoundShares: [0.1, 0.35, 0.25, 0.2], - FundingRoundMultiplier: [4, 3, 3, 2.5], - - ValuationLength: 5, -}; + /** Names of all researches only available to product industries */ + researchNamesProductOnly: CorpResearchName[] = [ + "uPgrade: Capacity.I", + "uPgrade: Capacity.II", + "uPgrade: Dashboard", + "uPgrade: Fulcrum", + ], + /** Names of all researches */ + researchNames: CorpResearchName[] = [...researchNamesBase, ...researchNamesProductOnly], + initialShares = 1e9, + /** When selling large number of shares, price is dynamically updated for every batch of this amount */ + sharesPerPriceUpdate = 1e6, + /** Cooldown for issue new shares cooldown in game cycles. 12 hours. */ + issueNewSharesCooldown = 216e3, + /** Cooldown for selling shares in game cycles. 1 hour. */ + sellSharesCooldown = 18e3, + coffeeCostPerEmployee = 500e3, + gameCyclesPerMarketCycle = 50, + gameCyclesPerCorpStateCycle = gameCyclesPerMarketCycle / stateNames.length, + secondsPerMarketCycle = (gameCyclesPerMarketCycle * CONSTANTS.MilliPerCycle) / 1000, + warehouseInitialCost = 5e9, + warehouseInitialSize = 100, + warehouseSizeUpgradeCostBase = 1e9, + officeInitialCost = 4e9, + officeInitialSize = 3, + officeSizeUpgradeCostBase = 1e9, + bribeThreshold = 100e12, + bribeAmountPerReputation = 1e9, + baseProductProfitMult = 5, + dividendMaxRate = 1, + /** Conversion factor for employee stats to initial salary */ + employeeSalaryMultiplier = 3, + marketCyclesPerEmployeeRaise = 400, + employeeRaiseAmount = 50, + /** Max products for a division without upgrades */ + maxProductsBase = 3, + fundingRoundShares = [0.1, 0.35, 0.25, 0.2], + fundingRoundMultiplier = [4, 3, 3, 2.5], + valuationLength = 5; diff --git a/src/Corporation/data/Enums.ts b/src/Corporation/data/Enums.ts new file mode 100644 index 000000000..9123fe51c --- /dev/null +++ b/src/Corporation/data/Enums.ts @@ -0,0 +1,26 @@ +export enum IndustryType { + Energy = "Energy", + Utilities = "Water Utilities", + Agriculture = "Agriculture", + Fishing = "Fishing", + Mining = "Mining", + Food = "Food", + Tobacco = "Tobacco", + Chemical = "Chemical", + Pharmaceutical = "Pharmaceutical", + Computers = "Computer Hardware", + Robotics = "Robotics", + Software = "Software", + Healthcare = "Healthcare", + RealEstate = "Real Estate", +} + +export enum EmployeePositions { + Operations = "Operations", + Engineer = "Engineer", + Business = "Business", + Management = "Management", + RandD = "Research & Development", + Training = "Training", + Unassigned = "Unassigned", +} diff --git a/src/Corporation/ui/CityTabs.tsx b/src/Corporation/ui/CityTabs.tsx index a94d018fd..e72cd5ed6 100644 --- a/src/Corporation/ui/CityTabs.tsx +++ b/src/Corporation/ui/CityTabs.tsx @@ -7,7 +7,7 @@ import { ExpandNewCity } from "./ExpandNewCity"; import { useDivision } from "./Context"; import Tabs from "@mui/material/Tabs"; import Tab from "@mui/material/Tab"; -import { CityName } from "../../Locations/data/CityNames"; +import { CityName } from "../../Enums"; interface IProps { city: CityName | "Expand"; diff --git a/src/Corporation/ui/CorporationRoot.tsx b/src/Corporation/ui/CorporationRoot.tsx index 1538965cc..cffe84a5a 100644 --- a/src/Corporation/ui/CorporationRoot.tsx +++ b/src/Corporation/ui/CorporationRoot.tsx @@ -3,7 +3,7 @@ // divisions, see an overview of your corporation, or create a new industry import React, { useState, useEffect } from "react"; import { MainPanel } from "./MainPanel"; -import { IndustryType } from "../IndustryData"; +import { IndustryType } from "../data/Enums"; import { ExpandIndustryTab } from "./ExpandIndustryTab"; import { Player } from "@player"; import { Context } from "./Context"; diff --git a/src/Corporation/ui/ExpandIndustryTab.tsx b/src/Corporation/ui/ExpandIndustryTab.tsx index 279f55a9b..41c33e3fe 100644 --- a/src/Corporation/ui/ExpandIndustryTab.tsx +++ b/src/Corporation/ui/ExpandIndustryTab.tsx @@ -1,6 +1,7 @@ import React, { useState } from "react"; import { dialogBoxCreate } from "../../ui/React/DialogBox"; -import { IndustryType, IndustryDescriptions, IndustriesData } from "../IndustryData"; +import { IndustryDescriptions, IndustriesData } from "../IndustryData"; +import { IndustryType } from "../data/Enums"; import { useCorporation } from "./Context"; import { Industry } from "../Industry"; import { NewIndustry } from "../Actions"; diff --git a/src/Corporation/ui/ExpandNewCity.tsx b/src/Corporation/ui/ExpandNewCity.tsx index a6b15a920..13b693065 100644 --- a/src/Corporation/ui/ExpandNewCity.tsx +++ b/src/Corporation/ui/ExpandNewCity.tsx @@ -1,5 +1,5 @@ import React, { useState } from "react"; -import { CorporationConstants } from "../data/Constants"; +import * as corpConstants from "../data/Constants"; import { dialogBoxCreate } from "../../ui/React/DialogBox"; import { NewCity } from "../Actions"; import { MoneyCost } from "./MoneyCost"; @@ -8,7 +8,7 @@ import Typography from "@mui/material/Typography"; import MenuItem from "@mui/material/MenuItem"; import Select, { SelectChangeEvent } from "@mui/material/Select"; import Button from "@mui/material/Button"; -import { CityName } from "../../Locations/data/CityNames"; +import { CityName } from "../../Enums"; interface IProps { cityStateSetter: (city: CityName | "Expand") => void; @@ -20,7 +20,7 @@ export function ExpandNewCity(props: IProps): React.ReactElement { const possibleCities = Object.values(CityName).filter((cityName) => division.offices[cityName] === 0); const [city, setCity] = useState(possibleCities[0]); - const disabled = corp.funds < CorporationConstants.OfficeInitialCost; + const disabled = corp.funds < corpConstants.officeInitialCost; function onCityChange(event: SelectChangeEvent): void { setCity(event.target.value as CityName); @@ -42,7 +42,7 @@ export function ExpandNewCity(props: IProps): React.ReactElement { <> Would you like to expand into a new city by opening an office? This would cost{" "} - +