Commit Graph

123 Commits

Author SHA1 Message Date
Snarling d7193ca8ff fix negative time display (#153) 2022-10-24 20:09:10 -04: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
Olivier Gagnon af1a1ac58d Rename lots of reference from old to new repo 2022-10-20 03:56:59 +11:00
omuretsu 9908f4aaa5 Error message fixes 2022-10-14 11:08:24 -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 068533cd2f format, lint, more enums, revert fn rename 2022-10-05 14:52:48 -04:00
Snarling aa80cf6451 See description
Reverted ToastVariant back to an enum internally. Still exposed to player as just possible strings.
Changed all 1-line documentation comments to actually be 1-line. Moved some because they were not providing documentation for the thing they were trying to.
2022-10-04 06:40:10 -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
LJNeon b1c5ddb211 chore(ns.tFormat): Remove incorrectly placed 's' 2022-09-23 07:59:50 -07:00
Olivier Gagnon fde4e7ac38 fix 2962 2022-09-23 00:13:06 -04:00
Snarling b700b0246b Fix contract input handling 2022-08-02 11:11:49 -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 65400dd215 v2apibreak work on .script better 2022-07-27 00:28:32 -04:00
Olivier Gagnon 326d9fd7ef Move player skills and exp to their struct 2022-07-26 23:54:17 -04:00
Olivier Gagnon e6d14eff68 preparation for v2 launch 2022-07-26 15:09:11 -04:00
Olivier Gagnon 214b2645ad allbuild commit 8afacee9 2022-07-26 10:41:04 -04:00
hydroflame 9e25833796 Merge pull request #3606 from RevanProdigalKnight/feature/enhanced-terminal-argument-parsing
MISC: #3596 Enhanced terminal command parsing
2022-07-21 18:36:54 -04:00
hydroflame a48ae726ba Merge pull request #3778 from s2ks/hamming
CODINGCONTRACT: HammingCodes description and implementation fixes
2022-07-21 02:16:35 -04:00
Olivier Gagnon 71d8e35bb5 more anys 2022-07-19 23:26:21 -04:00
Olivier Gagnon f220965a73 more anys 2022-07-19 22:54:38 -04:00
Olivier Gagnon 83c26903c0 add argument for commitCrime focus 2022-07-19 22:30:07 -04:00
Olivier Gagnon bb8af88b77 prep v2 2022-07-19 14:21:12 -04:00
Olivier Gagnon 4bee746576 rm any 2022-07-15 01:51:30 -04:00
Olivier Gagnon c9432e4cd7 rm any 2022-07-14 21:54:49 -04:00
Olivier Gagnon 6b630753f0 nuke some use of any 2022-07-14 19:00:10 -04:00
Olivier Gagnon 0550bc188c refactor some stuff 2022-07-14 17:43:08 -04:00
Olivier Gagnon f7805c4a51 convert faction work to new work system 2022-07-12 01:54:19 -04:00
s2ks b27e7d00fe format 2022-07-08 01:37:42 +02:00
s2ks f066c0f01e correct size calculation 2022-05-28 15:27:32 +02:00
s2ks c88d3bcf85 format 2022-05-27 22:37:32 +02:00
s2ks aa321e3305 re-implement HammingEncode/Decode added HammingEncodeProperly
to generate valid hamming codes for "HammingCodes: Encoded Binary to
Integer"
2022-05-27 21:42:39 +02:00
Olivier Gagnon ca2e22506b more lint 2022-05-25 15:40:57 -04:00
Olivier Gagnon c1650e332b lint fixes 2022-05-25 15:08:48 -04:00
Olivier Gagnon 76ccb0ba36 lint 2022-05-25 11:43:43 -04:00
rderfler 77073836cb Merge remote-tracking branch 'upstream/dev' into dev 2022-05-06 22:44:24 -04:00
nickofolas 7d75093989 Init work types with new None member 2022-05-04 15:03:02 -05:00
nickofolas f45200b25e Implement ClassType and FactionWorkType enums 2022-05-04 14:18:12 -05:00
nickofolas 4a8e99b170 Refactor WorkType to an enum 2022-05-04 13:42:48 -05:00
hydroflame a3fe965771 Merge pull request #3572 from Undeemiss/exception-typo
MISC: Fixed typo in exceptionAlert.ts
2022-05-04 11:58:27 -04:00
hydroflame 7e5ab8d9a6 Merge pull request #3581 from stalefishies/compression-contract-fix
BUGFIX: Handle edge case in LZ compression code and fix docs
2022-05-04 11:53:29 -04:00
RevanProdigalKnight df30771744 Add =
Adds the equal sign (`=`) for use in `src/Terminal/Parser.ts`
2022-05-04 00:47:58 -06:00
Zoë Hoekstra 016a9a873f Add keycode table and switch to event.code in select places 2022-05-03 15:59:46 +02:00
rderfler 7cf21629a7 Address review
Add ns function setToBladeburnerAction
Formatting updates
fix sleeves using player stamina
Correct supporting sleeve causing error
2022-04-30 15:25:36 -04:00
Staszek Welsh 55d9810727 Handle edge case in LZ compression code and fix docs 2022-04-28 19:50:17 +01:00
Undeemiss 138a945707 Fixed typo in exceptionAlert.ts 2022-04-27 18:45:25 -05:00