diff --git a/doc/source/advancedgameplay/sleeves.rst b/doc/source/advancedgameplay/sleeves.rst index a3db25f26..b0db5b682 100644 --- a/doc/source/advancedgameplay/sleeves.rst +++ b/doc/source/advancedgameplay/sleeves.rst @@ -14,6 +14,8 @@ Sleeve technology unlocks two different gameplay features: Sleeve technology is unlocked in :ref:`BitNode-10 `. +.. _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 `. + 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 ` 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 `. - 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 ^^^^^^^^^^^ diff --git a/doc/source/conf.py b/doc/source/conf.py index 46634b60b..10114564b 100644 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -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. diff --git a/doc/source/netscript/netscriptadvancedfunctions.rst b/doc/source/netscript/netscriptadvancedfunctions.rst index 60400e1f7..796494851 100644 --- a/doc/source/netscript/netscriptadvancedfunctions.rst +++ b/doc/source/netscript/netscriptadvancedfunctions.rst @@ -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() diff --git a/doc/source/netscript/netscriptbladeburnerapi.rst b/doc/source/netscript/netscriptbladeburnerapi.rst index 8a40b12c2..dbd487b73 100644 --- a/doc/source/netscript/netscriptbladeburnerapi.rst +++ b/doc/source/netscript/netscriptbladeburnerapi.rst @@ -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 diff --git a/doc/source/netscript/netscriptgangapi.rst b/doc/source/netscript/netscriptgangapi.rst index 95c322845..9e4335b5f 100644 --- a/doc/source/netscript/netscriptgangapi.rst +++ b/doc/source/netscript/netscriptgangapi.rst @@ -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 diff --git a/doc/source/netscript/netscriptsingularityfunctions.rst b/doc/source/netscript/netscriptsingularityfunctions.rst index 413d44f60..d36d901ae 100644 --- a/doc/source/netscript/netscriptsingularityfunctions.rst +++ b/doc/source/netscript/netscriptsingularityfunctions.rst @@ -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() gymWorkout() travelToCity() diff --git a/doc/source/netscript/netscriptsleeveapi.rst b/doc/source/netscript/netscriptsleeveapi.rst index 8f776b7b8..17a7e48f3 100644 --- a/doc/source/netscript/netscriptsleeveapi.rst +++ b/doc/source/netscript/netscriptsleeveapi.rst @@ -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 ` 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() getNumSleeves() - getTask() - synchronize() - travel() - workForFaction() + getSleeveStats() getInformation() - getStats() - shockRecovery() - takeUniversityCourse() - workForCompany() - workoutAtGym() + getTask() + setToShockRecovery() + setToSynchronize() + setToCommitCrime() + setToFactionWork() + setToCompanyWork() + setToUniversityCourse() + setToGymWorkout() + 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'); } - diff --git a/doc/source/netscript/sleeveapi/commitCrime.rst b/doc/source/netscript/sleeveapi/commitCrime.rst deleted file mode 100644 index 7b8652f8a..000000000 --- a/doc/source/netscript/sleeveapi/commitCrime.rst +++ /dev/null @@ -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. diff --git a/doc/source/netscript/sleeveapi/getInformation.rst b/doc/source/netscript/sleeveapi/getInformation.rst index de11ec982..834b5a07f 100644 --- a/doc/source/netscript/sleeveapi/getInformation.rst +++ b/doc/source/netscript/sleeveapi/getInformation.rst @@ -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 ` Return a struct containing tons of information about this sleeve diff --git a/doc/source/netscript/sleeveapi/getStats.rst b/doc/source/netscript/sleeveapi/getSleeveStats.rst similarity index 72% rename from doc/source/netscript/sleeveapi/getStats.rst rename to doc/source/netscript/sleeveapi/getSleeveStats.rst index f121ae475..f7c538dd8 100644 --- a/doc/source/netscript/sleeveapi/getStats.rst +++ b/doc/source/netscript/sleeveapi/getSleeveStats.rst @@ -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 ` Return a structure containing the stats of the sleeve diff --git a/doc/source/netscript/sleeveapi/getTask.rst b/doc/source/netscript/sleeveapi/getTask.rst index 025ee045a..ffe5707fa 100644 --- a/doc/source/netscript/sleeveapi/getTask.rst +++ b/doc/source/netscript/sleeveapi/getTask.rst @@ -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 ` Return the current task that the sleeve is performing. type is set to "Idle" if the sleeve isn't doing anything diff --git a/doc/source/netscript/sleeveapi/setToCommitCrime.rst b/doc/source/netscript/sleeveapi/setToCommitCrime.rst new file mode 100644 index 000000000..d2d79d097 --- /dev/null +++ b/doc/source/netscript/sleeveapi/setToCommitCrime.rst @@ -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 ` + :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. diff --git a/doc/source/netscript/sleeveapi/setToCompanyWork.rst b/doc/source/netscript/sleeveapi/setToCompanyWork.rst new file mode 100644 index 000000000..4078de78e --- /dev/null +++ b/doc/source/netscript/sleeveapi/setToCompanyWork.rst @@ -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 ` + :param string companyName: Name of the company to work for. + + Return a boolean indicating whether or not the sleeve started working or this company. diff --git a/doc/source/netscript/sleeveapi/setToFactionWork.rst b/doc/source/netscript/sleeveapi/setToFactionWork.rst new file mode 100644 index 000000000..7df05aa99 --- /dev/null +++ b/doc/source/netscript/sleeveapi/setToFactionWork.rst @@ -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 ` + :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. diff --git a/doc/source/netscript/sleeveapi/setToGymWorkout.rst b/doc/source/netscript/sleeveapi/setToGymWorkout.rst new file mode 100644 index 000000000..4175b213f --- /dev/null +++ b/doc/source/netscript/sleeveapi/setToGymWorkout.rst @@ -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 ` + :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. diff --git a/doc/source/netscript/sleeveapi/setToShockRecovery.rst b/doc/source/netscript/sleeveapi/setToShockRecovery.rst new file mode 100644 index 000000000..16950dd90 --- /dev/null +++ b/doc/source/netscript/sleeveapi/setToShockRecovery.rst @@ -0,0 +1,8 @@ +setToShockRecovery() Netscript Function +======================================= + +.. js:function:: setToShockRecovery(sleeveNumber) + + :param int sleeveNumber: Index of the sleeve to start recovery. See :ref:`here ` + + Return a boolean indicating whether or not this action was set successfully. diff --git a/doc/source/netscript/sleeveapi/setToSynchronize.rst b/doc/source/netscript/sleeveapi/setToSynchronize.rst new file mode 100644 index 000000000..c8d4aa9e0 --- /dev/null +++ b/doc/source/netscript/sleeveapi/setToSynchronize.rst @@ -0,0 +1,8 @@ +setToSynchronize() Netscript Function +===================================== + +.. js:function:: setToSynchronize(sleeveNumber) + + :param int sleeveNumber: Index of the sleeve to start synchronizing. See :ref:`here ` + + Return a boolean indicating whether or not this action was set successfully. diff --git a/doc/source/netscript/sleeveapi/setToUniversityCourse.rst b/doc/source/netscript/sleeveapi/setToUniversityCourse.rst new file mode 100644 index 000000000..22dbbad9d --- /dev/null +++ b/doc/source/netscript/sleeveapi/setToUniversityCourse.rst @@ -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 ` + :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. diff --git a/doc/source/netscript/sleeveapi/shockRecovery.rst b/doc/source/netscript/sleeveapi/shockRecovery.rst deleted file mode 100644 index d176030f7..000000000 --- a/doc/source/netscript/sleeveapi/shockRecovery.rst +++ /dev/null @@ -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. \ No newline at end of file diff --git a/doc/source/netscript/sleeveapi/synchronize.rst b/doc/source/netscript/sleeveapi/synchronize.rst deleted file mode 100644 index 41af0165d..000000000 --- a/doc/source/netscript/sleeveapi/synchronize.rst +++ /dev/null @@ -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. \ No newline at end of file diff --git a/doc/source/netscript/sleeveapi/takeUniversityCourse.rst b/doc/source/netscript/sleeveapi/takeUniversityCourse.rst deleted file mode 100644 index 9a87648de..000000000 --- a/doc/source/netscript/sleeveapi/takeUniversityCourse.rst +++ /dev/null @@ -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. \ No newline at end of file diff --git a/doc/source/netscript/sleeveapi/travel.rst b/doc/source/netscript/sleeveapi/travel.rst index fdae988eb..e89c2fe0c 100644 --- a/doc/source/netscript/sleeveapi/travel.rst +++ b/doc/source/netscript/sleeveapi/travel.rst @@ -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 ` + :param string cityName: Name of the destination city. - Return a boolean indicating whether or not the sleeve reached destination. \ No newline at end of file + Return a boolean indicating whether or not the sleeve reached destination. diff --git a/doc/source/netscript/sleeveapi/workForCompany.rst b/doc/source/netscript/sleeveapi/workForCompany.rst deleted file mode 100644 index 301bc04a7..000000000 --- a/doc/source/netscript/sleeveapi/workForCompany.rst +++ /dev/null @@ -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. \ No newline at end of file diff --git a/doc/source/netscript/sleeveapi/workForFaction.rst b/doc/source/netscript/sleeveapi/workForFaction.rst deleted file mode 100644 index 2b94e99dd..000000000 --- a/doc/source/netscript/sleeveapi/workForFaction.rst +++ /dev/null @@ -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. \ No newline at end of file diff --git a/doc/source/netscript/sleeveapi/workoutAtGym.rst b/doc/source/netscript/sleeveapi/workoutAtGym.rst deleted file mode 100644 index f1207bc7a..000000000 --- a/doc/source/netscript/sleeveapi/workoutAtGym.rst +++ /dev/null @@ -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. \ No newline at end of file diff --git a/src/Constants.ts b/src/Constants.ts index d61140f62..916ffce55 100644 --- a/src/Constants.ts +++ b/src/Constants.ts @@ -85,12 +85,12 @@ export let CONSTANTS: IMap = { 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 = { ** 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 ` diff --git a/src/NetscriptFunctions.js b/src/NetscriptFunctions.js index a417f199e..74133fdf3 100644 --- a/src/NetscriptFunctions.js +++ b/src/NetscriptFunctions.js @@ -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. diff --git a/src/ScriptEditor/AceNetscriptMode.js b/src/ScriptEditor/AceNetscriptMode.js index 70d7de56f..18ca0030a 100644 --- a/src/ScriptEditor/AceNetscriptMode.js +++ b/src/ScriptEditor/AceNetscriptMode.js @@ -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({ diff --git a/src/ScriptEditor/CodeMirrorNetscriptMode.js b/src/ScriptEditor/CodeMirrorNetscriptMode.js index 2baf88d91..bf6f2790b 100644 --- a/src/ScriptEditor/CodeMirrorNetscriptMode.js +++ b/src/ScriptEditor/CodeMirrorNetscriptMode.js @@ -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, }; }();