Commit Graph

613 Commits

Author SHA1 Message Date
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 c3b2c6396c lint and made a some code more robust to older save file 2022-10-16 14:25:42 -04:00
hydroflame 14914eb190 Merge pull request #4229 from borisflagell/wxsQDSSQF
SLEEVE: Fix #4194 Bladeburner Contract in Sleeve were not giving proper reward.
2022-10-12 23:54:15 -04:00
Jakob002 c2ed9067e0 MISC: message formatting
Replaced someArray.toString() with someArray.join(", "). This will return "foo, bar, baz" (with spaces) instead of "foo,bar,baz" (no spaces).
2022-10-12 15:16:10 +02:00
borisflagell f3becee15b Fix Bladeburner Contract in Sleeve 2022-10-11 15:25:16 +03: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 f6f023eeb4 Fix tons of typos 2022-10-09 01:25:31 -04:00
hydroflame 87ad634859 Merge pull request #4201 from stalefishies/has-augmentation-fix
MISC: Fix bug in person.hasAugmentation
2022-10-09 00:27:05 -04:00
hydroflame c930487c21 Merge pull request #4215 from borisflagell/crime-sleeve
SLEEVE: Fixes 2 issues in Sleeve's implementation of crime work
2022-10-09 00:25:13 -04:00
borisflagell 6d86852969 FIX crime by sleeve
Bitnode multiplier was applied twice in th UI.
Sleeve's multiplier weren't applied (neither in UI, nor engine).
2022-10-08 17:19:20 +03:00
Staszek Welsh ad8c7b7ffe Fix change in behaviour of person.hasAugmentation 2022-10-04 22:55:35 +01: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 a4b7128e6c Sleeve bladeburner fix 2022-09-27 16:36:37 -04:00
Snarling 16fac67257 fix broken rebase 2022-09-27 16:23:53 -04:00
Snarling 25be5c2990 Remove unused augmentationStats interface
All augmentations have all multipliers
2022-09-27 16:20:26 -04:00
Snarling 3d4d02a573 remove unnecessary function 2022-09-27 16:15:11 -04:00
Snarling 38063f62a7 build fix, lint, remove some instanceof checks 2022-09-27 16:09:32 -04:00
Snarling 81412db02e format & lint fix 2022-09-27 16:09:32 -04:00
Snarling b364cdf734 Rebase fix, move hasAugmentation to Person 2022-09-27 16:08:52 -04:00
Snarling 8a9515f154 More classes as types 2022-09-27 16:08:16 -04:00
Snarling 0dbe80a841 Player is now a Person
Use correct class inheritance, use class as type and remove IPlayer
2022-09-27 16:07:58 -04:00
Snarling 6e3a6be106 Remove some redundant typing 2022-09-27 15:35:42 -04:00
Snarling bc7c15ad77 corp: classes are types 2022-09-27 15:35:42 -04:00
Snarling 557bc12562 More classes as types 2022-09-27 15:35:42 -04:00
Snarling 2213d06159 Using bladeburner and action classes as types 2022-09-27 15:35:41 -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 475a8812bb findSleevePurchasableAugs as a class member 2022-09-27 15:35:41 -04:00
Snarling e578bd7681 Remove IPlayer interface
Use PlayerObject instead when referring to the type of "The Player."
2022-09-27 15:35:41 -04:00
Snarling 91a69d7d8f format & lint 2022-09-27 15:35:40 -04:00
Snarling a21b1029d7 No more player/router context 2022-09-27 15:35:40 -04:00
Snarling 83d357e758 commit1 2022-09-27 15:35:40 -04:00
Olivier Gagnon a3c92dd04d Wrap up v2.1.0 2022-09-23 15:00:20 -04:00
Olivier Gagnon 6390f3618e Added few augs 2022-09-23 12:05:16 -04:00
Olivier Gagnon fb197be206 Fix hostname generation being weird about dash 0 added 2022-09-23 12:04:21 -04:00
Mughur 5e0d284cf0 updated sleeve FAQ 2022-09-23 16:01:53 +03:00
Mughur a389974314 Sleeves now only get actual gang's augs 2022-09-23 15:52:04 +03:00
hydroflame 944ee71ab9 Merge pull request #4065 from Snarling/sleeveBladeContractFix
SLEEVES: FIX #4063 fix crash when player tries to assign more than 3 sleeves to Bladeburner contracts
2022-09-23 00:59:46 -03:00
hydroflame 9f922de50d Merge pull request #4101 from Kelenius/UnhardcodeBBAndCorpDisabling
UI: Bitnode stats now show if BB/Corporation are disabled
2022-09-23 00:43:19 -03:00
hydroflame 34534ac282 Merge pull request #4093 from coderanger/sleeve-heal
SLEEVES: FIX #3819 Allow using the regeneration chamber with sleeves to heal them.
2022-09-23 00:33:16 -03:00
Mughur 75c738cdb0 Fixed NMI aug having effect before installing 2022-09-14 20:54:03 +03:00
Kelenius 5350e1c3e9 Unhardcoded BN8 BB check; show if corp/BB are disabled in BN stats 2022-09-12 17:48:52 +03:00
Noah Kantrowitz e4961f452e ✏️ Copy paste typo. 2022-09-10 17:52:06 -07:00
Noah Kantrowitz 232dcab5cd Reset sleeves to max HP when starting a new node. 2022-09-10 17:44:50 -07:00
Noah Kantrowitz 596a04515d Allow using the regeneration chamber with sleeves to heal them.
This also allows using sleeves to generate stamina faster even if at full HP.
2022-09-10 17:39:40 -07:00
Snarling e8c8bb76ff Don't let sleeve start invalid contract 2022-08-30 09:26:24 -04:00
Olivier Gagnon c88ac1c26e fix some stuff with the timestamp settings 2022-08-29 16:47:51 -04:00
hydroflame 44ab53653f Merge pull request #4041 from Mughur/sleeve
SLEEVE: FIX #4022, #4024, #4025, #3998
2022-08-29 11:18:01 -03:00
Olivier Gagnon 0942b7b6ee minor fix in instance calculation 2022-08-29 10:06:20 -04:00