Commit Graph

32 Commits

Author SHA1 Message Date
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
5fe89d5599
CORPORATION: Reorganize Industry data (#154) 2022-10-24 21:54:54 -04:00
Snarling
124e64379a
Improve unexpected error message (#133)
* Add ws details if available
* Add likely cause of error
* Attempt to display error
2022-10-19 16:32:39 -04:00
omuretsu
7683990d17 format and lint 2022-10-14 11:03:50 -04:00
omuretsu
ad0be471ce fix ns.prompt typechecking
Introduced some new type assertion functions, initial step in larger type safety rework.
2022-10-14 11:00:29 -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
c510e47885 Player is now a Person
Use correct class inheritance, use class as type and remove IPlayer
2022-09-27 15:35:41 -04:00
Snarling
21a2d49de7 Finish removing player passing 2022-09-27 15:35:41 -04:00
Snarling
83d357e758 commit1 2022-09-27 15:35:40 -04:00
Snarling
cc2246213f Add more error types 2022-09-27 15:35:39 -04:00
Snarling
824d8db653 simplify/dehardcode failOnHacknetServer 2022-09-27 15:35:39 -04:00
Snarling
7d37736058 unified errors 2022-09-27 15:35:39 -04:00
Snarling
8d0347577d Less hardcoding 2022-09-27 15:34:48 -04:00
Snarling
572c68738f Unify error handling 2022-09-27 15:34:47 -04:00
Snarling
5798c4c7d3 Unify error handling 2022-09-27 15:32:09 -04:00
hydroflame
2a43b90ed3
Merge pull request #4039 from ezylot/patch-1
GANG: Added weight to GangMemberTask construction call
2022-09-23 01:15:29 -03:00
Olivier Gagnon
2a0dd6b6f8 Minor improvements to Netscript Port loading and unloading 2022-09-22 23:55:16 -04:00
Zoë Hoekstra
55df97d3d5
Format 2022-09-01 16:27:31 +02:00
Zoë Hoekstra
ec81fb60c3
Create ports on demand. Increase max to infinity. 2022-09-01 16:13:10 +02:00
Olivier Gagnon
2675fd23ec fix stack trace missing in some errors 2022-08-29 18:14:54 -04:00
Olivier Gagnon
c9a0998cc1 Improve wrong arg user message and add ui.windowSize 2022-08-29 18:07:17 -04:00
Olivier Gagnon
f07a29c73b fix dynamic ram miscalc not triggering 2022-08-29 15:26:34 -04:00
Snarling
185549e7e4 fix dynamic ram check 2022-08-28 07:44:41 -04:00
Florian Schöffl
0c93764ef8
Added weight to GangMemberTask construction call
Added hackWeight: 100 to GangMember Task construction call to prevent error messages from the constructor checks. 
Since we only compare with roughlyIs() this will have no impact on functionality
2022-08-25 11:08:33 +02:00
Olivier Gagnon
89aa23f4b3 Add dummy function to generate a mock server or player for formulas stuff 2022-08-23 16:01:34 -04:00
Snarling
648b7e84bf Some cleanup 2022-08-09 18:09:26 -04:00
Snarling
931ea730a5 Move entire ns object to top-level 2022-08-09 18:09:26 -04:00
Snarling
589b9df2a7 remove console.logging from roughlyIs 2022-08-09 18:09:26 -04:00
Snarling
01e63b10a1 move ctx.log to NetscriptHelpers 2022-08-09 18:09:26 -04:00
Snarling
208495e269 Initial commit 2022-08-09 18:09:24 -04:00