Commit Graph

131 Commits

Author SHA1 Message Date
Snarling
b4074328ec
UI: Added new locale-aware and configurable number formatting (#354) 2023-02-11 13:18:50 -05:00
Zelow79
5f923a348c
NETSCRIPT: Added cyclesWorked to certain sleeve.getTask returns, and added bladeburner.getActionSuccesses (#324) 2023-01-15 23:50:54 -05:00
David Walker
7b5080a42b
NETSCRIPT: Add undocumented function printRaw() (#277)
This is analagous to tprintRaw (enabled by ns.iKnowWhatImDoing()), but
for logs instead of the terminal. This provides a supported* method of
creating complicated UIs for scripts.

*No actual support, expressed or implied, is provided for use of this
function.
2023-01-05 20:30:34 -05:00
Snarling
31bf0c43d1 v2.2.1 (#293)
* handle enums differently
* Enums are frozen and fed directly to the proxy
* Enums are not included in the NSFull definition, allowing samekeys for RamCostTree<API>, InternalAPI<API>, and ExternalAPI<API>
* Rewrote a lot of the ramcalc test, with better typing thanks to the samekeys above
* Fix ns1 for proxy (args, pid, and enums after above changes were not being added to ns1 scripts.)
* Fixed an overview issue where the bars could display inaccurately.
Update changelog and bump version to 2.2.1
2023-01-04 09:45:17 -05:00
omuretsu
bb566dc57c hotfix
* Fix ramcost for corporation.bonusTime (must be 0 because other getBonusTime functions exist).
* Fix ui hook names for overview.
2023-01-03 12:23:38 -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
Mughur
5c80655d62
NETSCRIPT: Added ns.corporation.issueNewShares function (#261) 2022-12-25 03:35:18 -05:00
Mughur
556fe8dd33
NETSCRIPT: Added ns.corporation.getConstants, replacing many other corporation getter functions (#260) 2022-12-25 03:33:13 -05:00
David Walker
018053d79e
NETSCRIPT: Reduce cost of two multipliers functions (#254) 2022-12-21 18:30:27 -05:00
omuretsu
1dec0d00bd Add documentation for ns.pid 2022-12-13 09:09:12 -05:00
Snarling
0fb7200b4b
STOCK: ns.stock.getOrganization added for getting org from stock symbol (#234)
Authored-by: SamuraiNinjaGuy <branmiller+bitburner@gmail.com>
2022-11-28 10:33:28 -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
b275f88053
NETSCRIPT: Expose more enums for player use (#198)
* Add support for enums at other ns layers
* APIWrapper: simplified wrapping algorithm and modified to just use cloneDeep to copy enums instead of recursively wrapping enums as if they were new API layers
* Improve APIWrapper typing
* Changed some typings at RamCostGenerator to allow for enums at different levels without enums needing a ram cost
* Added enums to ns.corporation, removed getter functions that were being used instead.
* Add FactionWorkType for player use
* Add ClassType and CompanyWorkPos enums
* Change netscriptDefinitions to expect members of these new enums where appropriate.
2022-11-09 13:46:21 -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
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
5fe89d5599
CORPORATION: Reorganize Industry data (#154) 2022-10-24 21:54:54 -04:00
Snarling
0a3ff56331
WIP: Remove corp employees as objects (#143)
* Removed employees as objects from corporations
* Remove employees from office JSON after loading / convert to new parameters
* Showed down morale/etc gain; added optional position to hireEmployee
* enum support for corp employee positions

Mostly authored-by: Kelenius <kelenius@ya.ru>
2022-10-24 08:44:01 -04:00
Olivier Gagnon
ae5fc168bf Add getMoneySources 2022-10-13 00:10:59 -04:00
omuretsu
41b6f0b87b add hoop before exposing 2022-10-11 21:02:04 -04:00
omuretsu
7d07f44b3e move to global scope 2022-10-11 20:01:10 -04:00
omuretsu
84b99c569a extra printRaw function 2022-10-11 16:07:45 -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
f4668b21ca functions to generate dummy contracts 2022-10-09 02:56:11 -04:00
Olivier Gagnon
5d4b72e1d1 Added some purchased server functions 2022-10-09 02:32:13 -04:00
Snarling
068533cd2f format, lint, more enums, revert fn rename 2022-10-05 14:52:48 -04:00
Snarling
8bb88a5080 Better RamCost testing (see desc)
* RamCostGenerator will have an error if ramcosts are defined for nonexistent functions, in addition to error if not all functions have ram costs defined
* Removed a few random blank comment lines in NetscriptDefinitions.d.ts
* RamCalculation.test.ts checks exact expected static and dynamic ram usage from (almost) every function, based on defined RamCosts in RamCostGenerator.
2022-10-05 10:42:07 -04:00
Snarling
50f14b4f58 Commit1 2022-10-03 12:12:16 -04:00
Snarling
572c68738f Unify error handling 2022-09-27 15:34:47 -04:00
phyzical
ca2f1a62a5
add singularity function for exporting game save 2022-09-07 16:11:51 +08:00
Olivier Gagnon
c9a0998cc1 Improve wrong arg user message and add ui.windowSize 2022-08-29 18:07:17 -04: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
Olivier Gagnon
a8bef50ef5 Added a few formulas to calculate work gains 2022-08-17 14:32:52 -04:00
Snarling
ea7c2c4981 fixing other commits after rebase 2022-08-09 18:25:02 -04:00
Olivier Gagnon
07c7f0641a allbuild commit c8440ef2 2022-07-28 14:35:55 -04:00
Olivier Gagnon
4549b0d467 finish sleeve rework 2022-07-28 02:46:34 -04:00
Olivier Gagnon
3e4f26ac0a allbuild commit e6d14eff 2022-07-26 15:30:12 -04:00
Olivier Gagnon
2d522ea1e6 allbuild commit e9254edf 2022-07-21 15:09:55 -04:00
Olivier Gagnon
693baf26df add sleeve aug price and rep function 2022-07-21 02:42:48 -04:00
Olivier Gagnon
43b8cfec5c fix test suite 2022-07-21 02:13:47 -04:00
Olivier Gagnon
ef42ee7232 few more api break 2022-07-20 17:03:08 -04:00
Olivier Gagnon
4518eabc29 Remove some any and add getAugmentationBasePrice 2022-07-20 01:20:11 -04:00
Olivier Gagnon
70d5390e4d most anys in NetFunc 2022-07-19 19:04:06 -04:00
Olivier Gagnon
ae38b11ede made static ram cost typecheck that it's missing no property. 2022-05-24 18:34:00 -04:00
Olivier Gagnon
0da2e74d12 more work on wrapping formulas 2022-05-24 17:51:48 -04:00
hydroflame
570c6d6b32
Merge pull request #3702 from borisflagell/FIX#3508
BLADEBURNER: FIX #3508 Add GetActionCurrentTime() to Bitburner API
2022-05-23 12:21:27 -04:00
PathToLife
3f1cb27ec1
Add tprintf to RamCostGenerator 2022-05-23 19:57:23 +12:00
borisflagell
8e0af049d9 BLADEBURNER: FIX #3508 Add GetActionCurrentTime() to Bitburner API
Add GetActionCurrentTime() to Bitburner API.
Slightly tweak BItburner.resetAction() to also reset time counters.
2022-05-22 06:40:08 +02:00
Stephen Reindl
35978689f9
Fix #3690 by adding missing function RamCostGenerator 2022-05-21 17:24:20 +02:00
Olivier Gagnon
7eb4494ac1 fix mc 2022-05-20 15:58:33 -04:00