Commit Graph

171 Commits

Author SHA1 Message Date
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
Snarling
97d679bdac
MISC: Protect against reassigning certain globals (#972) 2023-12-16 05:03:52 -05:00
TheAimMan
5482848eeb
SLEEVE: Add task counter to Crimes and BladeBurner (#930) 2023-12-07 21:24:50 -05:00
Jesse Clark
ecc63eb07e
FACTIONS: Fix for faction names staying scrambled after joining (#968) 2023-12-07 20:53:28 -05:00
Snarling
2997384403
FACTIONS: Followup changes for Rumors PR (#910) 2023-11-02 11:02:12 -04: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
Caldwell
269a74d5c0
CODEBASE: update dependencies (#852) 2023-10-07 18:52:48 -04:00
Jesse Clark
ad6f919d64
CORPORATION: Dramatically lower API RAM costs (#818) 2023-09-27 17:38:30 -04:00
Jesse Clark
3ae3f947ac
CORPORATION: Rework share price calculation + UI improvements (#782) 2023-09-20 00:36:48 -04:00
Yichi Zhang
1b81fe8766
CORPORATION: Rework valuation calculation (#789) 2023-09-19 08:47:16 -04:00
Michael Ficocelli
79b677973b
MESSAGES: Re-implement limit on Icarus messages after a bitnode is completed (#742) 2023-08-28 14:38:15 -04:00
Michael Ficocelli
93235570d0
TERMINAL: Prevent recursive aliases from being resolved. (#741) 2023-08-28 14:26:25 -04:00
Snarling
4ca598defb
API: Fix removed functions (#720) 2023-08-07 02:38:38 -04:00
Caldwell
a85efbc4da
STOCKMARKET: Move and Reorganize Constants (#688) 2023-07-31 22:12:49 -04:00
omuretsu
fc86895c30 Some quick 2.4.0 fixes
* No longer tells player it is a dev version and shows changelog every load
* Updated snapshot for player save format continuity test (changed due to number of donations changing)
* Fixed some display issues surrounding augmentations page (newlines were not displaying in tooltip, and NFG is sorted at the top again)
2023-07-31 04:26:15 -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