fixed formulas typing issues

This commit is contained in:
Vomitblood 2026-05-01 20:26:54 +08:00
parent b972588825
commit 4a798b3f44
2 changed files with 90 additions and 16 deletions

View file

@ -1,24 +1,99 @@
import { import {
BitNodeOptions, type BitNodeOptions,
Bladeburner, type Bladeburner,
CityName, type CompanyName,
CompanyName, type Corporation,
Corporation, type FactionName,
FactionName, type Gang,
Gang, type HP,
HP, type Person as IPerson,
Person as IPerson, type Player as IPlayer,
Player as IPlayer, type JobName,
JobName, type Skills,
LocationName, type Sleeve,
Skills, type WorkStats,
Sleeve,
WorkStats,
} from "@ns"; } from "@ns";
import { CONSTANTS, defaultMultipliers } from "./constants"; import { CONSTANTS, defaultMultipliers } from "./constants";
import { currentNodeMults, PartialRecord } from "./exports"; import { currentNodeMults, PartialRecord } from "./exports";
import { calculateSkill } from "./skills"; import { calculateSkill } from "./skills";
/** Names of all cities */
enum CityName {
Aevum = "Aevum",
Chongqing = "Chongqing",
Sector12 = "Sector-12",
NewTokyo = "New Tokyo",
Ishima = "Ishima",
Volhaven = "Volhaven",
}
/** Names of all locations */
export enum LocationName {
AevumAeroCorp = "AeroCorp",
AevumBachmanAndAssociates = "Bachman & Associates",
AevumClarkeIncorporated = "Clarke Incorporated",
AevumCrushFitnessGym = "Crush Fitness Gym",
AevumECorp = "ECorp",
AevumFulcrumTechnologies = "Fulcrum Technologies",
AevumGalacticCybersystems = "Galactic Cybersystems",
AevumNetLinkTechnologies = "NetLink Technologies",
AevumPolice = "Aevum Police Headquarters",
AevumRhoConstruction = "Rho Construction",
AevumSnapFitnessGym = "Snap Fitness Gym",
AevumSummitUniversity = "Summit University",
AevumWatchdogSecurity = "Watchdog Security",
AevumCasino = "Iker Molina Casino",
ChongqingKuaiGongInternational = "KuaiGong International",
ChongqingSolarisSpaceSystems = "Solaris Space Systems",
ChongqingChurchOfTheMachineGod = "Church of the Machine God",
Sector12AlphaEnterprises = "Alpha Enterprises",
Sector12BladeIndustries = "Blade Industries",
Sector12CIA = "Central Intelligence Agency",
Sector12CarmichaelSecurity = "Carmichael Security",
Sector12CityHall = "Sector-12 City Hall",
Sector12DeltaOne = "DeltaOne",
Sector12FoodNStuff = "FoodNStuff",
Sector12FourSigma = "Four Sigma",
Sector12IcarusMicrosystems = "Icarus Microsystems",
Sector12IronGym = "Iron Gym",
Sector12JoesGuns = "Joe's Guns",
Sector12MegaCorp = "MegaCorp",
Sector12NSA = "National Security Agency",
Sector12PowerhouseGym = "Powerhouse Gym",
Sector12RothmanUniversity = "Rothman University",
Sector12UniversalEnergy = "Universal Energy",
NewTokyoDefComm = "DefComm",
NewTokyoGlobalPharmaceuticals = "Global Pharmaceuticals",
NewTokyoNoodleBar = "Noodle Bar",
NewTokyoVitaLife = "VitaLife",
NewTokyoArcade = "Arcade",
IshimaNovaMedical = "Nova Medical",
IshimaOmegaSoftware = "Omega Software",
IshimaStormTechnologies = "Storm Technologies",
IshimaGlitch = "0x6C1",
VolhavenCompuTek = "CompuTek",
VolhavenHeliosLabs = "Helios Labs",
VolhavenLexoCorp = "LexoCorp",
VolhavenMilleniumFitnessGym = "Millenium Fitness Gym",
VolhavenNWO = "NWO",
VolhavenOmniTekIncorporated = "OmniTek Incorporated",
VolhavenOmniaCybersystems = "Omnia Cybersystems",
VolhavenSysCoreSecurities = "SysCore Securities",
VolhavenZBInstituteOfTechnology = "ZB Institute of Technology",
Hospital = "Hospital",
Slums = "The Slums",
TravelAgency = "Travel Agency",
WorldStockExchange = "World Stock Exchange",
Void = "The Void",
}
export interface Multipliers { export interface Multipliers {
hacking_chance: number; hacking_chance: number;
hacking_speed: number; hacking_speed: number;

View file

@ -27,7 +27,6 @@ export function clampInteger(value: number, min = -Number.MAX_SAFE_INTEGER, max
* Checks that a variable is a valid number. A valid number * Checks that a variable is a valid number. A valid number
* must be a "number" type and cannot be NaN * must be a "number" type and cannot be NaN
*/ */
export function isValidNumber(n: number): boolean { export function isValidNumber(n: number): boolean {
return typeof n === "number" && !isNaN(n); return typeof n === "number" && !isNaN(n);
} }