Commit Graph

56 Commits

Author SHA1 Message Date
User670 c93205fec6 MISC: add a missing word in a comment in crime.ts (#1145) 2024-03-08 11:53:14 -08:00
Michael Ficocelli 7ef12a0323 BITNODE: IPvGO territory control strategy game (#934) 2023-12-26 11:45:27 -05:00
Snarling 38f693e2c1 ENUMS: Followup for #859 (#868) 2023-10-17 07:19:32 -04:00
Snarling 6732549196 ENUMS: Initial Enum Helper rework + Reorganization (#596) 2023-06-12 00:34:20 -04:00
Snarling fb1f95c26e VARIOUS: Various changes prior to release 2.2 (#271)
See PR #271 description
2022-12-29 20:28:53 -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 426ad5f296 Sleeve criming fix (#209)
Also simplify usage of findCrime
2022-11-10 11:05:42 -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 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 cbb7f58231 Make the main player object an alias, makes it easier to import 2022-10-09 18:42:14 -04:00
Snarling 50f14b4f58 Commit1 2022-10-03 12:12:16 -04:00
Snarling b364cdf734 Rebase fix, move hasAugmentation to Person 2022-09-27 16:08:52 -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 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
Kelenius e16140fe9c Improvements to crime work UI 2022-08-26 21:03:30 +03:00
Olivier Gagnon 4549b0d467 finish sleeve rework 2022-07-28 02:46:34 -04:00
Olivier Gagnon 326d9fd7ef Move player skills and exp to their struct 2022-07-26 23:54:17 -04:00
Olivier Gagnon d01fd55bde lint fmt 2022-07-21 01:58:47 -04:00
Olivier Gagnon 83c26903c0 add argument for commitCrime focus 2022-07-19 22:30:07 -04:00
Olivier Gagnon 5629c16def extract multipliers in its own type 2022-07-14 18:43:33 -04:00
Olivier Gagnon 0550bc188c refactor some stuff 2022-07-14 17:43:08 -04:00
Olivier Gagnon 28956d8fd6 make crime unfocusable 2022-07-14 15:53:42 -04:00
Olivier Gagnon 3ee7d593d0 Convert crime to new work model 2022-07-07 02:00:23 -04:00
rderfler 77073836cb Merge remote-tracking branch 'upstream/dev' into dev 2022-05-06 22:44:24 -04:00
nickofolas 30d1fe29d7 Format 2022-05-04 15:04:01 -05:00
nickofolas 59982370cb Implement CrimeType enum 2022-05-04 14:48:49 -05:00
rderfler 2613948bad Add bladeburner actions to sleeves
This adds bladeburner actions to sleeves. In addition this bulked out the IPerson functionality and updated bladeburner functions to be more sleeve compatible
2022-04-14 11:40:59 -04:00
BB 0eced1b9f2 Simplified some booleans and if elses 2022-03-08 22:52:26 +01:00
zeddrak 3e9728f4c4 more fix
really can't count...
2022-01-28 10:08:20 -08:00
zeddrak db2369a669 more fix
can't count...
2022-01-28 10:03:40 -08:00
zeddrak 33ed170e29 more fix
two missing ( is better than one...
2022-01-28 10:00:28 -08:00
zeddrak dc8b051bde Fix for Dev not building
It's the little things, like a missing "(", that make programmers happy all day long... >.<
2022-01-28 09:54:35 -08:00
hydroflame a4b8a9ffd5 Update CrimeHelpers.ts 2022-01-27 20:51:48 -05:00
zeddrak 09da6ac63f Make crimes detection a little more friendly
Initially just wanted to change "traffick" to "traffic" (as that supports both the American and British spelling), but then noticed there were a couple of other ones that could be made slightly less restrictive to improve detection. All changes make detection LESS RESTRICTIVE for the player (ie, they have more ways to provide the parameter), none are MORE RESTRICTIVE (ie, won't break any existing code, etc.

Anything that worked before will still work, but now a few things that may not have worked before - like "traffic arms" (without the k), "illegal arms", and "assassin" will work. (Also allowed for the common misspelling of "forgary")
2022-01-27 11:36:06 -08:00
nickofolas ab841f7530 Refactor for ... in loops 2022-01-15 18:45:03 -06:00
Olivier Gagnon 88b4a7d862 bugfix 2021-11-05 17:12:52 -04:00
tyasuh.taeragan@gmail.com da02f8862a Commented Changes 2021-10-16 23:47:11 -04:00
tyasuh.taeragan@gmail.com 2ed961c0d2 #1522 Adressed and Corrected. 2021-10-16 23:09:35 -04:00
Olivier Gagnon 89a6bf175d nuke half the dependencies because they were unused. 2021-10-14 19:31:17 -04:00
Olivier Gagnon 97c04a1037 logbox manager, alert manager and fix bitverse colors 2021-10-01 10:39:09 -04:00
Olivier Gagnon 06f716c0fa moved a bunch of files 2021-09-25 14:42:57 -04:00
Olivier Gagnon b8faa9dc0b convert player to ts 2021-09-23 18:47:43 -04:00
Olivier Gagnon 8db57d7e81 hotfix 2021-09-20 01:45:32 -04:00
Olivier Gagnon 2a13db39c7 fix sleeve memory bug 2021-09-08 23:47:34 -04:00
Olivier Gagnon f7adadd671 Blade action count replenishes more consistently 2021-09-07 13:15:27 -04:00
Olivier Gagnon a18bdd6afc prettify, sorry for the big ass commit 2021-09-04 19:09:30 -04:00
Olivier Gagnon d745150c45 all the lints 2021-05-01 03:17:31 -04:00
Olivier Gagnon 3fad505096 run auto fix lint 2021-04-29 23:52:56 -04:00
hydroflame e572c6dad8 v0.51.0 (#826)
* Hash upgrades and Bladeburner skills can now be clicked to copy to clipboard

* Aug purchase confirmation popup displays money in 0.000a format

* Character now displays hacknet server info properly

* Character,Info now displays hacknet server info correctly.

* Formulas (#825)

Formulas API v0.1

* Make all money the same color, same for reputation, format all numbers consistently.

* rename a lot of the formulas function to no longer contain calculate

* added hacking related formulas

* removed unused variable

* v0.51.0
2021-03-31 00:45:21 -04:00