diff --git a/src/pregmod/hotswapprosthetics.tw b/src/pregmod/hotswapprosthetics.tw index be2349a43eefd235321751190197e364ba81729a..a8bdc5c6915025f6b5ef7492ac3adf0518c8559e 100644 --- a/src/pregmod/hotswapprosthetics.tw +++ b/src/pregmod/hotswapprosthetics.tw @@ -1,52 +1,103 @@ :: Hotswap Prosthetics [nobr] -<<if ndef $activeLimbs>> - <<set $activeLimbs = 0>> + +<<set $activeLimbs = $limbs.find(function(s) { return s.ID == $activeSlave.ID; })>> +<<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>> <</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 <<if $activeSlave.amp == -1>> <strong>Basic P-limbs equipped</strong> - <<elseif $activeSlave.readyLimbs.includes(-1)>> - <<link "a basic set">><<set $activeSlave.amp = -1>><<replace "#LimbOptions">><<include "Hotswap Prosthetics">><</replace>><</link>> - <<elseif $activeLimbs.type == "simple" && $activeSlave.ID == $activeLimbs.ID>> + <<elseif _readyLimbs.includes(-1)>> + <<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)>> + <<replace "#LimbOptions">> + <<include "Hotswap Prosthetics">> + <</replace>> + <</link>> + <<elseif def $activeLimbs && $activeLimbs.type == "simple" && $activeSlave.ID == $activeLimbs.ID>> //Basic P-limbs being built - <<else>> + <<else>> //Basic prostheses unavailable <</if>>| + <<if $activeSlave.amp == -2>> <strong>Sex focused P-limbs equipped</strong> - <<elseif $activeSlave.readyLimbs.includes(-2)>> - <<link "a sex focused set">><<set $activeSlave.amp = -2>><<replace "#LimbOptions">><<include "Hotswap Prosthetics">><</replace>><</link>> - <<elseif $activeLimbs.type == "sex" && $activeSlave.ID == $activeLimbs.ID>> + <<elseif _readyLimbs.includes(-2)>> + <<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)>> + <<replace "#LimbOptions">> + <<include "Hotswap Prosthetics">> + <</replace>> + <</link>> + <<elseif def $activeLimbs && $activeLimbs.type == "sex" && $activeSlave.ID == $activeLimbs.ID>> //Sex focused P-limbs being built - <<else>> + <<else>> //Sex focused prostheses unavailable <</if>>| + <<if $activeSlave.amp == -3>> <strong>Natural looking P-limbs equipped</strong> - <<elseif $activeSlave.readyLimbs.includes(-3)>> - <<link "a natural looking set">><<set $activeSlave.amp = -3>><<replace "#LimbOptions">><<include "Hotswap Prosthetics">><</replace>><</link>> - <<elseif $activeLimbs.type == "beauty" && $activeSlave.ID == $activeLimbs.ID>> + <<elseif _readyLimbs.includes(-3)>> + <<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)>> + <<replace "#LimbOptions">> + <<include "Hotswap Prosthetics">> + <</replace>> + <</link>> + <<elseif def $activeLimbs && $activeLimbs.type == "beauty" && $activeSlave.ID == $activeLimbs.ID>> //Natural looking P-limbs being built - <<else>> + <<else>> //Natural looking prostheses unavailable <</if>>| + <<if $activeSlave.amp == -4>> <strong>Combat P-limbs equipped</strong> - <<elseif $activeSlave.readyLimbs.includes(-4)>> - <<link "military grade arms">><<set $activeSlave.amp = -4>><<replace "#LimbOptions">><<include "Hotswap Prosthetics">><</replace>><</link>> - <<elseif $activeLimbs.type == "combat" && $activeSlave.ID == $activeLimbs.ID>> + <<elseif _readyLimbs.includes(-4)>> + <<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)>> + <<replace "#LimbOptions">> + <<include "Hotswap Prosthetics">> + <</replace>> + <</link>> + <<elseif def $activeLimbs && $activeLimbs.type == "combat" && $activeSlave.ID == $activeLimbs.ID>> //Combat P-limbs being built - <<else>> + <<else>> //Combat prostheses unavailable <</if>>| + <<if $activeSlave.amp == -5>> <strong>Cybernetic P-limbs equipped</strong> - <<elseif $activeSlave.readyLimbs.includes(-5)>> - <<link "advanced cybernetics">><<set $activeSlave.amp = -5>><<replace "#LimbOptions">><<include "Hotswap Prosthetics">><</replace>><</link>> - <<elseif $activeLimbs.type == "cyber" && $activeSlave.ID == $activeLimbs.ID>> + <<elseif _readyLimbs.includes(-5)>> + <<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)>> + <<replace "#LimbOptions">> + <<include "Hotswap Prosthetics">> + <</replace>> + <</link>> + <<elseif def $activeLimbs && $activeLimbs.type == "cyber" && $activeSlave.ID == $activeLimbs.ID>> //Cybernetic P-limbs being built - <<else>> + <<else>> //Cybernetic prostheses unavailable <</if>> <br> diff --git a/src/uncategorized/BackwardsCompatibility.tw b/src/uncategorized/BackwardsCompatibility.tw index 4d7b0fc2240224033c2a0b9665226733127cb37e..421ad5a0aab52b1ac59788646f2a6940326c9f32 100644 --- a/src/uncategorized/BackwardsCompatibility.tw +++ b/src/uncategorized/BackwardsCompatibility.tw @@ -3048,6 +3048,18 @@ Setting missing slave variables: <<set _Slave.height = Math.trunc(_Slave.height)>> <</if>> +<<if $cyberMod == 0 && (_Slave.amp < 0 || _Slave.PLimb == 2)>> + <<set _Slave.PLimb = 1>> +<</if>> + +<<for _bci2 = 0; _bci2 < _Slave.readyLimbs.length; _bci2++>> + <<if typeof _Slave.readyLimbs[_bci2] != "object">> + <<set _storedLimbs = {type: 0, armsTat: 0, legsTat: 0}>> + <<set _storedLimbs.type = _Slave.readyLimbs[_bci2]>> + <<set _Slave.readyLimbs[_bci2] = _storedLimbs>> + <</if>> +<</for>> + <<set $slaves[_bci] = _Slave>> <</for>> diff --git a/src/uncategorized/remoteSurgery.tw b/src/uncategorized/remoteSurgery.tw index c41f229ee7aedcb31005ea37b6b168733697b596..42b3ef74c0c7c226e34bceac7a9a1dd58cdf7c1e 100644 --- a/src/uncategorized/remoteSurgery.tw +++ b/src/uncategorized/remoteSurgery.tw @@ -1240,9 +1240,9 @@ Work on her structurally: <<else>> $pronounCap is a quadruple amputee <<if $activeSlave.PLimb == 1 && $activeSlave.amp == 1>> - and has been implanted with basic PLimb interface. + and has been implanted with a <<if $cyberMod>>basic<</if>> PLimb interface. <<elseif $activeSlave.PLimb == 2 && $activeSlave.amp == 1>> - and has been implanted with advanced PLimb interface. + and has been implanted with an advanced PLimb interface. <<elseif $activeSlave.amp == -1>> and has been equipped with modern prosthetics. <<elseif $activeSlave.amp == -2>> @@ -1261,11 +1261,11 @@ Work on her structurally: <<if $cyberMod == 0>> <<if $activeSlave.amp == 0>> <<if ($activeSlave.indentureRestrictions < 1) && ($seeExtreme == 1)>> - [[Remove arms and legs|Surgery Degradation][$activeSlave.amp = 1,$activeSlave.heels = 0,$activeSlave.shoes = "none",$activeSlave.legAccessory = "none",$activeSlave.heightImplant = 0,$activeSlave.legsTat = 0,$activeSlave.armsTat = 0,$cash -= $surgeryCost, $activeSlave.health -= 40,$activeSlave.nails = 0,$surgeryType = "amp"]] //This will greatly restrict $possessive// + [[Remove arms and legs|Surgery Degradation][$activeSlave.amp = 1,$activeSlave.heels = 0,$activeSlave.shoes = "none",$activeSlave.legAccessory = "none",$activeSlave.heightImplant = 0,$activeSlave.legsTat = 0,$activeSlave.armsTat = 0,$cash -= $surgeryCost,$activeSlave.health -= 40,$activeSlave.nails = 0,$activeSlave.PLimb = 0,$surgeryType = "amp1"]] //This will greatly restrict $possessive// <</if>> - <<elseif $activeSlave.amp != 1>> + <<elseif $activeSlave.PLimb != 1 && $activeSlave.amp == 1>> <<if ($activeSlave.indentureRestrictions < 1) && ($seeExtreme == 1)>> - [[Detach artificial limbs|Surgery Degradation][$activeSlave.amp = 1,$activeSlave.heels = 0,$activeSlave.shoes = "none",$activeSlave.legAccessory = "none",$activeSlave.heightImplant = 0,$activeSlave.legsTat = 0,$activeSlave.armsTat = 0,$cash -= $surgeryCost, $activeSlave.health -= 40,$activeSlave.nails = 0,$surgeryType = "removeLimbs"]] //This will greatly restrict $possessive// + [[Implant prosthetic interface|Surgery Degradation][$activeSlave.PLimb = 1,$cash -= $surgeryCost,$activeSlave.health -= 20,$surgeryType = "prostheticInterface"]] //This will allow $possessive to use prosthetic limbs// <</if>> <</if>> <<else>> @@ -1306,233 +1306,139 @@ Work on her structurally: <br><br> <<set $activeLimbs = 0>> -<<for _i = 0; _i < $limbs.length; _i++>> - <<if $activeSlave.ID == $limbs[_i].ID>> - <<set $activeLimbs = $limbs[_i]>> - <<break>> - <</if>> -<</for>> +<<set _i = $limbs.findIndex(function(s) { return s.ID == $activeSlave.ID; })>> +<<if _i != -1>> + <<set $activeLimbs = $limbs[_i]>> +<</if>> <<if $activeLimbs == 0>> -The prosthesis facility is not currently building a set of artificial limbs for $object. - <br> - <<if $prostheticsUpgrade == 1>> - - <<link "Construct basic prosthetic limbs" && $activeSlave.readyLimbs.includes(-1) != 1>> - <<set $cash -= 10000>> - <<set $activeLimbs = {weeksToCompletion: 12, ID: 0, type: "simple"}>> - <<set $activeLimbs.ID = $activeSlave.ID>> - <<set $limbs.push($activeLimbs)>> - <<goto "Remote Surgery">> - <</link>> //Costs <<print cashFormat(10000)>>// - - <<elseif $prostheticsUpgrade == 2>> - <<if $activeSlave.amp >= 0>> - Construct prosthetics: - <<elseif $activeSlave.amp == -1>> - Upgrade $possessive prosthetics: - <<else>> - Modify $possessive prosthetics: - <</if>> - - <<if $activeSlave.amp != -1 && $activeSlave.readyLimbs.includes(-1) != 1>> - <<link "Basic prosthetic limbs">> - <<set $cash -= 10000>> - <<set $activeLimbs = {weeksToCompletion: 6, ID: 0, type: "simple"}>> - <<set $activeLimbs.ID = $activeSlave.ID>> - <<if $activeSlave.amp == 1>> - <<set $activeLimbs.weeksToCompletion += 3>> - <</if>> - <<set $limbs.push($activeLimbs)>> - <<goto "Remote Surgery">> - <</link>> //Costs <<print cashFormat(10000)>>// - <</if>> - | - <<if $activeSlave.amp != -2 && $activeSlave.readyLimbs.includes(-2) != 1>> - <<link "Sexual functions">> - <<set $cash -= 10000>> - <<set $activeLimbs = {weeksToCompletion: 6, ID: 0, type: "sex"}>> - <<set $activeLimbs.ID = $activeSlave.ID>> - <<if $activeSlave.amp == 1>> - <<set $activeLimbs.weeksToCompletion += 3>> - <</if>> - <<set $limbs.push($activeLimbs)>> - <<goto "Remote Surgery">> - <</link>> //Costs <<print cashFormat(10000)>>// - <</if>> - | - <<if $activeSlave.amp != -3 && $activeSlave.readyLimbs.includes(-3) != 1>> - <<link "Beauty and grace">> - <<set $cash -= 10000>> - <<set $activeLimbs = {weeksToCompletion: 6, ID: 0, type: "beauty"}>> - <<set $activeLimbs.ID = $activeSlave.ID>> - <<if $activeSlave.amp == 1>> - <<set $activeLimbs.weeksToCompletion += 3>> - <</if>> - <<set $limbs.push($activeLimbs)>> - <<goto "Remote Surgery">> - <</link>> //Costs <<print cashFormat(10000)>>// - <</if>> - | - <<if $activeSlave.amp != -4 && $activeSlave.readyLimbs.includes(-4) != 1>> - <<link "Combat effectiveness">> - <<set $cash -= 10000>> - <<set $activeLimbs = {weeksToCompletion: 6, ID: 0, type: "combat"}>> - <<set $activeLimbs.ID = $activeSlave.ID>> - <<if $activeSlave.amp == 1>> - <<set $activeLimbs.weeksToCompletion += 3>> - <</if>> - <<set $limbs.push($activeLimbs)>> - <<goto "Remote Surgery">> - <</link>> //Costs <<print cashFormat(10000)>>// - <</if>> - <<else>> - <<if $activeSlave.amp >= 0>> + <<if ($activeSlave.readyLimbs.length < 5 && $activeSlave.amp == 0) || ($activeSlave.readyLimbs.length < 4 && $activeSlave.amp < 0)>> /* missing at least one type of limb */ + The prosthesis facility is not currently building a set of artificial limbs for $object. + <br> Construct prosthetics: - <<elseif $activeSlave.amp == -1>> - Upgrade $possessive prosthetics: - <<else>> - Modify $possessive prosthetics: - <</if>> - - <<if $activeSlave.amp != -1 && $activeSlave.readyLimbs.includes(-1) != 1>> - <<link "Basic prosthetic limbs">> - <<set $cash -= 5000>> - <<set $activeLimbs = {weeksToCompletion: 6, ID: 0, type: "simple"}>> - <<set $activeLimbs.ID = $activeSlave.ID>> - <<if $activeSlave.amp == 1>> - <<set $activeLimbs.weeksToCompletion += 3>> + + <<if $activeSlave.amp != -1>> + <<set _rems = $activeSlave.readyLimbs.findIndex(function(s) { return s.type == -1; })>> + <<if _rems == -1>> + <<link "Basic prosthetic limbs">> + <<set $cash -= 10000>> + <<set $activeLimbs = {weeksToCompletion: 4, ID: 0, type: "simple"}>> + <<set $activeLimbs.ID = $activeSlave.ID>> + <<set $limbs.push($activeLimbs)>> + <<goto "Remote Surgery">> + <</link>> //Costs <<print cashFormat(10000)>> and will take 4 weeks// <</if>> - <<set $limbs.push($activeLimbs)>> - <<goto "Remote Surgery">> - <</link>> //Costs <<print cashFormat(5000)>>// <</if>> - <<if $activeSlave.amp != -2 && $activeSlave.readyLimbs.includes(-2) != 1>> - | - <<link "Sexual functions">> - <<set $cash -= 10000>> - <<set $activeLimbs = {weeksToCompletion: 6, ID: 0, type: "sex"}>> - <<set $activeLimbs.ID = $activeSlave.ID>> - <<if $activeSlave.amp == 1>> - <<set $activeLimbs.weeksToCompletion += 3>> + + <<if $prostheticsUpgrade > 1>> + <<if $activeSlave.amp != -2>> + <<set _rems = $activeSlave.readyLimbs.findIndex(function(s) { return s.type == -2; })>> + <<if _rems == -1>> + | + <<link "Sexual functions">> + <<set $cash -= 15000>> + <<set $activeLimbs = {weeksToCompletion: 6, ID: 0, type: "sex"}>> + <<set $activeLimbs.ID = $activeSlave.ID>> + <<if $activeSlave.amp == 1>> + <<set $activeLimbs.weeksToCompletion += 3>> + <</if>> + <<set $limbs.push($activeLimbs)>> + <<goto "Remote Surgery">> + <</link>> //Costs <<print cashFormat(15000)>> and will take 6 weeks// + <</if>> <</if>> - <<set $limbs.push($activeLimbs)>> - <<goto "Remote Surgery">> - <</link>> //Costs <<print cashFormat(10000)>>// - <</if>> - <<if $activeSlave.amp != -3 && $activeSlave.readyLimbs.includes(-3) != 1>> - | - <<link "Beauty and grace">> - <<set $cash -= 10000>> - <<set $activeLimbs = {weeksToCompletion: 6, ID: 0, type: "beauty"}>> - <<set $activeLimbs.ID = $activeSlave.ID>> - <<if $activeSlave.amp == 1>> - <<set $activeLimbs.weeksToCompletion += 3>> + + <<if $activeSlave.amp != -3>> + <<set _rems = $activeSlave.readyLimbs.findIndex(function(s) { return s.type == -3; })>> + <<if _rems == -1>> + | + <<link "Beauty and grace">> + <<set $cash -= 15000>> + <<set $activeLimbs = {weeksToCompletion: 6, ID: 0, type: "beauty"}>> + <<set $activeLimbs.ID = $activeSlave.ID>> + <<if $activeSlave.amp == 1>> + <<set $activeLimbs.weeksToCompletion += 3>> + <</if>> + <<set $limbs.push($activeLimbs)>> + <<goto "Remote Surgery">> + <</link>> //Costs <<print cashFormat(15000)>> and will take 6 weeks// + <</if>> <</if>> - <<set $limbs.push($activeLimbs)>> - <<goto "Remote Surgery">> - <</link>> //Costs <<print cashFormat(10000)>>// - <</if>> - <<if $activeSlave.amp != -4 && $activeSlave.readyLimbs.includes(-4) != 1>> - | - <<link "Combat effectiveness">> - <<set $cash -= 10000>> - <<set $activeLimbs = {weeksToCompletion: 6, ID: 0, type: "combat"}>> - <<set $activeLimbs.ID = $activeSlave.ID>> - <<if $activeSlave.amp == 1>> - <<set $activeLimbs.weeksToCompletion += 3>> + + <<if $activeSlave.amp != -4>> + <<set _rems = $activeSlave.readyLimbs.findIndex(function(s) { return s.type == -4; })>> + <<if _rems == -1>> + | + <<link "Combat effectiveness">> + <<set $cash -= 15000>> + <<set $activeLimbs = {weeksToCompletion: 6, ID: 0, type: "combat"}>> + <<set $activeLimbs.ID = $activeSlave.ID>> + <<if $activeSlave.amp == 1>> + <<set $activeLimbs.weeksToCompletion += 3>> + <</if>> + <<set $limbs.push($activeLimbs)>> + <<goto "Remote Surgery">> + <</link>> //Costs <<print cashFormat(15000)>> and will take 6 weeks// + <</if>> <</if>> - <<set $limbs.push($activeLimbs)>> - <<goto "Remote Surgery">> - <</link>> //Costs <<print cashFormat(10000)>>// <</if>> - <<if $activeSlave.amp != -5 && $activeSlave.readyLimbs.includes(-5) != 1>> - | - <<link "Highly advanced cybernetics">> - <<set $cash -= 15000>> - <<set $activeLimbs = {weeksToCompletion: 12, ID: 0, type: "cyber"}>> - <<set $activeLimbs.ID = $activeSlave.ID>> - <<if $activeSlave.amp == 1>> - <<set $activeLimbs.weeksToCompletion += 6>> + <<if $prostheticsUpgrade > 2>> + <<if $activeSlave.amp != -5>> + <<set _rems = $activeSlave.readyLimbs.findIndex(function(s) { return s.type == -5; })>> + <<if _rems == -1>> + | + <<link "Highly advanced cybernetics">> + <<set $cash -= 25000>> + <<set $activeLimbs = {weeksToCompletion: 8, ID: 0, type: "cyber"}>> + <<set $activeLimbs.ID = $activeSlave.ID>> + <<if $activeSlave.amp == 1>> + <<set $activeLimbs.weeksToCompletion += 6>> + <</if>> + <<set $limbs.push($activeLimbs)>> + <<goto "Remote Surgery">> + <</link>> //Costs <<print cashFormat(25000)>> and will take 8 weeks// + <</if>> <</if>> - <<set $limbs.push($activeLimbs)>> - <<goto "Remote Surgery">> - <</link>> //Costs <<print cashFormat(15000)>>// <</if>> + <<else>> + The prosthesis facility has already built a complete set of artificial limbs of every type for $object. <</if>> <<elseif $activeLimbs.weeksToCompletion > 0>> -The prosthesis facility is currently building a set of -<<switch $activeLimbs.type>> -<<case "cyber">> - highly advanced cybernetic -<<case "sex">> - advanced sex-focus artificial -<<case "beauty">> - advanced beauty-focus artificial -<<case "combat">> - advanced combat-focus artificial -<<default>> - standard artificial -<</switch>> - limbs for $object, which is projected to be ready for attachment in $activeLimbs.weeksToCompletion <<if $activeLimbs.weeksToCompletion == 1>>week<<else>>weeks<</if>>. - <<link "Discard">> - <<for _i = 0; _i < $limbs.length; _i++>> - <<if $activeSlave.ID == $limbs[_i].ID>> + The prosthesis facility is currently building a set of + <<switch $activeLimbs.type>> + <<case "cyber">> + highly advanced cybernetic + <<case "sex">> + advanced sex-focus artificial + <<case "beauty">> + advanced beauty-focus artificial + <<case "combat">> + advanced combat-focus artificial + <<default>> + standard artificial + <</switch>> + limbs for $object, which is projected to be ready for attachment in $activeLimbs.weeksToCompletion <<if $activeLimbs.weeksToCompletion == 1>>week<<else>>weeks<</if>>. + <<link "Discard">> + <<set _i = $limbs.findIndex(function(s) { return s.ID == $activeSlave.ID; })>> <<set $limbs.deleteAt(_i)>> - <<break>> - <</if>> - <</for>> - <<goto "Remote Surgery">> -<</link>> + <<goto "Remote Surgery">> + <</link>> <<else>> -The prosthesis facility has constructed $possessive prosthetic limbs. - <<if $activeSlave.amp < 1>> - <br> - ERROR: this slave is not amputated. - <<link "Discard">> - <<for _i = 0; _i < $limbs.length; _i++>> - <<if $activeSlave.ID == $limbs[_i].ID>> - <<set $limbs.deleteAt(_i)>> - <<break>> - <</if>> - <</for>> - <<goto "Remote Surgery">> - <</link>> - | - <<link "Put into storage">> - <<for _i = 0; _i < $limbs.length; _i++>> - <<if $activeSlave.ID == $limbs[_i].ID>> - <<break>> - <</if>> - <</for>> - - <<switch $limbs[_i].type>> - <<case "simple">> - <<set $activeSlave.readyLimbs.push(-1)>> - <<set $limbs.deleteAt(_i)>> - <<case "sex">> - <<set $activeSlave.readyLimbs.push(-2)>> - <<set $limbs.deleteAt(_i)>> - <<case "beauty">> - <<set $activeSlave.readyLimbs.push(-3)>> - <<set $limbs.deleteAt(_i)>> - <<case "combat">> - <<set $activeSlave.readyLimbs.push(-4)>> - <<set $limbs.deleteAt(_i)>> - <<case "cyber">> - <<set $activeSlave.readyLimbs.push(-5)>> - <<set $limbs.deleteAt(_i)>> - <</switch>> - <<goto "Remote Surgery">> - <</link>> + The prosthesis facility has constructed $possessive prosthetic limbs. + <br> + <<if $activeSlave.amp == 0>> + // $pronounCap must be an amputee to attach prosthetic limbs // + <<elseif $activeSlave.PLimb == 0>> + // $pronounCap must have a prosthetic interface installed to attack prosthetic limbs // <<else>> - <br> <<link "Attach">> - <<for _i = 0; _i < $limbs.length; _i++>> - <<if $activeSlave.ID == $limbs[_i].ID>> - <<break>> - <</if>> - <</for>> + <<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>> + <<set $activeSlave.readyLimbs.push(_oldLimbs)>> + <</if>> + + <<set _i = $limbs.findIndex(function(s) { return s.ID == $activeSlave.ID; })>> <<switch $limbs[_i].type>> <<case "simple">> @@ -1557,48 +1463,43 @@ The prosthesis facility has constructed $possessive prosthetic limbs. <<set $limbs.deleteAt(_i)>> <</switch>> <<set $cash -= $surgeryCost>> - <<set $activeSlave.health -= 10>> <<goto "Surgery Degradation">> <</link>> - | - <<link "Discard">> - <<for _i = 0; _i < $limbs.length; _i++>> - <<if $activeSlave.ID == $limbs[_i].ID>> - <<set $limbs.deleteAt(_i)>> - <<break>> - <</if>> - <</for>> - <<goto "Remote Surgery">> - <</link>> - | - <<link "Put into storage">> - <<for _i = 0; _i < $limbs.length; _i++>> - <<if $activeSlave.ID == $limbs[_i].ID>> - <<break>> - <</if>> - <</for>> - - <<switch $limbs[_i].type>> - <<case "simple">> - <<set $activeSlave.readyLimbs.push(-1)>> - <<set $limbs.deleteAt(_i)>> - <<case "sex">> - <<set $activeSlave.readyLimbs.push(-2)>> - <<set $limbs.deleteAt(_i)>> - <<case "beauty">> - <<set $activeSlave.readyLimbs.push(-3)>> - <<set $limbs.deleteAt(_i)>> - <<case "combat">> - <<set $activeSlave.readyLimbs.push(-4)>> - <<set $limbs.deleteAt(_i)>> - <<case "cyber">> - <<set $activeSlave.readyLimbs.push(-5)>> - <<set $limbs.deleteAt(_i)>> - <</switch>> - <<goto "Remote Surgery">> - <</link>> -<</if>> + <</if>> + | + <<link "Discard">> + <<set $limbs.deleteAt(_i)>> + <<goto "Remote Surgery">> + <</link>> + | + <<link "Put into storage">> + <<set _i = $limbs.findIndex(function(s) { return s.ID == $activeSlave.ID; })>> + <<set _newLimbs = {type: 0, armsTat: 0, legsTat: 0}>> + <<set _newLimbs.armsTat = $activeSlave.armsTat, _newLimbs.legsTat = $activeSlave.legsTat>> + + <<switch $limbs[_i].type>> + <<case "simple">> + <<set _newLimbs.type = -1>> + <<set $activeSlave.readyLimbs.push(_newLimbs)>> + <<case "sex">> + <<set _newLimbs.type = -2>> + <<set $activeSlave.readyLimbs.push(_newLimbs)>> + <<case "beauty">> + <<set _newLimbs.type = -3>> + <<set $activeSlave.readyLimbs.push(_newLimbs)>> + <<case "combat">> + <<set _newLimbs.type = -4>> + <<set $activeSlave.readyLimbs.push(_newLimbs)>> + <<case "cyber">> + <<set _newLimbs.type = -5>> + <<set $activeSlave.readyLimbs.push(_newLimbs)>> + <</switch>> + + <<set $limbs.deleteAt(_i)>> + <<goto "Remote Surgery">> + <</link>> <</if>> + <</if>> <</if>> /* CLOSES PROSTHESIS FACTORY */ <</if>> /* CyberMod Toggle */ diff --git a/src/uncategorized/slaveInteract.tw b/src/uncategorized/slaveInteract.tw index 6a8c81894a78797d99865a83fe77f3275935990e..0a63d8d634b08ad324884ab57f157b4187fc1ed6 100644 --- a/src/uncategorized/slaveInteract.tw +++ b/src/uncategorized/slaveInteract.tw @@ -409,11 +409,8 @@ <<if ndef $activeSlave.readyLimbs>> <<set $activeSlave.readyLimbs = []>> <</if>> -<<if $activeSlave.amp < 0 && $activeSlave.readyLimbs.includes($activeSlave.amp) <0>> /* imports current P-limbs to array for vanilla slaves */ - <<set $activeSlave.readyLimbs.push($activeSlave.amp)>> -<</if>> -<<if $activeSlave.readyLimbs.length > -1 && $activeSlave.amp != 0>> -<span id = "LimbOptions"><<include "Hotswap Prosthetics">></span> +<<if $activeSlave.readyLimbs.length > 0 && $activeSlave.PLimb == 1>> + <span id = "LimbOptions"><<include "Hotswap Prosthetics">></span> <</if>> /* END hotswap prosthetics */ <</if>>/* CyberMod Toggle */ diff --git a/src/uncategorized/surgeryDegradation.tw b/src/uncategorized/surgeryDegradation.tw index 391cea5b4969ef7f3e9f89eb898c11ba25a96365..99a179e7cf2c9037044b8df96ac10eeed157a632 100644 --- a/src/uncategorized/surgeryDegradation.tw +++ b/src/uncategorized/surgeryDegradation.tw @@ -25,7 +25,7 @@ <<set $seed = $activeSlave.devotion>> -<<if ($activeSlave.health < random(-100,-80)) && ($surgeryType != "braces") && ($surgeryType != "removeBraces")>> +<<if ($activeSlave.health < random(-100,-80)) && !["braces", "removeBraces", "basicPLimbs", "sexPLimbs", "beautyPLimbs", "combatPLimbs", "cyberPLimbs"].includes($surgeryType)>> $activeSlave.slaveName @@.red;has died from complications of surgery.@@ <<if $surgeryType == "ocular implant">>At least the ocular implants are still good.<<set $stockpile.ocularImplant++>><</if>> <<include "Remove activeSlave">> @@ -1396,16 +1396,51 @@ As the remote surgery's long recovery cycle completes, <<set $activeSlave.trust -= 50>> <<set $activeSlave.devotion -= 50>> <</if>> + +<<case "ampInterface">> + <<if ($activeSlave.devotion > 50)>> + Of course, she could not walk out of the surgery; you carried her. She knows what a slave's life is, but she did not really expect that it would ever come to this for her. Anesthesia has yet to completely wear off so it takes her a while to notice ports in her stumps. When she does, she visibly relaxes, realizing she may yet walk again. She squares her shoulders and visibly resolves to carry on being a good slave as best she can. Since the surgery was invasive, @@.red;her health has been greatly affected.@@ + <<elseif ($activeSlave.devotion > 20)>> + Of course, she could not walk out of the surgery; you carried her. Despite her obedience, she cries softly the whole time, shoulder and hip stumps moving occasionally as she reflexively tries to stand - to walk - to touch herself - to gesture - all things that she will never do again. She slightly calms down when she <<if canSee($activeSlave)>>sees<<else>>feels<</if>> ports installed in her stumps and realizes her immobility may not be permanent. Even so, she is still @@.gold;terrified@@ of your total power over her body. @@.mediumorchid;She will struggle greatly with her medically created disability.@@ Since the surgery was invasive, @@.red;her health has been greatly affected.@@ + <<set $activeSlave.trust -= 10>> + <<set $activeSlave.devotion -= 10>> + <<else>> + Of course, she could not walk out of the surgery; you carried her. You had a good idea what her reaction would be, so <<if ($activeSlave.teeth == "removable")>>you removed her teeth<<else>>she's muzzled<</if>> to prevent her from trying to bite. She sobs convulsively, and <<if canSee($activeSlave)>>seeing<<else>>noticing<</if>> ports installed in her stumps does little to stop her tears. @@.mediumorchid;The surgical invasion has filled her with horror and anger.@@ Since the surgery was invasive, @@.red;her health has been greatly affected.@@ She is @@.gold;terrified to the point of insanity@@ of your total power over her body. + <<set $activeSlave.trust -= 40>> + <<set $activeSlave.devotion -= 40>> + <</if>> + +<<case "prostheticInterface">> + When she is carried out of surgery she <<if canSee($activeSlave)>>cranes her neck to better see the ports<<else>>wiggles her stumps trying to feel the ports<</if>> installed in her stumps. Recovery will be @@.red;significant,@@ since the surgical implantation of anchor points for the limbs themselves and the installation of nerve impulse detectors constituted major surgery. + <<if $activeSlave.devotion > 20>> + Nevertheless, she's @@.hotpink;overwhelmed with gratitude,@@ and thanks you profusely the first chance she gets. She follows the acclimation program diligently, doing her best to learn how to be a good slave despite, or sometimes even because of, her disability. She @@.mediumaquamarine;places more trust in you,@@ too, since you obviously have her best interests at heart. + <<set $activeSlave.devotion += 5>> + <<set $activeSlave.trust += 5>> + <<elseif $activeSlave.devotion >= -20>> + She's @@.hotpink;overwhelmed with gratitude,@@ in part because she didn't think you'd do something like this for her. She thanks you profusely the first chance she gets, and follows the acclimation program diligently, trying to deserve the expense you went to. She @@.mediumaquamarine;places more trust in you,@@ too, since you seem to have a plan for her. + <<set $activeSlave.devotion += 5>> + <<set $activeSlave.trust += 5>> + <<else>> + Despite her hatred of you, she can't help but @@.mediumaquamarine;trust you a bit more,@@ since you clearly have a plan that involves putting a good deal of value into her. Your goals might not be hers, but at least she has an indication that you're not toying with her. + <<set $activeSlave.trust += 5>> + <</if>> <<case "amp1">> <<set $nextLink = "Surgery Degradation", $surgeryType = "amp">> - Since you invested in cybernetic technology you can install PLimb interface into her body during the operation.<br> - Procedure will put additional strain on her health but less so than if you were to perform the procedures separately.<br> - <<if $stockpile.basicPLimbInterface > 0>> - [[Install basic interface|Surgery Degradation][$activeSlave.PLimb = 1, $activeSlave.health -= 10, $stockpile.basicPLimbInterface -= 1, $surgeryType = "amp2", $nextLink = "Remote Surgery"]] - <br><</if>> - <<if $stockpile.advPLimbInterface > 0>> - [[Install advanced interface|Surgery Degradation][$activeSlave.PLimb = 2, $activeSlave.health -= 10, $stockpile.advPLimbInterface -= 1, $surgeryType = "amp2", $nextLink = "Remote Surgery"]] + <<if $cyberMod == 0>> + During the procedure you may install a prosthetic interface so that she may use prosthetic limbs immediately afterwards.<br> + This will cost extra and put further strain on $activeSlave.slaveName's health, but choosing to do this now will be cheaper and be less damaging to her health than if you were to perform the procedures separately.<br> + [[Install prosthetic interface|Surgery Degradation][$activeSlave.PLimb = 1, $activeSlave.health -= 10, $surgeryType = "ampInterface", $cash -= Math.trunc($surgeryCost/2)]]<br> + [[Only perform amputation|Surgery Degradation][$surgeryType = "amp"]] + <<else>> + Since you invested in cybernetic technology you can install PLimb interface into her body during the operation.<br> + Procedure will put additional strain on her health but less so than if you were to perform the procedures separately.<br> + <<if $stockpile.basicPLimbInterface > 0>> + [[Install basic interface|Surgery Degradation][$activeSlave.PLimb = 1, $activeSlave.health -= 10, $stockpile.basicPLimbInterface -= 1, $surgeryType = "amp2", $nextLink = "Remote Surgery"]] + <br><</if>> + <<if $stockpile.advPLimbInterface > 0>> + [[Install advanced interface|Surgery Degradation][$activeSlave.PLimb = 2, $activeSlave.health -= 10, $stockpile.advPLimbInterface -= 1, $surgeryType = "amp2", $nextLink = "Remote Surgery"]] + <</if>> <</if>> <<case "amp2">> @@ -2148,10 +2183,10 @@ As the remote surgery's long recovery cycle completes, <</switch>> -<<if ($PC.medicine >= 100)>> +<<if ($PC.medicine >= 100) && !["basicPLimbs", "sexPLimbs", "beautyPLimbs", "combatPLimbs", "cyberPLimbs"].includes($surgeryType)>> <br><br> - Since you @@.springgreen;performed the surgery yourself,@@ and you do artist's work, her health is @@.green;less affected@@ by the surgery than it would have been if you'd paid some hack to do it remotely. <<if ($surgeryType != "braces") && ($surgeryType != "removeBraces")>> + Since you @@.springgreen;performed the surgery yourself,@@ and you do artist's work, her health is @@.green;less affected@@ by the surgery than it would have been if you'd paid some hack to do it remotely. <<set $activeSlave.health += 5>> <</if>> <<if ($activeSlave.fetish != "mindbroken")>>