diff --git a/devNotes/twine JS.txt b/devNotes/twine JS.txt index efb0e0426446b5f1a09d36c34bcf9b3b06c7b2c0..e00e1810b3a427ef31d5f4dab301dc496495ac96 100644 --- a/devNotes/twine JS.txt +++ b/devNotes/twine JS.txt @@ -24644,9 +24644,14 @@ window.removeActiveSlave = function removeActiveSlave() { if (_o !== -1) { V.organs.deleteAt(_o); } + _o = V.completedOrgans.findIndex(function(s) { return s.ID === V.activeSlave.ID; }); + if (_o !== -1) { + V.completedOrgans.deleteAt(_o); + } _o = V.limbs.findIndex(function(s) { return s.ID === V.activeSlave.ID; }); if (_o !== -1) { V.limbs.deleteAt(_o); + V.limbsCompleted--; } const _geneIndex = V.genePool.findIndex(function(s) { return s.ID === V.activeSlave.ID; }); diff --git a/src/js/removeActiveSlave.tw b/src/js/removeActiveSlave.tw index c3efd16b10ce70ab63e0f392cc37f719d4a468c7..4cd6a98b06287343cd0c686f1b674d4fdd8c8211 100644 --- a/src/js/removeActiveSlave.tw +++ b/src/js/removeActiveSlave.tw @@ -184,9 +184,14 @@ window.removeActiveSlave = function removeActiveSlave() { if (_o !== -1) { V.organs.deleteAt(_o); } + _o = V.completedOrgans.findIndex(function(s) { return s.ID === V.activeSlave.ID; }); + if (_o !== -1) { + V.completedOrgans.deleteAt(_o); + } _o = V.limbs.findIndex(function(s) { return s.ID === V.activeSlave.ID; }); if (_o !== -1) { V.limbs.deleteAt(_o); + V.limbsCompleted--; } const _geneIndex = V.genePool.findIndex(function(s) { return s.ID === V.activeSlave.ID; }); diff --git a/src/pregmod/hotswapprosthetics.tw b/src/pregmod/hotswapprosthetics.tw index a8bdc5c6915025f6b5ef7492ac3adf0518c8559e..662fd903aa487e40166e4cc966c9af75bad96a80 100644 --- a/src/pregmod/hotswapprosthetics.tw +++ b/src/pregmod/hotswapprosthetics.tw @@ -4,21 +4,36 @@ <<if $activeSlave.amp < 0>> <<set _oldLimbs = {type: 0, armsTat: 0, legsTat: 0}>> <<set _oldLimbs.type = $activeSlave.amp, _oldLimbs.armsTat = $activeSlave.armsTat, _oldLimbs.legsTat = $activeSlave.legsTat>> +<<else>> + <<unset _oldLimbs>> <</if>> <<set _readyLimbs = []>> <<for _hsp = 0; _hsp < $activeSlave.readyLimbs.length; _hsp++>> <<set _readyLimbs.push($activeSlave.readyLimbs[_hsp].type)>> <</for>> -<br> - Switch out her prosthetics for + + __Swap out $his prosthetics__: + <<if $activeSlave.amp < 0>> + <<link "Remove current prostheses">> + <<set $activeSlave.amp = 1, $activeSlave.armsTat = 0, $activeSlave.legsTat = 0>> + <<set $activeSlave.readyLimbs.splice(_hsp, 1, _oldLimbs)>> + <<replace "#LimbOptions">> + <<include "Hotswap Prosthetics">> + <</replace>> + <</link>> | + <</if>> + <<if $activeSlave.amp == -1>> <strong>Basic P-limbs equipped</strong> <<elseif _readyLimbs.includes(-1)>> - <<link "a basic set">> + <<link "A basic set">> <<set _hsp = $activeSlave.readyLimbs.findIndex(function(s) { return s.type == -1; })>> <<set _newLimbs = $activeSlave.readyLimbs[_hsp]>> <<set $activeSlave.amp = -1, $activeSlave.armsTat = _newLimbs.armsTat, $activeSlave.legsTat = _newLimbs.legsTat>> - <<set $activeSlave.readyLimbs.splice(_hsp, 1, _oldLimbs)>> + <<set $activeSlave.readyLimbs.splice(_hsp, 1)>> + <<if def _oldLimbs>> + <<set $activeSlave.readyLimbs.push(_oldLimbs)>> + <</if>> <<replace "#LimbOptions">> <<include "Hotswap Prosthetics">> <</replace>> @@ -32,11 +47,14 @@ <<if $activeSlave.amp == -2>> <strong>Sex focused P-limbs equipped</strong> <<elseif _readyLimbs.includes(-2)>> - <<link "a sex focused set">> + <<link "A sex focused set">> <<set _hsp = $activeSlave.readyLimbs.findIndex(function(s) { return s.type == -2; })>> <<set _newLimbs = $activeSlave.readyLimbs[_hsp]>> <<set $activeSlave.amp = -2, $activeSlave.armsTat = _newLimbs.armsTat, $activeSlave.legsTat = _newLimbs.legsTat>> - <<set $activeSlave.readyLimbs.splice(_hsp, 1, _oldLimbs)>> + <<set $activeSlave.readyLimbs.splice(_hsp, 1)>> + <<if def _oldLimbs>> + <<set $activeSlave.readyLimbs.push(_oldLimbs)>> + <</if>> <<replace "#LimbOptions">> <<include "Hotswap Prosthetics">> <</replace>> @@ -50,11 +68,14 @@ <<if $activeSlave.amp == -3>> <strong>Natural looking P-limbs equipped</strong> <<elseif _readyLimbs.includes(-3)>> - <<link "a natural looking set">> + <<link "A natural looking set">> <<set _hsp = $activeSlave.readyLimbs.findIndex(function(s) { return s.type == -3; })>> <<set _newLimbs = $activeSlave.readyLimbs[_hsp]>> <<set $activeSlave.amp = -3, $activeSlave.armsTat = _newLimbs.armsTat, $activeSlave.legsTat = _newLimbs.legsTat>> - <<set $activeSlave.readyLimbs.splice(_hsp, 1, _oldLimbs)>> + <<set $activeSlave.readyLimbs.splice(_hsp, 1)>> + <<if def _oldLimbs>> + <<set $activeSlave.readyLimbs.push(_oldLimbs)>> + <</if>> <<replace "#LimbOptions">> <<include "Hotswap Prosthetics">> <</replace>> @@ -68,11 +89,14 @@ <<if $activeSlave.amp == -4>> <strong>Combat P-limbs equipped</strong> <<elseif _readyLimbs.includes(-4)>> - <<link "military grade arms">> + <<link "Military grade arms">> <<set _hsp = $activeSlave.readyLimbs.findIndex(function(s) { return s.type == -4; })>> <<set _newLimbs = $activeSlave.readyLimbs[_hsp]>> <<set $activeSlave.amp = -4, $activeSlave.armsTat = _newLimbs.armsTat, $activeSlave.legsTat = _newLimbs.legsTat>> - <<set $activeSlave.readyLimbs.splice(_hsp, 1, _oldLimbs)>> + <<set $activeSlave.readyLimbs.splice(_hsp, 1)>> + <<if def _oldLimbs>> + <<set $activeSlave.readyLimbs.push(_oldLimbs)>> + <</if>> <<replace "#LimbOptions">> <<include "Hotswap Prosthetics">> <</replace>> @@ -86,11 +110,14 @@ <<if $activeSlave.amp == -5>> <strong>Cybernetic P-limbs equipped</strong> <<elseif _readyLimbs.includes(-5)>> - <<link "advanced cybernetics">> + <<link "Advanced cybernetics">> <<set _hsp = $activeSlave.readyLimbs.findIndex(function(s) { return s.type == -5; })>> <<set _newLimbs = $activeSlave.readyLimbs[_hsp]>> <<set $activeSlave.amp = -5, $activeSlave.armsTat = _newLimbs.armsTat, $activeSlave.legsTat = _newLimbs.legsTat>> - <<set $activeSlave.readyLimbs.splice(_hsp, 1, _oldLimbs)>> + <<set $activeSlave.readyLimbs.splice(_hsp, 1)>> + <<if def _oldLimbs>> + <<set $activeSlave.readyLimbs.push(_oldLimbs)>> + <</if>> <<replace "#LimbOptions">> <<include "Hotswap Prosthetics">> <</replace>> diff --git a/src/uncategorized/multiImplant.tw b/src/uncategorized/multiImplant.tw index d033b1ad1ff1448eb376229ec0c7178d17164105..c8487bc761c06b4346db70794404f8fef432eca8 100644 --- a/src/uncategorized/multiImplant.tw +++ b/src/uncategorized/multiImplant.tw @@ -958,7 +958,22 @@ You head down to your <<if $surgeryUpgrade == 1>>heavily upgraded and customized <<set $activeSlave.armsTat = 0, $activeSlave.legsTat = 0>> <<else>> <br><hr> - @@.red;Could not install prosthetic limbs on $activeSlave.slaveName: she lacks a prosthetic interface.@@ + @@.red;Could not install prosthetic limbs on $activeSlave.slaveName: she lacks a prosthetic interface.@@ They have been moved into storage for later installation. + <<set _oldLimbs = {type: 0, armsTat: 0, legsTat: 0}>> + <<switch $limbs[_l].type>> + <<case "simple">> + <<set _oldLimbs.type = -1>> + <<case "sex">> + <<set _oldLimbs.type = -2>> + <<case "beauty">> + <<set _oldLimbs.type = -3>> + <<case "combat">> + <<set _oldLimbs.type = -4>> + <<case "cyber">> + <<set _oldLimbs.type = -5>> + <</switch>> + <<set $activeSlave.readyLimbs.push(_oldLimbs)>> + <<set $limbs.deleteAt(_l)>> <</if>> <<break>> <</if>> diff --git a/src/uncategorized/remoteSurgery.tw b/src/uncategorized/remoteSurgery.tw index 5d086bc5dad87520d6b3bb4d11768b25616f8eef..e7a0575078b2174eb49f193db235846fcbd01ad8 100644 --- a/src/uncategorized/remoteSurgery.tw +++ b/src/uncategorized/remoteSurgery.tw @@ -1593,14 +1593,14 @@ Work on $him structurally: <<set $activeSlave.amp = -5>> <<set $surgeryType = "cyberPLimbs">> <</switch>> - <<set $limbs.deleteAt(_i)>> + <<set $limbs.deleteAt(_i), $limbsComplete-->> <<set $activeSlave.armsTat = 0, $activeSlave.legsTat = 0>> <<goto "Surgery Degradation">> <</link>> <</if>> | <<link "Discard">> - <<set $limbs.deleteAt(_i)>> + <<set $limbs.deleteAt(_i), $limbsComplete-->> <<goto "Remote Surgery">> <</link>> | @@ -1622,7 +1622,7 @@ Work on $him structurally: <</switch>> <<set $activeSlave.readyLimbs.push(_newLimbs)>> - <<set $limbs.deleteAt(_i)>> + <<set $limbs.deleteAt(_i), $limbsComplete-->> <<goto "Remote Surgery">> <</link>><<if $activeSlave.PLimb == 1>>// These can be accessed at any time during slave inspection //<</if>> <</if>> diff --git a/src/uncategorized/slaveInteract.tw b/src/uncategorized/slaveInteract.tw index 2298cf969a9f63cdd6f287e417758338d9bdf9db..4292c4a1db24c264ed6cc6e200ded0758ba727bd 100644 --- a/src/uncategorized/slaveInteract.tw +++ b/src/uncategorized/slaveInteract.tw @@ -442,8 +442,8 @@ <<if ndef $activeSlave.readyLimbs>> <<set $activeSlave.readyLimbs = []>> <</if>> -<<if $activeSlave.readyLimbs.length > 0 && $activeSlave.PLimb == 1>> - <span id = "LimbOptions"><<include "Hotswap Prosthetics">></span> +<<if ($activeSlave.readyLimbs.length > 0 || $activeSlave.amp < 0) && $activeSlave.PLimb == 1>> + <br><br><span id = "LimbOptions"><<include "Hotswap Prosthetics">></span> <</if>> /* END hotswap prosthetics */ <</if>>/* CyberMod Toggle */