Commit Graph

137 Commits

Author SHA1 Message Date
catloversg
8c4fcfe045
CODEBASE: Recheck all usages of typecasting with JSON.parse (#1775) 2024-11-20 23:47:02 -08:00
catloversg
97ca8c5f5e
CODEBASE: Fix lint errors 4 (#1773)
Co-authored-by: Michael Ficocelli <ficocemt@gmail.com>
2024-11-14 07:47:35 -08:00
catloversg
246d668951
CORPORATION: Rewrite validation code for strings of price and quantity (#1753) 2024-11-12 07:39:21 -08:00
catloversg
772762493f
BLADEBURNER: Change sleeveSize from property to getter (#1746) 2024-11-03 23:19:01 -08:00
catloversg
b01527a9dc
MISC: Update blood donation (#1736) 2024-10-27 18:40:23 -07:00
Michael Ficocelli
6df3dcdc82
IPVGO: Add optional board state argument to the go analysis functions (#1716) 2024-10-27 17:31:06 -07:00
Denis Čahuk
8d1cfb2d97
BLADEBURNER: Test cover action completion (#1695) 2024-10-21 20:33:56 -07:00
catloversg
cace34d759
BUGFIX: Wrong calculation in team casualties of Bladeburner action (#1672) 2024-10-07 23:55:11 -07:00
Denis Čahuk
6c81e1ac67
BLADEBURNER: test cover console commands (#1664) 2024-09-25 16:06:46 -07:00
Denis Čahuk
b86044bcc1
BLADEBURNER: Move bladeburner team losses to Casualties (#1654) 2024-09-23 17:03:01 -07:00
Denis Čahuk
cde5e3f6ae
MISC: Refactor BLADEBURNER Identifier Lookup (#1646) 2024-09-14 17:39:18 -07:00
Marvin Sautter
3d7a6f70d8
JEST: Test faster by removing barrels (#1645) 2024-09-09 18:36:00 -07:00
Marvin Sautter
dd59612121
JEST: Decrease frequency of random Bladeburner Tests by ~59% for improved performance (#1648) 2024-09-09 18:33:37 -07:00
Yichi Zhang
028e779602
NETSCRIPT: Don't make dynamicLoadedFns entries for free functions. (#1617) 2024-08-23 21:23:41 -07:00
catloversg
818d7446be
MISC: Rename getRandomArbitrary (#1605) 2024-08-21 16:50:51 -07:00
catloversg
cacecda72f
API: Add types for parameters of gym-university-bladeburner API (Fix merging error) (#1596)
* API: Add types for parameters of gym-university-bladeburner API
* Fix merging error
2024-08-17 14:08:55 -07:00
David Walker
34db6e8b26
NETSCRIPT: Rework disableLog for efficiency (#1589)
The current implementation was naive; disableLog("ALL") was storing a
key for every function, and iterating over a different object to do it
(when iterating over objects is quite slow).

The common cases of Bitburner (and especially batching, where efficiency
matters most) are either never disabling anything, or disabling "ALL".
This optimizes for these two cases, at the expense of slightly more
complicated code to deal with the less-common edge cases.
2024-08-16 19:10:20 -07:00
catloversg
289f60d8c8
BLADEBURNER: Add API to calculate max upgrade count of skill (#1475) 2024-08-16 13:15:20 -07:00
catloversg
864613c616
MISC: Support JSX, TS, TSX script files (#1216) 2024-07-14 14:47:10 -07:00
catloversg
783120c886
FEATURE: BitNode options (#1411) 2024-07-14 14:30:30 -07:00
David Walker
06553d9700
BUGFIX: Fix "Router called before initialization" race (#1474)
If the game takes long enough to load, certain counters can become
eligible to run as soon as Engine.start() runs. When this happens,
eventually Router.page() is called, which throws an Error since Router
isn't initialized yet. (Dropping a breakpoint before Engine.start() and
waiting at least 30 seconds is enough to reliably repro, but I have seen
this both live and in tests.)

This fixes it so that Router.page() is valid immediately, returning a
value of Page.LoadingScreen. It also removes the isInitialized field,
since this is now redundant. Trying to switch pages is still an error,
but that doesn't happen without user input, whereas checking the current
page is quite common.

This also consolidates a check for "should we show toasts" behind a
function in Router, making the logic central and equal for a few
usecases. This means (for instance) that the "autosave is disabled"
logic won't run during infiltration. (The toast should have already been
suppressed.)
2024-07-07 22:13:37 -07:00
Tom Prince
b277975656
EDITOR: Provide type definitions for React and ReactDOM in in-game editor. (#1458)
* Fix the type declaration of `!!raw-loader!` modules.

Instead of declaring them to export an object with a single key
`default` which is a string, the modules have a default export, which
is a string.

Note, that this doesn't actually change the generated code, just the
types that typescript sees. The code worked before because the only
thing done to the values was to coerce the values to a string, which
turned into a no-op.

* Switch from using `raw-loader` to using a source asset module.

`raw-loader` was deprecated in webpack v5.
2024-07-07 00:08:33 -07:00
David Walker
1f2e69631e
EDITOR: Use ramOverride() to set compiled script RAM (#1446)
To use this, add a line like "ns.ramOverride(2);" as the first statement
in main(). Not only will it take effect at runtime, but it will now
*also* be parsed at compile time, changing the script's static RAM
limit. Since ns.ramOverride is a 0-cost function, the call to it on
startup then becomes a no-op.

This is an often-requested feature, and allows for scripts to set their
usage without it needing to be explicitly mentioned via args or options
when being launched. This also reduces pressure on the static RAM
analysis to be perfect all the time. (But certain limits, such as
"functions names must be unique across namespaces," remain.)

This also adds a tooltip to the RAM calculation, to make this slightly
discoverable.
2024-07-05 17:32:46 -07:00
Michael Ficocelli
481938a2fb
IPVGO: Balance and improvements for offline bonus time cycles (#1356) 2024-06-05 19:39:22 -07:00
Michael Ficocelli
cf48d666f5
IPVGO: Add history, and details to status, to go API (#1348) 2024-06-05 18:24:48 -07:00
Michael Ficocelli
bd5c502f53
IPVGO: Support bonus cycles from offline time (#1345) 2024-06-04 18:43:29 -07:00
Michael Ficocelli
d9f04203cf
IPVGO: Record full history to avoid infinite ko capture loops on larger boards (#1299) 2024-06-02 20:19:26 -07:00
Caldwell
f40d4f8e92
BUGFIX: fix relative imports (#1305)
Relative paths work in imports, at last.
2024-06-02 17:38:01 -07:00
catloversg
c2a56a6150
MISC: Refactor favor code (#1321) 2024-05-28 12:04:16 -07:00
catloversg
25afecc0ec
CORPORATION: Rename functions in Actions.ts (#1272)
This should be a straight rename, no functionality changes.
2024-05-12 14:52:07 -07:00
catloversg
eba86e4bf0
BUGFIX: Fix #997 (#1226) 2024-04-23 20:05:24 -04:00
Michael Ficocelli
6c9555ba32
IPVGO: Tweak cheat success scaling so it is applicable even to endgame stats (#1194) 2024-03-30 16:22:53 -07:00
Snarling
6669c4da6a
BLADEBURNER: Typesafety / refactoring (#1154) 2024-03-28 21:52:37 -04:00
Michael Ficocelli
fe87f1f628
IPVGO: Bugfixes (#1193)
* IPVGO: Explicitly link the generated API documentation in the algorithm design doc
* IPVGO: Fix missing factions in netscript docs
* IPVGO: Linting
* IPVGO: Ensure resetBoardState() logs that a new game has started
2024-03-27 22:02:53 -07:00
catloversg
8553bcb8fc
MISC: Support compression of save data (#1162)
* Use Compression Streams API instead of jszip or other libraries.
* Remove usage of base64 in the new binary format.
* Do not convert binary data to string and back. The type of save data is SaveData, it's either string (old base64 format) or Uint8Array (new binary format).
* Proper support for interacting with electron-related code. Electron-related code assumes that save data is in the base64 format.
* Proper support for other tools (DevMenu, pretty-save.js). Full support for DevMenu will be added in a follow-up PR. Check the comments in src\DevMenu\ui\SaveFileDev.tsx for details.
2024-03-27 21:08:09 -07:00
Michael Ficocelli
d8de22a273
IPVGO: Nerf overly-difficult handicap, [issue #1169] misc bugfixes (#1188)
* IPVGO: Nerf overly-difficult handicap on 5x5 board

* IPVGO: Tweak 5x5 handicap
2024-03-25 16:12:35 -07:00
adeilt
08097aaf09
CORPORATION: more granular office size upgrades (#1179)
Allows corporation.upgradeOfficeSize to increase the size of a Corporation office by a non-multiple of 3 and also be charged a corresponding amount of corporate funds. See #1166 for details of current behavior.
2024-03-24 17:37:08 -07:00
Michael Ficocelli
1e5f7184a2
IPVGO: Remove current game history from savefile, re-implement superko (#1175) 2024-03-20 20:37:20 -04:00
Michael Ficocelli
d81358c80f
IPVGO: Add support to netscript API for game state, current player, and alternate ways to check/wait on AI turn (#1142) 2024-03-19 14:07:15 -04:00
Michael Ficocelli
c703b71871
IPVGO: Ensure that the player has the prerequisites to face the secret opponent (#1157) 2024-03-11 12:57:44 -04:00
Snarling
e9d1ddfaf3
SAVEGAME: Reduce size of savefile (#1148)
Storing less info in the save for Factions/Companies if it's still the default info
2024-03-11 08:58:10 -04:00
Michael Ficocelli
1547581c24
IPVGO: Fix self-capture move evaluation (#1140) 2024-03-06 16:23:16 -05:00
Shy
4aaf845fca
API: make ns.atExit add the callback to an array instead of setting it (#1059) 2024-03-05 19:22:45 -05:00
hydroflame
483d554fc2
MISC: Update donation counter (#1118) 2024-02-26 09:42:31 -05:00
Snarling
91105c6d8c
TESTS: Prevent some test spam (#1126) 2024-02-26 08:22:33 -05:00
Snarling
373ced2efe
GO: Various changes before 2.6.0 (#1120) 2024-02-26 08:05:10 -05:00
Caldwell
84c4dba1e2
UI: fix scripts recorded offline income (#1025) 2024-02-10 07:24:55 -05:00
David Walker
55e21d1e19
Make grow formulas faster and more accurate. (#1044) 2024-01-31 19:27:31 -05:00
deansvendsen
cb7c75a3ce
MISC: Gang Expenses category in MoneySource (#1043) 2024-01-23 18:18:56 -05:00
Michael Ficocelli
7ef12a0323
BITNODE: IPvGO territory control strategy game (#934) 2023-12-26 11:45:27 -05:00