Commit Graph

180 Commits

Author SHA1 Message Date
TheAimMan
e957864c4b
Fix missing check on singularity.getCurrentWork (#971) 2023-12-09 06:11:46 -05:00
David Walker
61ffed9b3a
BUGFIX: Fix additionalMsec overflow issue (#941) 2023-12-07 20:34:49 -05:00
Snarling
f93bbfbd5d
UPDATE: 2.5.1 Release (#952) 2023-11-30 16:46:56 -05:00
Jesse Clark
fdcb8306d9
FACTIONS: Add "Rumors" system for learning about faction join requirements (#888) 2023-11-02 10:20:24 -04:00
Snarling
38f693e2c1
ENUMS: Followup for #859 (#868) 2023-10-17 07:19:32 -04:00
alutman
1a052a7daf
API: Change singularity.applyToCompany() to use an enum for job field (#859) 2023-10-17 05:33:16 -04:00
Noah Harris
e22527e7b7
fix: check for purchased program before enough money (#839) 2023-10-03 02:02:28 -04:00
missymae#2783
673efb427f
UI: Fix some DevMenu react errors, add number of exploits to savegame comparison (#825) 2023-10-02 23:28:16 -04:00
Snarling
4ca598defb
API: Fix removed functions (#720) 2023-08-07 02:38:38 -04:00
myCatsName
aed01b0979
NETSCRIPT: added ns.singularity.getAugmentationFactions (#706) 2023-08-06 00:04:36 -04:00
Your Name
b4836e5329 v2.4.0 2023-07-30 22:08:36 -04:00
Snarling
e2655793f4
TYPESAFETY: CompanyName (#650) 2023-07-11 09:23:17 -04:00
Aleksei Bezrodnov
1af01401d9
UI: Correct behavior of "back" button on faction augs page
Plus router refactoring
2023-06-26 04:24:37 -04:00
Snarling
9a0a843ffc
TYPESAFETY: FactionName (#644) 2023-06-25 22:53:35 -04:00
Aleksei Bezrodnov
78ca279df7
FIX: singularity faction donation formula (#619) 2023-06-19 03:55:03 -04:00
Snarling
a4b826683e
TYPESAFETY: Strict internal typing for AugmentationName (#608) 2023-06-16 17:52:42 -04:00
Snarling
6732549196
ENUMS: Initial Enum Helper rework + Reorganization (#596) 2023-06-12 00:34:20 -04:00
Snarling
403beef69e
PRESTIGE: Make bitnode reset synchronous again (#566)
* Make prestige synchronous
2023-06-03 18:04:45 -04:00
Snarling
ebae35b1fb
CODEBASE: Expand lint rules, and Aliases are stored as maps (#501) 2023-05-05 03:55:59 -04:00
Snarling
6024c81113
NETSCRIPT: add ns.getResetInfo(#490)
* Move lastAugReset and lastNodeReset back to main API under getResetInfo, also included currentNode.
* The associated properties are deprecated on getPlayer()
2023-04-25 05:22:36 -04:00
Snarling
e0272ad4af
FILES: Path rework & typesafety (#479)
* Added new types for various file paths, all in the Paths folder.
* TypeSafety and other helper functions related to these types
* Added basic globbing support with * and ?. Currently only implemented for Script/Text, on nano and download terminal commands
* Enforcing the new types throughout the codebase, plus whatever rewrites happened along the way
* Server.textFiles is now a map
* TextFile no longer uses a fn property, now it is filename
* Added a shared ContentFile interface for shared functionality between TextFile and Script.
* related to ContentFile change above, the player is now allowed to move a text file to a script file and vice versa.
* File paths no longer conditionally start with slashes, and all directory names other than root have ending slashes. The player is still able to provide paths starting with / but this now indicates that the player is specifying an absolute path instead of one relative to root.
* Singularized the MessageFilename and LiteratureName enums
* Because they now only accept correct types, server.writeToXFile functions now always succeed (the only reasons they could fail before were invalid filepath).
* Fix several issues with tab completion, which included pretty much a complete rewrite
* Changed the autocomplete display options so there's less chance it clips outside the display area.
* Turned CompletedProgramName into an enum.
* Got rid of programsMetadata, and programs and DarkWebItems are now initialized immediately instead of relying on initializers called from the engine.
* For any executable (program, cct, or script file) pathing can be used directly to execute without using the run command (previously the command had to start with ./ and it wasn't actually using pathing).
2023-04-24 10:26:57 -04:00
Snarling
0df984eea0
CODEBASE: Add Jsonable Map and Set types, move player.sourceFiles to a map (#473) 2023-04-18 03:19:45 -04:00
G4mingJon4s
d01ba91654
SINGULARITY: Added aug and node identifiers (timestamps of last resets) (#472) 2023-04-12 13:13:42 -04:00
T.J. Eckman
677686fa20
SINGULARITY: getCompanyPositionInfo (#460) 2023-04-04 12:00:54 -04:00
T.J. Eckman
df334ea6de
SINGULARITY: Added getCompanyPositions (#459)
Also workForCompany will throw an error if provided a bad company name, instead of returning false
2023-04-01 21:30:46 -04:00
omuretsu
b9ffb9e42e Add triggers for faction invite check
Manually check for faction invites whenever a server is backdoored, and whenever the player uses ns.singularity.checkFactionInvites
2023-03-07 19:31:54 -05:00
Snarling
759f86d6e5
NETSCRIPT: Rework script ram updates (#408) 2023-03-05 22:39:42 -05:00
Snarling
b4074328ec
UI: Added new locale-aware and configurable number formatting (#354) 2023-02-11 13:18:50 -05:00
omuretsu
0ec4ef31ab 2.2 2023-01-02 13:20:25 -05:00
Snarling
fb1f95c26e
VARIOUS: Various changes prior to release 2.2 (#271)
See PR #271 description
2022-12-29 20:28:53 -05:00
David Walker
8d793ea271
Internal refactoring of Router (#241) 2022-12-04 03:14:06 -05:00
Snarling
65cd14e33b
DOC: Add ns documentation for possible sleeve tasks (#217)
* Add specific types for sleeve tasks
* Moved LocationName enum to overall enums file
* Add LocationName enum to those provided to player
* remove trailing s on CompanyPosNames enum (now CompanyPosName, in line with LocationName)
* Also regenerated all ns documentation. This leads to an expected error when checking for generated files, because PRs should not normally touch markdown files. Also leads to a lint failure in generated file bitburner.d.ts
* also removed some exporting from NetscriptDefinitions.d.ts for anything that wasn't imported somewhere else.
2022-11-20 12:07:22 -05:00
Snarling
88d51e9a7e
MISC: A bunch of enums stuff. (#212)
* Some game enums moved to utils/enums. Others can eventually be moved there as well.
* findEnumMember function for performing fuzzy matching of player input with enum members, without needing separate fuzzy functions for every enum.
* Also used findEnumMember for safely loading save games (allows case changes in enum values)
* Changed capitalization on some enums.
* BREAKING: removed classGains work formulas function
* Split ClassType enum into UniversityClassType and GymType.
* Added universityGains and gymGains work formulas functions
* Provided the new split enums to the player on ns.enums.
2022-11-20 08:37:11 -05:00
Snarling
426ad5f296
Sleeve criming fix (#209)
Also simplify usage of findCrime
2022-11-10 11:05:42 -05:00
Snarling
8e0e0eaa88
NETSCRIPT: ns.sleeve.getSleeve added. getPlayer and getSleeve can both be used for formulas. (#200)
* BREAKING CHANGE: Removed getSleeveStats and getSleeveInformation because this info is provided by getSleeve in a more usable form.
* BREAKING CHANGE: Removed tor, inBladeburner, and hasCorporation fields from ns.getPlayer. Functionality still exists via added functions ns.hasTorRouter, ns.corporation.hasCorporation, and ns.bladeburner.inBladeburner.
* Separated ns definitions for Person, Sleeve, and Player interfaces with both Player and Sleeve just extending Person.
Added getSleeve, which provides a Sleeve object similar to getPlayer.
* Renamed the sleeve ns layer's interface as sleeve lowercase because of name conflict. todo: May move all the ns layers interface names to lowercase for consistency
* Added ns.formulas.work.crimeSuccessChance and reworked to allow both sleeve and player calculations.
* Removed internal Person.getIntelligenceBonus function which was just a wrapper for calculateIntelligenceBonus. Any use of the former in formulas creates a conflict where ns-provided Person objects throw an error.
* Renamed helpers.player to helpers.person for netscript person validation. Reduced number of fields validated due to Person being a smaller interface.
* Fixed bug in bladeburner where Player multipliers and int were being used no matter which person was performing the task
* Fixed leak of Player.jobs at ns.getPlayer
* Person / Player / Sleeve classes now implement the netscript equivalent interfaces. Netscript helper for person no longer asserts that it's a real Person class member, only that it's a Person interface. Functions that use netscript persons have been changed to expect just a person interface to prevent needing this incorrect type assertion.
2022-11-09 07:26:26 -05:00
Snarling
6f08aee8f6
Fix zombie scripts (#203)
Also made installAugmentations synchronously perform reset, but added a short timeout to the callback script launch for balance.
2022-11-08 12:17:34 -05:00
Snarling
9e869bc876
NETSCRIPT: Add ns.formulas.work.companyGains function (#195)
* added ns.formulas.work.companyGains.
* Removed Work/Formulas folder, added Work/Formulas.ts
* CompanyPosition.calculateJobPerformance now takes in a Person instead of taking in a full set of stats, and it takes INT into account.
* formulas.crimeGains takes in a person object.
* Renamed ns Player type to Person.
* added multWorkStats, which multiplies a WorkStats object with a multipliers object.
* Remove unused types in NetscriptDefinitons.d.ts
* reuse formulas code in other parts of game
* getSleeveInformation also returns skills

Co-authored-by: Alexey <alexey.kozhemiakin@gmail.com>
2022-11-06 17:27:04 -05:00
Snarling
d74c380e42
WIP: Crimes streamlining. (#138)
* streamline crimes

* Crimes object is now indexed by CrimeType enum instead of an entirely new set of keys that aren't used for anything else. This eliminated a lot of instances of iterating to find the right crime for a given CrimeType.
* Removed unused `None` CrimeType which allowed typing Crimes as a Record<CrimeType, Crime>.
* Added slums tooltip text as a crime property, to allow streamlining slums.
* Refactor slums location - removed repetitive code, rerenders 1/sec to update chances
* Fix bugged descriptive text when sleeve is committing a crime (was "is attempting to DRUGS", now uses correct text e.g. "to deal drugs").
* Remove unused and now unneeded NewCrimeType enum. Values were identical to existing CrimeType values after removing unused None.

* Add CrimeType enum in NetscriptDefinition.d.ts

* Also update broken ToastVariant type. Better support for enums in player scripts.
* Still todo is modifying some NS functions to expect CrimeType as input (rough crime names will continue to work to avoid breaking scripts)

* Expect enum use for crime functions

Affected functions:
* ns.singularity.commitCrime
* ns.singularity.getCrimeChance
* ns.singularity.getCrimeStats
* ns.sleeve.setToCommitCrime
* formulas.work.crimeGains (param type only)

- Affected functions still will fall back to rough names, except formulas.work.crimeGains which already only accepted the enum members.
- Some documentation changes:
  * examples updated to use uppercase expected form.
  * Note on sleeve.setToCommitCrime that it only accepts exact matches removed. It already, and still does, accept any rough crime name (but the enum is expected input).
  * note about needing to use isBusy to schedule crimes remove - crimes autoloop now.
  * Since expected string inputs are documented directly on the type, removed list of crimes from sleeve.setToCommitCrimes
2022-10-21 11:57:37 -04:00
omuretsu
e192ad53ec Actually format + lint 2022-10-12 10:18:56 -04:00
omuretsu
7a384d53f4 typefix netscriptFunctions (see desc)
* Types for InternalFunction and ExternalFunction have been modified to actually typecheck ns functions against docs.
* Internal functions are required to use unknown for any params on the inner function.
* Return types for internal function inner-function must match the respective external function.
* Added new typecheck assertion function for asserting dynamic object types, to allow unknownifying params that were previously hardcoded objec structures.
* Because type assertion for parameter types and return types is enforced by InternalAPI, removed all duplicate type declarations on NetscriptFunction params and returns.
2022-10-12 08:49:27 -04:00
Olivier Gagnon
cbb7f58231 Make the main player object an alias, makes it easier to import 2022-10-09 18:42:14 -04:00
Olivier Gagnon
f6f023eeb4 Fix tons of typos 2022-10-09 01:25:31 -04:00
Snarling
16fac67257 fix broken rebase 2022-09-27 16:23:53 -04:00
Snarling
38063f62a7 build fix, lint, remove some instanceof checks 2022-09-27 16:09:32 -04:00
Snarling
e5e6b05be0 format+lint+build fix 2022-09-27 15:35:42 -04:00
Snarling
a21b1029d7 No more player/router context 2022-09-27 15:35:40 -04:00
Snarling
83d357e758 commit1 2022-09-27 15:35:40 -04:00
Duck McSouls
0a644aed58 Typo fix in ns.singularity.workForFaction()
Abbreviation of "you are" is "you're".  Also place a full stop at the end to complete the sentence.  Fixes #4118.
2022-09-23 20:32:53 +10:00
hydroflame
e49bd3d091
Merge branch 'dev' into feature/add-back-api-export 2022-09-23 00:34:19 -03:00
phyzical
4175960fc6
use bitnode multiplers in the output of crime stats 2022-09-20 17:56:05 +08:00