Currently, the HTML line break sequence `<br /><br />` is hardcoded into the dialog box message when showing the content of these file types: ".js", ".script", and ".txt". By default, the function `dialogBoxCreate()` currently assumes that its first parameter is not HTML, but a text string, so whatever is in the string will appear in the dialog box. Use the newline character instead for line break.
* DOC: `ns.singularity.workForFaction()`: update doc and examples
* Additional Doc Fixes
* Remove unnecessary fluff in singularity.workForFaction examples
* Fix documentation for singularity.workForCompany similar to fixes already applied to workForFaction
* Correct some inaccuracies in workForFaction and workForCompany remarks sections
* Shorten some comment lines that are over 120 characters in NetscriptDefinitions.d.ts, for consistency.
Co-authored-by: Duck McSouls <quacksouls@gmail.com>
* purchasedByPlayer allows connect-from-anywhere as if the server was backdoored.
* Also added optional backdoorInstalled variable to type for BaseServer. This has no runtime effect, but it allows accessing that variable without TS needing us to verify whether it's instanceof Server first.
* A bunch of typographical fixes in the documentation of various Netscript functions. A main fix is standardizing the use of "hostname".
* Cross-reference the documentation of various Netscript functions. This makes it clear that we are referring to a particular Netscript function.
* Clarify the return values of various Netscript functions. Clarify the documentation of other functions.
* Removed employees as objects from corporations
* Remove employees from office JSON after loading / convert to new parameters
* Showed down morale/etc gain; added optional position to hireEmployee
* enum support for corp employee positions
Mostly authored-by: Kelenius <kelenius@ya.ru>
* 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