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>`.
.. _gameplay_duplicatesleeves:
Duplicate Sleeves
^^^^^^^^^^^^^^^^^
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
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 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
it decreases by assigning sleeves to the 'Shock Recovery' task.
Obtaining Duplicate Sleeves
~~~~~~~~~~~~~~~~~~~~~~~~~~~
There are two methods of obtaining Duplicate Sleeves:
Augmentations
~~~~~~~~~~~~~
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
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. You can purchase
up to 5 Duplicate Sleeves from The Covenant.
When you purchase an Augmentation for a Duplicate Sleeve, it is instantly installed.
When this happens, the Sleeve's stats are instantly reset back to 0, similar to
when you normally install Augmentations.
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
^^^^^^^^^^^

@ -64,9 +64,9 @@ documentation_title = '{0} Documentation'.format(project)
# built documents.
#
# The short X.Y version.
version = '0.44'
version = '0.45'
# 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
# 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
they contain spoilers for the game.
.. warning:: This page contains spoilers for the game
.. toctree::
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
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
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
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
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.
**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.
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
@ -20,7 +20,7 @@ Note that Singularity Functions require twice as much RAM outside of BitNode-4
.. toctree::
:caption: Functions:
universityCourse() <singularityfunctions/universityCourse>
gymWorkout() <singularityfunctions/gymWorkout>
travelToCity() <singularityfunctions/travelToCity>

@ -2,12 +2,13 @@
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
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
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");
.. toctree::
:caption: Functions:
:caption: API Functions:
commitCrime() <sleeveapi/commitCrime>
getNumSleeves() <sleeveapi/getNumSleeves>
getTask() <sleeveapi/getTask>
synchronize() <sleeveapi/synchronize>
travel() <sleeveapi/travel>
workForFaction() <sleeveapi/workForFaction>
getSleeveStats() <sleeveapi/getSleeveStats>
getInformation() <sleeveapi/getInformation>
getStats() <sleeveapi/getStats>
shockRecovery() <sleeveapi/shockRecovery>
takeUniversityCourse() <sleeveapi/takeUniversityCourse>
workForCompany() <sleeveapi/workForCompany>
workoutAtGym() <sleeveapi/workoutAtGym>
getTask() <sleeveapi/getTask>
setToShockRecovery() <sleeveapi/setToShockRecovery>
setToSynchronize() <sleeveapi/setToSynchronize>
setToCommitCrime() <sleeveapi/setToCommitCrime>
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
--------
**Basic example usage**::
for(let i = 0; i < sleeve.getNumSleeves(); i++) {
for (var i = 0; i < sleeve.getNumSleeves(); 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);
}
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');
}

@ -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)
: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

@ -1,9 +1,9 @@
getStats() Netscript Function
=======================================
getSleeveStats() Netscript Function
===================================
.. 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

@ -3,7 +3,7 @@ getTask() Netscript Function
.. 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

@ -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)
:param int sleeveNumber: index of the sleeve to travel.
:param string cityName: name of the destination city.
:param int sleeveNumber: Index of the sleeve to travel. See :ref:`here <netscript_sleeveapi_referencingaduplicatesleeve>`
: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.

@ -85,12 +85,12 @@ export let CONSTANTS: IMap<any> = {
ScriptGetPurchasedServerMaxRam: 0.05,
ScriptRoundRamCost: 0.05,
ScriptReadWriteRamCost: 1.0,
ScriptArbScriptRamCost: 1.0, //Functions that apply to all scripts regardless of args
ScriptArbScriptRamCost: 1.0, // Functions that apply to all scripts regardless of args
ScriptGetScriptRamCost: 0.1,
ScriptGetHackTimeRamCost: 0.05,
ScriptGetFavorToDonate: 0.10,
ScriptCodingContractBaseRamCost:10,
ScriptSleeveBaseRamCost: 0, // TODO: let big boss figure out balance.
ScriptSleeveBaseRamCost: 4,
ScriptSingularityFn1RamCost: 1,
ScriptSingularityFn2RamCost: 2,
@ -303,7 +303,7 @@ export let CONSTANTS: IMap<any> = {
** Bug Fix: An industry's products are now properly separated between different cities
* 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: 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);
return Player.sleeves.length;
},
shockRecovery : function(sleeveNumber=0) {
setToShockRecovery : function(sleeveNumber=0) {
if (workerScript.checkingRam) {
return updateStaticRam("shockRecovery", CONSTANTS.ScriptSleeveBaseRamCost);
return updateStaticRam("setToShockRecovery", CONSTANTS.ScriptSleeveBaseRamCost);
}
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) {
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 Player.sleeves[sleeveNumber].shockRecovery(Player);
},
synchronize : function(sleeveNumber=0) {
setToSynchronize : function(sleeveNumber=0) {
if (workerScript.checkingRam) {
return updateStaticRam("synchronize", CONSTANTS.ScriptSleeveBaseRamCost);
return updateStaticRam("setToSynchronize", CONSTANTS.ScriptSleeveBaseRamCost);
}
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) {
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 Player.sleeves[sleeveNumber].synchronize(Player);
},
commitCrime : function(sleeveNumber=0, crimeName="") {
setToCommitCrime : function(sleeveNumber=0, crimeName="") {
if (workerScript.checkingRam) {
return updateStaticRam("commitCrime", CONSTANTS.ScriptSleeveBaseRamCost);
return updateStaticRam("setToCommitCrime", CONSTANTS.ScriptSleeveBaseRamCost);
}
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) {
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 Player.sleeves[sleeveNumber].commitCrime(Player, crimeName);
},
takeUniversityCourse : function(sleeveNumber=0, universityName="", className="") {
setToUniversityCourse : function(sleeveNumber=0, universityName="", className="") {
if (workerScript.checkingRam) {
return updateStaticRam("takeUniversityCourse", CONSTANTS.ScriptSleeveBaseRamCost);
return updateStaticRam("setToUniversityCourse", CONSTANTS.ScriptSleeveBaseRamCost);
}
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) {
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;
}
@ -4897,52 +4897,52 @@ function NetscriptFunctions(workerScript) {
return Player.sleeves[sleeveNumber].travel(Player, cityName);
},
workForCompany : function(sleeveNumber=0, companyName="") {
setToCompanyWork : function(sleeveNumber=0, companyName="") {
if (workerScript.checkingRam) {
return updateStaticRam("workForCompany", CONSTANTS.ScriptSleeveBaseRamCost);
return updateStaticRam("setToCompanyWork", CONSTANTS.ScriptSleeveBaseRamCost);
}
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) {
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 Player.sleeves[sleeveNumber].workForCompany(Player, companyName);
},
workForFaction : function(sleeveNumber=0, factionName="", workType="") {
setToFactionWork : function(sleeveNumber=0, factionName="", workType="") {
if (workerScript.checkingRam) {
return updateStaticRam("workForFaction", CONSTANTS.ScriptSleeveBaseRamCost);
return updateStaticRam("setToFactionWork", CONSTANTS.ScriptSleeveBaseRamCost);
}
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) {
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 Player.sleeves[sleeveNumber].workForFaction(Player, factionName, workType);
},
workoutAtGym : function(sleeveNumber=0, gymName="", stat="") {
setToGymWorkout : function(sleeveNumber=0, gymName="", stat="") {
if (workerScript.checkingRam) {
return updateStaticRam("workoutAtGym", CONSTANTS.ScriptSleeveBaseRamCost);
return updateStaticRam("setToGymWorkout", CONSTANTS.ScriptSleeveBaseRamCost);
}
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) {
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 Player.sleeves[sleeveNumber].workoutAtGym(Player, gymName, stat);
},
getStats : function(sleeveNumber=0) {
getSleeveStats : function(sleeveNumber=0) {
if (workerScript.checkingRam) {
return updateStaticRam("workoutAtGym", CONSTANTS.ScriptSleeveBaseRamCost);
}
@ -5007,7 +5007,7 @@ function NetscriptFunctions(workerScript) {
city: sl.city,
hp: sl.hp,
jobs: Object.keys(Player.jobs), // technically sleeves have the same jobs as the player.
jobTitle: Object.values(Player.jobs),
jobTitle: Object.values(Player.jobs),
maxHp: sl.max_hp,
tor: SpecialServerIps.hasOwnProperty("Darkweb Server"), // There's no reason not to give that infomation here as well. Worst case scenario it isn't used.

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

@ -233,7 +233,7 @@ CodeMirror.defineMode("netscript", function(config, parserConfig) {
"switchCity": atom,
"getStamina": atom,
"joinBladeburnerFaction": atom,
"getBonusTime": atom,
// Repeat of above "getBonusTime": atom,
// Netscript Coding Contract API
"codingcontract": atom,
@ -242,6 +242,21 @@ CodeMirror.defineMode("netscript", function(config, parserConfig) {
"getData": atom,
"getDescription": 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,
};
}();