Changed Sleeve API functions to prevent conflicts with identically-named functions

This commit is contained in:
danielyxie 2019-03-17 22:04:12 -07:00
parent 066ccf343a
commit c3bc6a0c28
29 changed files with 199 additions and 151 deletions

@ -14,6 +14,8 @@ Sleeve technology unlocks two different gameplay features:
Sleeve technology is unlocked in :ref:`BitNode-10 <gameplay_bitnodes>`. Sleeve technology is unlocked in :ref:`BitNode-10 <gameplay_bitnodes>`.
.. _gameplay_duplicatesleeves:
Duplicate Sleeves Duplicate Sleeves
^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^
Duplicate Sleeves are MK-V Synthoids (synthetic androids) into which your consciuosness Duplicate Sleeves are MK-V Synthoids (synthetic androids) into which your consciuosness
@ -28,6 +30,19 @@ Sleeves are their own individuals, which means they each have their own experien
When a sleeve earns experience, it earns experience for itself, the player's When a sleeve earns experience, it earns experience for itself, the player's
original consciousness, as well as all of the player's other sleeves. original consciousness, as well as all of the player's other sleeves.
Duplicate Sleeves are **not** reset when installing Augmentations, but they are reset
when switching BitNodes.
Obtaining Duplicate Sleeves
~~~~~~~~~~~~~~~~~~~~~~~~~~~
There are two methods of obtaining Duplicate Sleeves:
1. Destroy BitNode-10. Each completion give you one additional Duplicate Sleeve
2. Purchase Duplicate Sleeves from :ref:`the faction The Covenant <gameplay_factions>`.
This is only available in BitNodes-10 and above, and is only available after defeating
BitNode-10 at least once. Sleeves purchased this way are **permanent** (they persist
through BitNodes). You can purchase up to 5 Duplicate Sleeves from The Covenant.
Synchronization Synchronization
~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~
Synchronization is a measure of how aligned your consciousness is with that of your Synchronization is a measure of how aligned your consciousness is with that of your
@ -50,15 +65,20 @@ no shock. Shock affects the amount of experience earned by the sleeve.
Sleeve shock slowly decreases over time. You can further increase the rate at which Sleeve shock slowly decreases over time. You can further increase the rate at which
it decreases by assigning sleeves to the 'Shock Recovery' task. it decreases by assigning sleeves to the 'Shock Recovery' task.
Obtaining Duplicate Sleeves Augmentations
~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~
There are two methods of obtaining Duplicate Sleeves: You can purchase :ref:`Augmentations <gameplay_augmentations>` for your Duplicate
Sleeves. In order to do this, the Sleeve's Shock must be at 0. Any Augmentation
that is currently available to you through a faction is also available for your
Duplicate Sleeves. There are a few Augmentations, such as NeuroFlux Governor and
Bladeburner-specific ones, that cannot be purchased for a Duplicate Sleeve.
1. Destroy BitNode-10. Each completion give you one additional Duplicate Sleeve When you purchase an Augmentation for a Duplicate Sleeve, it is instantly installed.
2. Purchase Duplicate Sleeves from :ref:`the faction The Covenant <gameplay_factions>`. When this happens, the Sleeve's stats are instantly reset back to 0, similar to
This is only available in BitNodes-10 and above, and is only available after defeating when you normally install Augmentations.
BitNode-10 at least once. Sleeves purchased this way are permanent. You can purchase
up to 5 Duplicate Sleeves from The Covenant. The cost of purchasing an Augmentation for a Duplicate Sleeve is **not** affected
by how many Augmentations you have purchased for yourself, and vice versa.
Re-sleeving Re-sleeving
^^^^^^^^^^^ ^^^^^^^^^^^

@ -64,9 +64,9 @@ documentation_title = '{0} Documentation'.format(project)
# built documents. # built documents.
# #
# The short X.Y version. # The short X.Y version.
version = '0.44' version = '0.45'
# The full version, including alpha/beta/rc tags. # The full version, including alpha/beta/rc tags.
release = '0.44.1' release = '0.45.0'
# The language for content autogenerated by Sphinx. Refer to documentation # The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages. # for a list of supported languages.

@ -4,6 +4,8 @@ Netscript Advanced Functions
These Netscript functions become relevant later on in the game. They are put on a separate page because These Netscript functions become relevant later on in the game. They are put on a separate page because
they contain spoilers for the game. they contain spoilers for the game.
.. warning:: This page contains spoilers for the game
.. toctree:: .. toctree::
getBitNodeMultipliers() <advancedfunctions/getBitNodeMultipliers> getBitNodeMultipliers() <advancedfunctions/getBitNodeMultipliers>

@ -7,7 +7,7 @@ Netscript provides the following API for interacting with the game's Bladeburner
The Bladeburner API is **not** immediately available to the player and must be unlocked The Bladeburner API is **not** immediately available to the player and must be unlocked
later in the game later in the game
**WARNING: This page contains spoilers for the game** .. warning:: This page contains spoilers for the game
The Bladeburner API is unlocked in BitNode-7. If you are in BitNode-7, you will The Bladeburner API is unlocked in BitNode-7. If you are in BitNode-7, you will
automatically gain access to this API. Otherwise, you must have Source-File 7 in automatically gain access to this API. Otherwise, you must have Source-File 7 in

@ -6,7 +6,7 @@ Netscript provides the following API for interacting with the game's Gang mechan
The Gang API is **not** immediately available to the player and must be unlocked The Gang API is **not** immediately available to the player and must be unlocked
later in the game later in the game
**WARNING: This page contains spoilers for the game** .. warning:: This page contains spoilers for the game
The Gang API is unlocked in BitNode-2. Currently, BitNode-2 is the only location The Gang API is unlocked in BitNode-2. Currently, BitNode-2 is the only location
where the Gang mechanic is accessible. This may change in the future where the Gang mechanic is accessible. This may change in the future

@ -9,7 +9,7 @@ and creating programs.
The Singularity Functions are **not** immediately available to the player and must be unlocked later in the game. The Singularity Functions are **not** immediately available to the player and must be unlocked later in the game.
**WARNING: This page contains spoilers for the game**. .. warning:: This page contains spoilers for the game
The Singularity Functions are unlocked in BitNode-4. If you are in BitNode-4, then you will automatically have access to all of these functions. The Singularity Functions are unlocked in BitNode-4. If you are in BitNode-4, then you will automatically have access to all of these functions.
You can use the Singularity Functions in other BitNodes if and only if you have the Source-File for BitNode-4 (aka Source-File 4). Each level of You can use the Singularity Functions in other BitNodes if and only if you have the Source-File for BitNode-4 (aka Source-File 4). Each level of

@ -2,12 +2,13 @@
Netscript Sleeve API Netscript Sleeve API
========================= =========================
Netscript provides the following API for interacting with the game's Sleeve mechanic. Netscript provides the following API for interacting with the game's
:ref:`Duplicate Sleeve <gameplay_duplicatesleeves>` mechanic.
The Sleeve API is **not** immediately available to the player and must be unlocked The Sleeve API is **not** immediately available to the player and must be unlocked
later in the game. later in the game.
**WARNING: This page contains spoilers for the game** .. warning:: This page contains spoilers for the game
The Sleeve API is unlocked in BitNode-10. If you are in BitNode-10, you will The Sleeve API is unlocked in BitNode-10. If you are in BitNode-10, you will
automatically gain access to this API. Otherwise, you must have Source-File 10 in automatically gain access to this API. Otherwise, you must have Source-File 10 in
@ -26,40 +27,50 @@ In :ref:`netscriptjs`::
ns.sleeve.commitCrime(0, "shoplift"); ns.sleeve.commitCrime(0, "shoplift");
.. toctree:: .. toctree::
:caption: Functions: :caption: API Functions:
commitCrime() <sleeveapi/commitCrime>
getNumSleeves() <sleeveapi/getNumSleeves> getNumSleeves() <sleeveapi/getNumSleeves>
getTask() <sleeveapi/getTask> getSleeveStats() <sleeveapi/getSleeveStats>
synchronize() <sleeveapi/synchronize>
travel() <sleeveapi/travel>
workForFaction() <sleeveapi/workForFaction>
getInformation() <sleeveapi/getInformation> getInformation() <sleeveapi/getInformation>
getStats() <sleeveapi/getStats> getTask() <sleeveapi/getTask>
shockRecovery() <sleeveapi/shockRecovery> setToShockRecovery() <sleeveapi/setToShockRecovery>
takeUniversityCourse() <sleeveapi/takeUniversityCourse> setToSynchronize() <sleeveapi/setToSynchronize>
workForCompany() <sleeveapi/workForCompany> setToCommitCrime() <sleeveapi/setToCommitCrime>
workoutAtGym() <sleeveapi/workoutAtGym> setToFactionWork() <sleeveapi/setToFactionWork>
setToCompanyWork() <sleeveapi/setToCompanyWork>
setToUniversityCourse() <sleeveapi/setToUniversityCourse>
setToGymWorkout() <sleeveapi/setToGymWorkout>
travel() <sleeveapi/travel>
.. _netscript_sleeveapi_referencingaduplicatesleeve:
Referencing a Duplicate Sleeve
------------------------------
Most of the functions in the Sleeve API perform an operation on a single Duplicate
Sleeve. In order to specify which Sleeve the operation should be performed on,
a numeric index is used as an identifier. The index should follow array-notation, such
that the first Duplicate Sleeve has an index of 0, the second Duplicate Sleeve has
an index of 1, and so on.
The order of the Duplicate Sleeves matches the order on the UI page.
Examples Examples
-------- --------
**Basic example usage**:: **Basic example usage**::
for(let i = 0; i < sleeve.getNumSleeves(); i++) { for (var i = 0; i < sleeve.getNumSleeves(); i++) {
sleeve.shockRecovery(i); sleeve.shockRecovery(i);
} }
await sleep(10*60*60); // wait 10h sleep(10*60*60); // wait 10h
for(let i = 0; i < sleeve.getNumSleeves(); i++) { for (var i = 0; i < sleeve.getNumSleeves(); i++) {
sleeve.synchronize(i); sleeve.synchronize(i);
} }
await sleep(10*60*60); // wait 10h sleep(10*60*60); // wait 10h
for(let i = 0; i < sleeve.getNumSleeves(); i++) { for (var i = 0; i < sleeve.getNumSleeves(); i++) {
sleeve.commitCrime(i, 'shoplift'); sleeve.commitCrime(i, 'shoplift');
} }

@ -1,11 +0,0 @@
commitCrime() Netscript Function
=======================================
.. js:function:: commitCrime(sleeveNumber, name)
:param int sleeveNumber: index of the sleeve to start commiting crime.
:param string name: Name of the crime. Must be an exact match.
Return a boolean indicating whether or not this action was set successfully.
Returns false if an invalid action is specified.

@ -3,7 +3,7 @@ getInformation() Netscript Function
.. js:function:: getInformation(sleeveNumber) .. js:function:: getInformation(sleeveNumber)
:param int sleeveNumber: index of the sleeve to retrieve information. :param int sleeveNumber: Index of the sleeve to retrieve information. See :ref:`here <netscript_sleeveapi_referencingaduplicatesleeve>`
Return a struct containing tons of information about this sleeve Return a struct containing tons of information about this sleeve

@ -1,9 +1,9 @@
getStats() Netscript Function getSleeveStats() Netscript Function
======================================= ===================================
.. js:function:: getStatus(sleeveNumber) .. js:function:: getStatus(sleeveNumber)
:param int sleeveNumber: index of the sleeve to get stats of. :param int sleeveNumber: Index of the sleeve to get stats of. See :ref:`here <netscript_sleeveapi_referencingaduplicatesleeve>`
Return a structure containing the stats of the sleeve Return a structure containing the stats of the sleeve

@ -3,7 +3,7 @@ getTask() Netscript Function
.. js:function:: getTask(sleeveNumber) .. js:function:: getTask(sleeveNumber)
:param int sleeveNumber: index of the sleeve to retrieve task from. :param int sleeveNumber: Index of the sleeve to retrieve task from. See :ref:`here <netscript_sleeveapi_referencingaduplicatesleeve>`
Return the current task that the sleeve is performing. type is set to "Idle" if the sleeve isn't doing anything Return the current task that the sleeve is performing. type is set to "Idle" if the sleeve isn't doing anything

@ -0,0 +1,11 @@
setToCommitCrime() Netscript Function
=====================================
.. js:function:: setToCommitCrime(sleeveNumber, name)
:param int sleeveNumber: Index of the sleeve to start commiting crime. See :ref:`here <netscript_sleeveapi_referencingaduplicatesleeve>`
:param string name: Name of the crime. Must be an exact match.
Return a boolean indicating whether or not this action was set successfully.
Returns false if an invalid action is specified.

@ -0,0 +1,9 @@
setToCompanyWork() Netscript Function
=====================================
.. js:function:: setToCompanyWork(sleeveNumber, companyName)
:param int sleeveNumber: Index of the sleeve to work for the company. See :ref:`here <netscript_sleeveapi_referencingaduplicatesleeve>`
:param string companyName: Name of the company to work for.
Return a boolean indicating whether or not the sleeve started working or this company.

@ -0,0 +1,10 @@
setToFactionWork() Netscript Function
=====================================
.. js:function:: setToFactionWork(sleeveNumber, factionName, factionWorkType)
:param int sleeveNumber: Index of the sleeve to work for the faction. See :ref:`here <netscript_sleeveapi_referencingaduplicatesleeve>`
:param string factionName: Name of the faction to work for.
:param string factionWorkType: Name of the action to perform for this faction.
Return a boolean indicating whether or not the sleeve started working or this faction.

@ -0,0 +1,10 @@
setToGymWorkout() Netscript Function
====================================
.. js:function:: setToGymWorkout(sleeveNumber, gymName, stat)
:param int sleeveNumber: Index of the sleeve to workout at the gym. See :ref:`here <netscript_sleeveapi_referencingaduplicatesleeve>`
:param string gymName: Name of the gym.
:param string stat: Name of the stat to train.
Return a boolean indicating whether or not the sleeve started working out.

@ -0,0 +1,8 @@
setToShockRecovery() Netscript Function
=======================================
.. js:function:: setToShockRecovery(sleeveNumber)
:param int sleeveNumber: Index of the sleeve to start recovery. See :ref:`here <netscript_sleeveapi_referencingaduplicatesleeve>`
Return a boolean indicating whether or not this action was set successfully.

@ -0,0 +1,8 @@
setToSynchronize() Netscript Function
=====================================
.. js:function:: setToSynchronize(sleeveNumber)
:param int sleeveNumber: Index of the sleeve to start synchronizing. See :ref:`here <netscript_sleeveapi_referencingaduplicatesleeve>`
Return a boolean indicating whether or not this action was set successfully.

@ -0,0 +1,10 @@
setToUniversityCourse() Netscript Function
==========================================
.. js:function:: setToUniversityCourse(sleeveNumber, university, className)
:param int sleeveNumber: Index of the sleeve to start taking class. See :ref:`here <netscript_sleeveapi_referencingaduplicatesleeve>`
:param string university: Name of the university to attend.
:param string className: Name of the class to follow.
Return a boolean indicating whether or not this action was set successfully.

@ -1,8 +0,0 @@
shockRecovery() Netscript Function
=======================================
.. js:function:: shockRecovery(sleeveNumber)
:param int sleeveNumber: index of the sleeve to start recovery.
Return a boolean indicating whether or not this action was set successfully.

@ -1,8 +0,0 @@
synchronize() Netscript Function
=======================================
.. js:function:: synchronize(sleeveNumber)
:param int sleeveNumber: index of the sleeve to start synchronizing.
Return a boolean indicating whether or not this action was set successfully.

@ -1,10 +0,0 @@
takeUniversityCourse() Netscript Function
=======================================
.. js:function:: takeUniversityCourse(sleeveNumber, university, className)
:param int sleeveNumber: index of the sleeve to start taking class.
:param string university: name of the university to attend.
:param string className: name of the class to follow.
Return a boolean indicating whether or not this action was set successfully.

@ -3,7 +3,7 @@ travel() Netscript Function
.. js:function:: travel(sleeveNumber, cityName) .. js:function:: travel(sleeveNumber, cityName)
:param int sleeveNumber: index of the sleeve to travel. :param int sleeveNumber: Index of the sleeve to travel. See :ref:`here <netscript_sleeveapi_referencingaduplicatesleeve>`
:param string cityName: name of the destination city. :param string cityName: Name of the destination city.
Return a boolean indicating whether or not the sleeve reached destination. Return a boolean indicating whether or not the sleeve reached destination.

@ -1,9 +0,0 @@
workForCompany() Netscript Function
=======================================
.. js:function:: workForCompany(sleeveNumber, companyName)
:param int sleeveNumber: index of the sleeve to work for the company.
:param string companyName: name of the company to work for.
Return a boolean indicating whether or not the sleeve started working or this company.

@ -1,10 +0,0 @@
workForFaction() Netscript Function
=======================================
.. js:function:: workForFaction(sleeveNumber, factionName, factionWorkType)
:param int sleeveNumber: index of the sleeve to work for the faction.
:param string factionName: name of the faction to work for.
:param string factionWorkType: name of the action to perform for this faction.
Return a boolean indicating whether or not the sleeve started working or this faction.

@ -1,10 +0,0 @@
workoutAtGym() Netscript Function
=======================================
.. js:function:: workoutAtGym(sleeveNumber, gymName, stat)
:param int sleeveNumber: index of the sleeve to workout at the gym.
:param string gymName: name of the gym.
:param string stat: name of the stat to train.
Return a boolean indicating whether or not the sleeve started working out.

@ -90,7 +90,7 @@ export let CONSTANTS: IMap<any> = {
ScriptGetHackTimeRamCost: 0.05, ScriptGetHackTimeRamCost: 0.05,
ScriptGetFavorToDonate: 0.10, ScriptGetFavorToDonate: 0.10,
ScriptCodingContractBaseRamCost:10, ScriptCodingContractBaseRamCost:10,
ScriptSleeveBaseRamCost: 0, // TODO: let big boss figure out balance. ScriptSleeveBaseRamCost: 4,
ScriptSingularityFn1RamCost: 1, ScriptSingularityFn1RamCost: 1,
ScriptSingularityFn2RamCost: 2, ScriptSingularityFn2RamCost: 2,
@ -303,7 +303,7 @@ export let CONSTANTS: IMap<any> = {
** Bug Fix: An industry's products are now properly separated between different cities ** Bug Fix: An industry's products are now properly separated between different cities
* Added a Netscript API for Duplicate Sleeves (by hydroflame) * Added a Netscript API for Duplicate Sleeves (by hydroflame)
* Rebalanced BitNode-3 to make it slightly harder * Modified BitNode-3's BN multipliers to make it slightly harder
* Bug Fix: Bladeburner's Hyperbolic Regeneration Chamber should no longer instantly refill all stamina * Bug Fix: Bladeburner's Hyperbolic Regeneration Chamber should no longer instantly refill all stamina
* Bug Fix: The cost of purchasing Augmentations for Duplicate Sleeves no longer scales with how many Augs you've purchased for yourself * Bug Fix: The cost of purchasing Augmentations for Duplicate Sleeves no longer scales with how many Augs you've purchased for yourself
` `

@ -4822,61 +4822,61 @@ function NetscriptFunctions(workerScript) {
updateDynamicRam("getNumSleeves", CONSTANTS.ScriptSleeveBaseRamCost); updateDynamicRam("getNumSleeves", CONSTANTS.ScriptSleeveBaseRamCost);
return Player.sleeves.length; return Player.sleeves.length;
}, },
shockRecovery : function(sleeveNumber=0) { setToShockRecovery : function(sleeveNumber=0) {
if (workerScript.checkingRam) { if (workerScript.checkingRam) {
return updateStaticRam("shockRecovery", CONSTANTS.ScriptSleeveBaseRamCost); return updateStaticRam("setToShockRecovery", CONSTANTS.ScriptSleeveBaseRamCost);
} }
if (Player.bitNodeN !== 10 && !SourceFileFlags[10]) { if (Player.bitNodeN !== 10 && !SourceFileFlags[10]) {
throw makeRuntimeRejectMsg(workerScript, "shockRecovery() failed because you do not currently have access to the Sleeve API. This is either because you are not in BitNode-10 or because you do not have Source-File 10"); throw makeRuntimeRejectMsg(workerScript, "setToShockRecovery() failed because you do not currently have access to the Sleeve API. This is either because you are not in BitNode-10 or because you do not have Source-File 10");
} }
updateDynamicRam("shockRecovery", CONSTANTS.ScriptSleeveBaseRamCost); updateDynamicRam("setToShockRecovery", CONSTANTS.ScriptSleeveBaseRamCost);
if (sleeveNumber >= Player.sleeves.length || sleeveNumber < 0) { if (sleeveNumber >= Player.sleeves.length || sleeveNumber < 0) {
workerScript.log(`ERROR: sleeve.shockRecovery(${sleeveNumber}) failed because it is an invalid sleeve number.`); workerScript.log(`ERROR: sleeve.setToShockRecovery(${sleeveNumber}) failed because it is an invalid sleeve number.`);
return false; return false;
} }
return Player.sleeves[sleeveNumber].shockRecovery(Player); return Player.sleeves[sleeveNumber].shockRecovery(Player);
}, },
synchronize : function(sleeveNumber=0) { setToSynchronize : function(sleeveNumber=0) {
if (workerScript.checkingRam) { if (workerScript.checkingRam) {
return updateStaticRam("synchronize", CONSTANTS.ScriptSleeveBaseRamCost); return updateStaticRam("setToSynchronize", CONSTANTS.ScriptSleeveBaseRamCost);
} }
if (Player.bitNodeN !== 10 && !SourceFileFlags[10]) { if (Player.bitNodeN !== 10 && !SourceFileFlags[10]) {
throw makeRuntimeRejectMsg(workerScript, "synchronize() failed because you do not currently have access to the Sleeve API. This is either because you are not in BitNode-10 or because you do not have Source-File 10"); throw makeRuntimeRejectMsg(workerScript, "setToSynchronize() failed because you do not currently have access to the Sleeve API. This is either because you are not in BitNode-10 or because you do not have Source-File 10");
} }
updateDynamicRam("synchronize", CONSTANTS.ScriptSleeveBaseRamCost); updateDynamicRam("setToSynchronize", CONSTANTS.ScriptSleeveBaseRamCost);
if (sleeveNumber >= Player.sleeves.length || sleeveNumber < 0) { if (sleeveNumber >= Player.sleeves.length || sleeveNumber < 0) {
workerScript.log(`ERROR: sleeve.synchronize(${sleeveNumber}) failed because it is an invalid sleeve number.`); workerScript.log(`ERROR: sleeve.setToSynchronize(${sleeveNumber}) failed because it is an invalid sleeve number.`);
return false; return false;
} }
return Player.sleeves[sleeveNumber].synchronize(Player); return Player.sleeves[sleeveNumber].synchronize(Player);
}, },
commitCrime : function(sleeveNumber=0, crimeName="") { setToCommitCrime : function(sleeveNumber=0, crimeName="") {
if (workerScript.checkingRam) { if (workerScript.checkingRam) {
return updateStaticRam("commitCrime", CONSTANTS.ScriptSleeveBaseRamCost); return updateStaticRam("setToCommitCrime", CONSTANTS.ScriptSleeveBaseRamCost);
} }
if (Player.bitNodeN !== 10 && !SourceFileFlags[10]) { if (Player.bitNodeN !== 10 && !SourceFileFlags[10]) {
throw makeRuntimeRejectMsg(workerScript, "commitCrime() failed because you do not currently have access to the Sleeve API. This is either because you are not in BitNode-10 or because you do not have Source-File 10"); throw makeRuntimeRejectMsg(workerScript, "setToCommitCrime() failed because you do not currently have access to the Sleeve API. This is either because you are not in BitNode-10 or because you do not have Source-File 10");
} }
updateDynamicRam("commitCrime", CONSTANTS.ScriptSleeveBaseRamCost); updateDynamicRam("setToCommitCrime", CONSTANTS.ScriptSleeveBaseRamCost);
if (sleeveNumber >= Player.sleeves.length || sleeveNumber < 0) { if (sleeveNumber >= Player.sleeves.length || sleeveNumber < 0) {
workerScript.log(`ERROR: sleeve.commitCrime(${sleeveNumber}) failed because it is an invalid sleeve number.`); workerScript.log(`ERROR: sleeve.setToCommitCrime(${sleeveNumber}) failed because it is an invalid sleeve number.`);
return false; return false;
} }
return Player.sleeves[sleeveNumber].commitCrime(Player, crimeName); return Player.sleeves[sleeveNumber].commitCrime(Player, crimeName);
}, },
takeUniversityCourse : function(sleeveNumber=0, universityName="", className="") { setToUniversityCourse : function(sleeveNumber=0, universityName="", className="") {
if (workerScript.checkingRam) { if (workerScript.checkingRam) {
return updateStaticRam("takeUniversityCourse", CONSTANTS.ScriptSleeveBaseRamCost); return updateStaticRam("setToUniversityCourse", CONSTANTS.ScriptSleeveBaseRamCost);
} }
if (Player.bitNodeN !== 10 && !SourceFileFlags[10]) { if (Player.bitNodeN !== 10 && !SourceFileFlags[10]) {
throw makeRuntimeRejectMsg(workerScript, "takeUniversityCourse() failed because you do not currently have access to the Sleeve API. This is either because you are not in BitNode-10 or because you do not have Source-File 10"); throw makeRuntimeRejectMsg(workerScript, "setToUniversityCourse() failed because you do not currently have access to the Sleeve API. This is either because you are not in BitNode-10 or because you do not have Source-File 10");
} }
updateDynamicRam("takeUniversityCourse", CONSTANTS.ScriptSleeveBaseRamCost); updateDynamicRam("setToUniversityCourse", CONSTANTS.ScriptSleeveBaseRamCost);
if (sleeveNumber >= Player.sleeves.length || sleeveNumber < 0) { if (sleeveNumber >= Player.sleeves.length || sleeveNumber < 0) {
workerScript.log(`ERROR: sleeve.takeUniversityCourse(${sleeveNumber}) failed because it is an invalid sleeve number.`); workerScript.log(`ERROR: sleeve.setToUniversityCourse(${sleeveNumber}) failed because it is an invalid sleeve number.`);
return false; return false;
} }
@ -4897,52 +4897,52 @@ function NetscriptFunctions(workerScript) {
return Player.sleeves[sleeveNumber].travel(Player, cityName); return Player.sleeves[sleeveNumber].travel(Player, cityName);
}, },
workForCompany : function(sleeveNumber=0, companyName="") { setToCompanyWork : function(sleeveNumber=0, companyName="") {
if (workerScript.checkingRam) { if (workerScript.checkingRam) {
return updateStaticRam("workForCompany", CONSTANTS.ScriptSleeveBaseRamCost); return updateStaticRam("setToCompanyWork", CONSTANTS.ScriptSleeveBaseRamCost);
} }
if (Player.bitNodeN !== 10 && !SourceFileFlags[10]) { if (Player.bitNodeN !== 10 && !SourceFileFlags[10]) {
throw makeRuntimeRejectMsg(workerScript, "workForCompany() failed because you do not currently have access to the Sleeve API. This is either because you are not in BitNode-10 or because you do not have Source-File 10"); throw makeRuntimeRejectMsg(workerScript, "setToCompanyWork() failed because you do not currently have access to the Sleeve API. This is either because you are not in BitNode-10 or because you do not have Source-File 10");
} }
updateDynamicRam("workForCompany", CONSTANTS.ScriptSleeveBaseRamCost); updateDynamicRam("setToCompanyWork", CONSTANTS.ScriptSleeveBaseRamCost);
if (sleeveNumber >= Player.sleeves.length || sleeveNumber < 0) { if (sleeveNumber >= Player.sleeves.length || sleeveNumber < 0) {
workerScript.log(`ERROR: sleeve.workForCompany(${sleeveNumber}) failed because it is an invalid sleeve number.`); workerScript.log(`ERROR: sleeve.setToCompanyWork(${sleeveNumber}) failed because it is an invalid sleeve number.`);
return false; return false;
} }
return Player.sleeves[sleeveNumber].workForCompany(Player, companyName); return Player.sleeves[sleeveNumber].workForCompany(Player, companyName);
}, },
workForFaction : function(sleeveNumber=0, factionName="", workType="") { setToFactionWork : function(sleeveNumber=0, factionName="", workType="") {
if (workerScript.checkingRam) { if (workerScript.checkingRam) {
return updateStaticRam("workForFaction", CONSTANTS.ScriptSleeveBaseRamCost); return updateStaticRam("setToFactionWork", CONSTANTS.ScriptSleeveBaseRamCost);
} }
if (Player.bitNodeN !== 10 && !SourceFileFlags[10]) { if (Player.bitNodeN !== 10 && !SourceFileFlags[10]) {
throw makeRuntimeRejectMsg(workerScript, "workForFaction() failed because you do not currently have access to the Sleeve API. This is either because you are not in BitNode-10 or because you do not have Source-File 10"); throw makeRuntimeRejectMsg(workerScript, "setToFactionWork() failed because you do not currently have access to the Sleeve API. This is either because you are not in BitNode-10 or because you do not have Source-File 10");
} }
updateDynamicRam("workForFaction", CONSTANTS.ScriptSleeveBaseRamCost); updateDynamicRam("setToFactionWork", CONSTANTS.ScriptSleeveBaseRamCost);
if (sleeveNumber >= Player.sleeves.length || sleeveNumber < 0) { if (sleeveNumber >= Player.sleeves.length || sleeveNumber < 0) {
workerScript.log(`ERROR: sleeve.workForFaction(${sleeveNumber}) failed because it is an invalid sleeve number.`); workerScript.log(`ERROR: sleeve.setToFactionWork(${sleeveNumber}) failed because it is an invalid sleeve number.`);
return false; return false;
} }
return Player.sleeves[sleeveNumber].workForFaction(Player, factionName, workType); return Player.sleeves[sleeveNumber].workForFaction(Player, factionName, workType);
}, },
workoutAtGym : function(sleeveNumber=0, gymName="", stat="") { setToGymWorkout : function(sleeveNumber=0, gymName="", stat="") {
if (workerScript.checkingRam) { if (workerScript.checkingRam) {
return updateStaticRam("workoutAtGym", CONSTANTS.ScriptSleeveBaseRamCost); return updateStaticRam("setToGymWorkout", CONSTANTS.ScriptSleeveBaseRamCost);
} }
if (Player.bitNodeN !== 10 && !SourceFileFlags[10]) { if (Player.bitNodeN !== 10 && !SourceFileFlags[10]) {
throw makeRuntimeRejectMsg(workerScript, "workoutAtGym() failed because you do not currently have access to the Sleeve API. This is either because you are not in BitNode-10 or because you do not have Source-File 10"); throw makeRuntimeRejectMsg(workerScript, "setToGymWorkout() failed because you do not currently have access to the Sleeve API. This is either because you are not in BitNode-10 or because you do not have Source-File 10");
} }
updateDynamicRam("workoutAtGym", CONSTANTS.ScriptSleeveBaseRamCost); updateDynamicRam("setToGymWorkout", CONSTANTS.ScriptSleeveBaseRamCost);
if (sleeveNumber >= Player.sleeves.length || sleeveNumber < 0) { if (sleeveNumber >= Player.sleeves.length || sleeveNumber < 0) {
workerScript.log(`ERROR: sleeve.workoutAtGym(${sleeveNumber}) failed because it is an invalid sleeve number.`); workerScript.log(`ERROR: sleeve.setToGymWorkout(${sleeveNumber}) failed because it is an invalid sleeve number.`);
return false; return false;
} }
return Player.sleeves[sleeveNumber].workoutAtGym(Player, gymName, stat); return Player.sleeves[sleeveNumber].workoutAtGym(Player, gymName, stat);
}, },
getStats : function(sleeveNumber=0) { getSleeveStats : function(sleeveNumber=0) {
if (workerScript.checkingRam) { if (workerScript.checkingRam) {
return updateStaticRam("workoutAtGym", CONSTANTS.ScriptSleeveBaseRamCost); return updateStaticRam("workoutAtGym", CONSTANTS.ScriptSleeveBaseRamCost);
} }

@ -128,9 +128,9 @@ let NetscriptFunctions =
"getNumTriesRemaining|" + "getNumTriesRemaining|" +
// Sleeve API // Sleeve API
"sleeve|getNumSleeves|shockRecovery|synchronize|commitCrime|" + "sleeve|getNumSleeves|setToShockRecovery|setToSynchronize|setToCommitCrime|" +
"takeUniversityCourse|travel|workForCompany|workForFaction|workoutAtGym|" + "setToUniversityCourse|travel|setToCompanyWork|setToFactionWork|setToGymWorkout|" +
"getStats|getTask|getInformation"; "getSleeveStats|getTask|getInformation";
var NetscriptHighlightRules = function(options) { var NetscriptHighlightRules = function(options) {
var keywordMapper = this.createKeywordMapper({ var keywordMapper = this.createKeywordMapper({

@ -233,7 +233,7 @@ CodeMirror.defineMode("netscript", function(config, parserConfig) {
"switchCity": atom, "switchCity": atom,
"getStamina": atom, "getStamina": atom,
"joinBladeburnerFaction": atom, "joinBladeburnerFaction": atom,
"getBonusTime": atom, // Repeat of above "getBonusTime": atom,
// Netscript Coding Contract API // Netscript Coding Contract API
"codingcontract": atom, "codingcontract": atom,
@ -242,6 +242,21 @@ CodeMirror.defineMode("netscript", function(config, parserConfig) {
"getData": atom, "getData": atom,
"getDescription": atom, "getDescription": atom,
"getNumTriesRemaining": atom, "getNumTriesRemaining": atom,
// Sleeve API
"sleeve": atom,
"getNumSleeves": atom,
"setToShockRecovery": atom,
"setToSynchronize": atom,
"setToCommitCrime": atom,
"setToUniversityCourse": atom,
"travel": atom,
"setToCompanyWork": atom,
"setToFactionWork": atom,
"setToGymWorkout": atom,
"getSleeveStats": atom,
"getTask": atom,
"getInformation": atom,
}; };
}(); }();