diff --git a/devNotes/limb functions.md b/devNotes/limb functions.md index 94bf3478a9bd3078e391821ecb566abb28fb62d3..891727b6b155a3b349ae3c6001da62f49d78000f 100644 --- a/devNotes/limb functions.md +++ b/devNotes/limb functions.md @@ -1,4 +1,4 @@ -## Basic documentation for the limb access functions coming with the new limb system. +## Basic documentation for the limb access functions in the new limb system. ### ID system @@ -28,83 +28,75 @@ Most functions can be used like this, though some are more specialized. ### Functions: -`isAmputee(slave)`: +#### Read-only functions: + +* `isAmputee(slave)`: True if slave has no limbs, neither natural nor prosthetic. -`hasAnyNaturalLimbs(slave)`: +* `hasAnyNaturalLimbs(slave)`: True if slave has at least one natural limb. -`hasAnyProstheticLimbs(slave)`: +* `hasAnyProstheticLimbs(slave)`: True if slave has at least one prosthetic limb. -`hasAnyLegs(slave)`: +* `hasAnyLegs(slave)`: True if slave has at least one leg. -`hasAnyArms(slave)`: +* `hasAnyArms(slave)`: True if slave has at least one arm. -`hasAnyNaturalLegs(slave)`: +* `hasAnyNaturalLegs(slave)`: True if slave has at least one leg that is natural -`hasAnyNaturalArms(slave)`: +* `hasAnyNaturalArms(slave)`: True if slave has at least one arm that is natural -`hasAnyProstheticArms(slave)`: +* `hasAnyProstheticArms(slave)`: True if slave has at least one arm that is prosthetic -`hasBothLegs(slave)`: +* `hasBothLegs(slave)`: True if slave has both legs. -`hasBothArms(slave)`: +* `hasBothArms(slave)`: True if slave has both arms. -`hasBothNaturalLegs(slave)`: +* `hasBothNaturalLegs(slave)`: True if slave has both legs and they are natural. -`hasBothNaturalArms(slave)`: +* `hasBothNaturalArms(slave)`: True if slave has both arms and they are natural. -`hasAllLimbs(slave)`: +* `hasAllLimbs(slave)`: True if slave has all limbs. -`hasAllNaturalLimbs(slave)`: +* `hasAllNaturalLimbs(slave)`: True if slave has all limbs and all are natural. -`hasLeftArm(slave)`: +* `hasLeftArm(slave)`: True if slave has a left arm. -`hasRightArm(slave)`: +* `hasRightArm(slave)`: True if slave has a right arm. -`hasLeftLeg(slave)`: +* `hasLeftLeg(slave)`: True if slave has a left leg. -`hasRightLeg(slave)`: +* `hasRightLeg(slave)`: True if slave has a right leg. -`getLeftArmID(slave)`: +* `getLeftArmID(slave)`: Returns limb ID of the left arm. -`getRightArmID(slave)`: +* `getRightArmID(slave)`: Returns limb ID of the right arm. -`getLeftLegID(slave)`: +* `getLeftLegID(slave)`: Returns limb ID of the left leg. -`getRightLegID(slave)`: +* `getRightLegID(slave)`: Returns limb ID of the right leg. -`idToDescription(id)`: - Returns a very short description of the specified limb ID. - 0: "amputated"; - 1: "healthy"; - 2: "modern prosthetic"; - 3: "advanced, sex-focused prosthetic"; - 4: "advanced, beauty-focused prosthetic"; - 5: "advanced, combat-focused prosthetic"; - 6: "highly advanced cybernetic"; - -`getLimbCount(slave, id)`: +* `getLimbCount(slave, id)`: Returns count of specified limb ID. Can also be used to check for groups: 101: any limbs that are not amputated @@ -113,19 +105,47 @@ Most functions can be used like this, though some are more specialized. 104: beauty-prosthetic 105: combat-prosthetic -103-105 mean the sum of 3-5 and 6 respectfully. + 103-105 mean the sum of 3-5 and 6 respectfully. -`getLegCount(slave, id)`: +* `getLegCount(slave, id)`: Returns count of legs with specified limb ID. -`getArmCount(slave, id)`: +* `getArmCount(slave, id)`: Returns count of arms with specified limb ID. -`armsAndLegs(slave, arms, arm, legs, leg)`: +#### String functions + +* `idToDescription(id)`: + Returns a very short description of the specified limb ID. + 0: "amputated"; + 1: "healthy"; + 2: "modern prosthetic"; + 3: "advanced, sex-focused prosthetic"; + 4: "advanced, beauty-focused prosthetic"; + 5: "advanced, combat-focused prosthetic"; + 6: "highly advanced cybernetic"; + +* `armsAndLegs(slave, arms, arm, legs, leg)`: Returns a string depending on the limbs a slave has. By default this is a - variation of `arms and legs`, but this can be changed via parameters. + variation of `arms and legs`, but this can be changed via parameters. + + Examples: + `armsAndLegs(slave, "hands", "hand", "feet", foot)` returns `hands and feet` for a slave with all limbs, + `hand and foot` for a slave with one limb each and `feet` for a slave with two legs, but no arms. + + Expects the slave to have at least one limb. Only the first parameter is mandatory, the rest defaults to the + equivalent of `armsAndLegs(slave, "arms", "arm", "legs", "leg")` + +#### Write-only functions + +* `removeLimbs(slave, limb`: + Removes a slave's limbs. Allowed values for limb: `"left arm"`, `"right arm"`, `"left leg"`, `"right leg"`, `"all"`. -Examples: -`armsAndLegs(slave, "hands", "hand", "feet", foot)` returns `hands and feet` for a slave with all limbs, `hand and foot` for a slave with one limb each and `feet` for a slave with two legs, but no arms. +* `attachLimbs(slave, limb, id)`: + Attaches a limb of the specified id. Expects amputated limbs. Will overwrite existing limbs. + Allowed values for limb: `"left arm"`, `"right arm"`, `"left leg"`, `"right leg"`, `"all"`. -Expects the slave to have at least one limb. Only the first parameter is mandatory, the rest defaults to the equivalent of `armsAndLegs(slave, "arms", "arm", "legs", "leg")` +* `configureLimbs(slave, limb, id)`: + Sets the slave's limb to the specified id and sets all limb related variables to their correct values. + Intended for use during slave generation and events. + Allowed values for limb: `"left arm"`, `"right arm"`, `"left leg"`, `"right leg"`, `"all"`. \ No newline at end of file diff --git a/slave variables documentation - Pregmod.txt b/slave variables documentation - Pregmod.txt index b737cf777b33ad6f600efaf9cd40969f5632c350..5110e3aacc980b9563364ba6c30bfed6469e0ac7 100644 --- a/slave variables documentation - Pregmod.txt +++ b/slave variables documentation - Pregmod.txt @@ -3795,22 +3795,6 @@ are eyes missing? 2 - yes, right 3 - yes, both -missingArms: - -are arms missing? -0 - none -1 - yes, left -2 - yes, right -3 - yes, both - -missingLegs: - -are legs missing? -0 - none -1 - yes, left -2 - yes, right -3 - yes, both - geneMods: NCS: diff --git a/src/002-config/fc-version.js b/src/002-config/fc-version.js index 4d275c841cb4ef4f07c5eaab416d5424fbd60032..70b8bee2c7aefe72059d4e1ede6e35c545ba50b2 100644 --- a/src/002-config/fc-version.js +++ b/src/002-config/fc-version.js @@ -1,8 +1,8 @@ App.Version = { base: "0.10.8", pmod: "2.8.X", - release: 1051, + release: 1052, }; /* Use release as save version */ -Config.saves.version = App.Version.release; \ No newline at end of file +Config.saves.version = App.Version.release; diff --git a/src/Mods/SpecialForce/SpecialForce.js b/src/Mods/SpecialForce/SpecialForce.js index 96b72ae2d045fd34049b3edb83d21d0eb8241ddf..77f17dc9116b53dccde7725f78510e981426980b 100644 --- a/src/Mods/SpecialForce/SpecialForce.js +++ b/src/Mods/SpecialForce/SpecialForce.js @@ -2598,7 +2598,7 @@ App.SF.AAR = function(endWeekCall = 1) { r += `<br> <<link "Some Accountability">> <<set $SF.Regs = "some">> <<replace "#accountability">>''Some Accountability''<</replace>> <</link>> //Does not adjust force depravity.//`; r += `<br> <<link "No Accountability">> <<set $SF.Regs = "none">> <<replace "#accountability">>''No Accountability''<</replace>> <</link>> //Increases force depravity.//`; - r += `<br><br>Force depravity effects trade.`; + r += `<br><br>Force depravity affects trade.`; if (V.SF.MercCon.CanAttend === 1) { V.SF.MercCon.Income = 0; diff --git a/src/endWeek/saNanny.js b/src/endWeek/saNanny.js index 7e964661debfa056a50380eade5cd9be02ba5200..488a564d75d54762e1db19658228b1432415f75a 100644 --- a/src/endWeek/saNanny.js +++ b/src/endWeek/saNanny.js @@ -160,6 +160,7 @@ window.saNanny = function saNanny(slave) { t += ` and talented tongue`; } t += `. `; + /* TODO: farmer is often not set and makes no sense here. What should this be? LCD. if (slave.devotion < V.FarmerDevotionThreshold) { slave.devotion += V.FarmerDevotionBonus; } @@ -168,7 +169,7 @@ window.saNanny = function saNanny(slave) { } if (slave.health < 100) { slave.health += V.FarmerHealthBonus; - } + }*/ } return t; diff --git a/src/facilities/nursery/nursery.tw b/src/facilities/nursery/nursery.tw index 1fadd82fe4b915efe231920640a5f08f6e9abccc..98a737cb994bed67b6508296a542cc0f1dbe6765 100644 --- a/src/facilities/nursery/nursery.tw +++ b/src/facilities/nursery/nursery.tw @@ -378,7 +378,7 @@ Target age for release: <<textbox "$targetAgeNursery" $targetAgeNursery "Nursery <<if $nurseryUpgradeHormones>> <<if $nurseryHormonesSetting>> Artificial hormone levels ''are'' being managed; children may experience precocious puberty. - [Disable|Nursery][$nurseryHormonesSetting = 0]] + [[Disable|Nursery][$nurseryHormonesSetting = 0]] <<else>> Artificial hormones ''are not'' being given; children will undergo normal puberty. [[Activate|Nursery][$nurseryHormonesSetting = 1]] diff --git a/src/init/storyInit.tw b/src/init/storyInit.tw index 232b0566da7f86b3dce651fee2d2c13190b075d8..6174767faa679fbf16414867bef9dfa4155dd4cb 100644 --- a/src/init/storyInit.tw +++ b/src/init/storyInit.tw @@ -1371,7 +1371,7 @@ You should have received a copy of the GNU General Public License along with thi <<set $weatherToday = $niceWeather.random()>> <<set $customSlaveOrdered = 0>> -<<set $customSlave = {age: 19, health: 0, muscles: 0, lips: 15, heightMod: "normal", weight: 0, face: 0, race: "white", skin: "left natural", boobs: 500, butt: 3, sex: 1, virgin: 0, dick: 2, balls: 2, clit: 0, labia: 0, vaginaLube: 1, analVirgin: 0, skills: 15, skill: {whore: 15, combat: 0}, intelligence: 0, intelligenceImplant: 0, nationality: "Stateless", leg: {left: new App.Entity.LimbState(), right: new App.Entity.LimbState()}, arm: {left: new App.Entity.LimbState(), right: new App.Entity.LimbState()}, eyes: 1, hears: 0}>> +<<set $customSlave = {age: 19, health: 0, muscles: 0, lips: 15, heightMod: "normal", weight: 0, face: 0, race: "white", skin: "left natural", boobs: 500, butt: 3, sex: 1, virgin: 0, dick: 2, balls: 2, clit: 0, labia: 0, vaginaLube: 1, analVirgin: 0, skills: 15, skill: {whore: 15, combat: 0}, intelligence: 0, intelligenceImplant: 0, nationality: "Stateless", leg: {left: new App.Entity.LimbState(), right: new App.Entity.LimbState()}, arm: {left: new App.Entity.LimbState(), right: new App.Entity.LimbState()}, eyeball: {left: new App.Entity.EyeState(), right: new App.Entity.EyeState()}, eyes: 1, hears: 0}>> <<set $huskSlaveOrdered = 0>> <<set $huskSlave = {age: 18, nationality: "Stateless", race: "white", sex: 1, virgin: 0}>> diff --git a/src/interaction/prostheticConfig.tw b/src/interaction/prostheticConfig.tw index 7a732cfbff4c4bc42de8a75e58878723887f004d..f216763624706941d78f6e4892e3b76e6a0aad11 100644 --- a/src/interaction/prostheticConfig.tw +++ b/src/interaction/prostheticConfig.tw @@ -8,7 +8,7 @@ <<if $adjustProstheticsCompleted > 0>> <<set $adjustProsthetics = $adjustProsthetics.filter(function(p) { if (p.workLeft <= 0 && p.slaveID == $activeSlave.ID) { - $activeSlave.readyProsthetics.push({id: p.id}); + addProsthetic($activeSlave, p.id); $adjustProstheticsCompleted--; return false; } @@ -148,75 +148,16 @@ This room is lined with shelves and cabinets, it could be easily mistaken for a <</if>> <</if>> -<<if $activeSlave.readyProsthetics.length > 0>> - <br><br> - <<if $activeSlave.fuckdoll != 0>> - // A Fuckdoll can't use prosthetic limbs. // - <<elseif hasAnyNaturalLimbs($activeSlave)>> - // $He must be a quadruple amputee to attach prosthetic limbs. // - <<elseif $activeSlave.PLimb == 0>> - // $He must have a prosthetic interface installed to attach prosthetic limbs. // - <<else>> - /* Currently prosthetics are all or nothing; will be changed */ - <<if getLeftArmID($activeSlave) > 1>> - //$He currently has - <<switch getLeftArmID($activeSlave)>> - <<case 2>> <<= addA(setup.prosthetics.basicL.name)>> - <<case 3>> <<= addA(setup.prosthetics.sexL.name)>> - <<case 4>> <<= addA(setup.prosthetics.beautyL.name)>> - <<case 5>> <<= addA(setup.prosthetics.combatL.name)>> - <<case 6>> <<= addA(setup.prosthetics.cyberneticL.name)>> - <</switch>> - installed.//<br> - <<link "Detach <<= $his>> limbs" "Prosthetics Configuration">> - <<set removeLimbs($activeSlave, "all"), $prostheticsConfig = "removeLimbs">> - <</link>> - <br><br> - <</if>> - /* TODO save .legsTat and .armsTat / link them to prosthetic*/ - <<if getLeftArmID($activeSlave) !== 2 && $activeSlave.readyProsthetics.findIndex(function(p) {return p.id == "basicL"}) != -1>> - <<link "Attach <<= addA(setup.prosthetics.basicL.name)>>" "Prosthetics Configuration">> - <<set removeLimbs($activeSlave, "all"), attachLimbs($activeSlave, "all", 2), $prostheticsConfig = "basicPLimbs">> - <</link>> - <br> - <</if>> - <<if getLeftArmID($activeSlave) !== 3 && $activeSlave.readyProsthetics.findIndex(function(p) {return p.id == "sexL"}) != -1>> - <<link "Attach <<= addA(setup.prosthetics.sexL.name)>>" "Prosthetics Configuration">> - <<set removeLimbs($activeSlave, "all"), attachLimbs($activeSlave, "all", 3), $prostheticsConfig = "sexPLimbs">> - <</link>> - <br> - <</if>> - <<if getLeftArmID($activeSlave) !== 4 && $activeSlave.readyProsthetics.findIndex(function(p) {return p.id == "beautyL"}) != -1>> - <<link "Attach <<= addA(setup.prosthetics.beautyL.name)>>" "Prosthetics Configuration">> - <<set removeLimbs($activeSlave, "all"), attachLimbs($activeSlave, "all", 4), $prostheticsConfig = "beautyPLimbs">> - <</link>> - <br> - <</if>> - <<if getLeftArmID($activeSlave) !== 5 && $activeSlave.readyProsthetics.findIndex(function(p) {return p.id == "combatL"}) != -1>> - <<link "Attach <<= addA(setup.prosthetics.combatL.name)>>" "Prosthetics Configuration">> - <<set removeLimbs($activeSlave, "all"), attachLimbs($activeSlave, "all", 5), $prostheticsConfig = "combatPLimbs">> - <</link>> - <br> - <</if>> - <<if getLeftArmID($activeSlave) !== 6 && $activeSlave.readyProsthetics.findIndex(function(p) {return p.id == "cyberneticL"}) != -1>> - <<if $activeSlave.PLimb == 2>> - <<link "Attach <<= addA(setup.prosthetics.cyberneticL.name)>>" "Prosthetics Configuration">> - <<set removeLimbs($activeSlave, "all"), attachLimbs($activeSlave, "all", 6), $prostheticsConfig = "cyberPLimbs">> - <</link>> - <<else>> - // $He must have <<= addA(setup.prosthetics.interfaceP2.name)>> installed to attach <<= addA(setup.prosthetics.cyberneticL.name)>>. // - <</if>> - <</if>> - <</if>> -<</if>> +<<= App.Desc.limbChange().selector($activeSlave, App.Desc.limbChange().currentLimbs($activeSlave))>> -<<if $activeSlave.PTail == 1>><br><br> +<<if $activeSlave.PTail == 1>> + <br><br> $He has a neural tail interface installed. You can assign and adjust $his tail here. <<if $activeSlave.tail != "none">><br> $He currently has a tail attached, if you wish to change it you will first need to detach it.<br> [[Detach|Prosthetics Configuration][$prostheticsConfig = "detachTail",$nextButton = "Continue", $nextLink = "Prosthetics Configuration"]] <<else>><br> - <<if $activeSlave.readyProsthetics.findIndex(function(p) {return p.id == "modT"}) != -1>> + <<if isProstheticAvailable($activeSlave, "modT")>> Attach a modular tail designed to look like a:<br> [[Cat's Tail|Prosthetics Configuration][$prostheticsConfig = "attachTail", $activeSlave.tail = "mod", $activeSlave.tailShape = "neko", $activeSlave.tailColor = $activeSlave.hColor]] | [[Dog's Tail|Prosthetics Configuration][$prostheticsConfig = "attachTail", $activeSlave.tail = "mod", $activeSlave.tailShape = "inu", $activeSlave.tailColor = $activeSlave.hColor]] @@ -226,10 +167,10 @@ This room is lined with shelves and cabinets, it could be easily mistaken for a | [[Cow's Tail|Prosthetics Configuration][$prostheticsConfig = "attachTail", $activeSlave.tail = "mod", $activeSlave.tailColor = "ushi", $activeSlave.tailColor = $activeSlave.hColor]] <br> <</if>> - <<if $activeSlave.readyProsthetics.findIndex(function(p) {return p.id == "combatT"}) != -1>> + <<if isProstheticAvailable($activeSlave, "combatT")>> [[Attach Combat Tail|Prosthetics Configuration][$prostheticsConfig = "attachTail", $activeSlave.tail = "combat", $activeSlave.tailColor = "jet black"]] <</if>> - <<if $activeSlave.readyProsthetics.findIndex(function(p) {return p.id == "sexT"}) != -1>> + <<if isProstheticAvailable($activeSlave, "sexT")>> | [[Attach Pleasure Tail|Prosthetics Configuration][$prostheticsConfig = "attachTail", $activeSlave.tail = "sex", $activeSlave.tailColor = "pink"]] <</if>> <</if>> @@ -293,7 +234,7 @@ Fit prosthetics to $him: <div class="full">//Already being fitted to $him.//</div> <<elseif setup.prosthetics[_p].level > $prostheticsUpgrade>> <div class="full">//Better contracts needed to buy this.//</div> - <<elseif $activeSlave.readyProsthetics.findIndex(function(p) {return p.id == _p}) != -1>> + <<elseif isProstheticAvailable($activeSlave, _p)>> <div class="full">//Completed.//</div> <<else>> <<capture _p>> @@ -342,6 +283,12 @@ Fit prosthetics to $him: $He has a panicked expression when $his vision suddenly goes out. <</if>> +<<case "limbs">> + <<set $prostheticsConfig = "main", $nextButton = "Continue", $nextLink = "Prosthetics Configuration">> + <<= App.Desc.limbChange().reaction($activeSlave, $oldLimbs)>> + <<unset $oldLimbs>> + +/* <<case "basicPLimbs">> <<set $prostheticsConfig = "main", $nextButton = "Continue", $nextLink = "Prosthetics Configuration">> Attaching $his limbs is a simple procedure, you simply push a connector on each limb into the socket in $his implants until the lock engages.<<if $activeSlave.PLimb == 2>> $He jumps a bit as limbs connect to $his nerves.<</if>> @@ -416,6 +363,7 @@ Fit prosthetics to $him: <<else>> You order $him to lie down on the table and proceed to remove $his limbs. $He <<if canSee($activeSlave)>>watches<<elseif canHear($activeSlave)>>listens<<else>>waits<</if>> with a bitter expression as you work. <</if>> +*/ <<case "hearing">> <<set $prostheticsConfig = "main", $nextButton = "Continue", $nextLink = "Prosthetics Configuration">> @@ -459,11 +407,12 @@ Fit prosthetics to $him: <<else>>admires $his new tail. <</if>> +/* <<case "interface">> <span id="attach"> <<set _first = 1>> /*TODO save .legsTat and .armsTat / link them to prosthetic*/ - <<if getLeftArmID($activeSlave) !== 2 && $activeSlave.readyProsthetics.findIndex(function(p) {return p.id == "basicL"}) != -1>> +/* <<if getLeftArmID($activeSlave) !== 2 && isProstheticAvailable($activeSlave, "basicL")) != -1>> <<if _first>> <br><br>Since you already have prepared limbs for $him you might as well attach them while you are working on $him:<br> <<set _first = 0>> @@ -474,7 +423,7 @@ Fit prosthetics to $him: <</link>> <br> <</if>> - <<if getLeftArmID($activeSlave) !== 3 && $activeSlave.readyProsthetics.findIndex(function(p) {return p.id == "sexL"}) != -1>> + <<if getLeftArmID($activeSlave) !== 3 && isProstheticAvailable($activeSlave, "sexL"))>> <<if _first>> <br><br>Since you already have prepared limbs for $him you might as well attach them while you are working on $him:<br> <<set _first = 0>> @@ -485,7 +434,7 @@ Fit prosthetics to $him: <</link>> <br> <</if>> - <<if getLeftArmID($activeSlave) !== 4 && $activeSlave.readyProsthetics.findIndex(function(p) {return p.id == "beautyL"}) != -1>> + <<if getLeftArmID($activeSlave) !== 4 && isProstheticAvailable($activeSlave, "beautyL")>> <<if _first>> <br><br>Since you already have prepared limbs for $him you might as well attach them while you are working on $him:<br> <<set _first = 0>> @@ -496,7 +445,7 @@ Fit prosthetics to $him: <</link>> <br> <</if>> - <<if getLeftArmID($activeSlave) !== 5 && $activeSlave.readyProsthetics.findIndex(function(p) {return p.id == "combatL"}) != -1>> + <<if getLeftArmID($activeSlave) !== 5 && isProstheticAvailable($activeSlave, "combatL")>> <<if _first>> <br><br>Since you already have prepared limbs for $him you might as well attach them while you are working on $him:<br> <<set _first = 0>> @@ -507,7 +456,7 @@ Fit prosthetics to $him: <</link>> <br> <</if>> - <<if getLeftArmID($activeSlave) !== 6 && $activeSlave.readyProsthetics.findIndex(function(p) {return p.id == "cyberneticL"}) != -1>> + <<if getLeftArmID($activeSlave) !== 6 && isProstheticAvailable($activeSlave, "cyberneticL")>> <<if $activeSlave.PLimb == 2>> <<if _first>> <br><br>Since you already have prepared limbs for $him you might as well attach them while you are working on $him:<br> @@ -520,5 +469,5 @@ Fit prosthetics to $him: <</if>> <</if>> </span> - +*/ <</switch>> diff --git a/src/interaction/prothesticLab.tw b/src/interaction/prothesticLab.tw index 574c44cf8c048c9b9f2b040b9d6eb32b5389fbfc..a406a5226ffc5640e9afa935c1a847f6c1e3e829 100644 --- a/src/interaction/prothesticLab.tw +++ b/src/interaction/prothesticLab.tw @@ -7,10 +7,12 @@ Prosthetic Lab <hr><br> -<<if $adjustProsthetics.length > 0>> +<<if $adjustProsthetics.length > $adjustProstheticsCompleted>> Currently adjusting these prosthetics:<br> <<for _p range $adjustProsthetics>> - <<= capFirstChar(setup.prosthetics[_p.id].name)>> for <<= SlaveFullName($slaves[$slaveIndices[_p.slaveID]])>><br> + <<if _p.workLeft > 0>> + <<= capFirstChar(setup.prosthetics[_p.id].name)>> for <<= SlaveFullName($slaves[$slaveIndices[_p.slaveID]])>><br> + <</if>>s <</for>> <<else>> //Currently there are no prosthetics being fit to a slave.// diff --git a/src/js/DefaultRules.js b/src/js/DefaultRules.js index ea9fed1411981de74e8743b79d4b162d211f2df5..34afaac5ba197a9d3af86489429d0df1605c6c27 100644 --- a/src/js/DefaultRules.js +++ b/src/js/DefaultRules.js @@ -2627,7 +2627,13 @@ window.DefaultRules = (function() { } else { slave.earPiercing = rule.earPiercing; cashX(forceNeg(V.modCost), "slaveMod", slave); - r += `<br>${slave.slaveName}'s ears have been pierced.`; + r += `<br>${slave.slaveName}'s ` + if (hasBothEars(slave)) { + r += `ears have`; + } else { + r += `ear has`; + } + r += ` been pierced.`; } } } diff --git a/src/js/SlaveState.js b/src/js/SlaveState.js index f0e8655811edfc2b152ae5a0a1f8ebd1687e3975..9530af4bc8cd81a645293456883678131cd4ab14 100644 --- a/src/js/SlaveState.js +++ b/src/js/SlaveState.js @@ -366,6 +366,64 @@ App.Entity.LimbState = class LimbState { } }; +/** + * To ensure that all new eyes contain expected attributes + */ +App.Entity.EyeState = class EyeState { + constructor() { + /** + * type of eye + * * 1: normal + * * 2: glass + * * 3: cybernetic + */ + this.type = 1; + /** + * vision of eye + * * 1: normal + * * 2: impaired + * * 3: blind + */ + this.see = 1; + /** + * current eye color + */ + this.iris = "brown"; + /** + * original eye color + */ + this.orig = "brown"; + /** + * pupil shape + */ + this.pupil = "circular"; + /** + * sclera color + */ + this.sclera = "white"; + } +}; + +App.Entity.EarState = class EarState { + constructor() { + /** + * level of piercing + * * 0: none + * * 1: light + * * 2: heavy + */ + this.piercing = 0; + this.shape = "normal" + /** + * level of damage + * * 0: none + * * 1: light + * * 2: heavy + */ + this.damage = 0; + } +}; + App.Entity.SlaveState = class SlaveState { constructor() { /** Slave's current name */ @@ -608,6 +666,13 @@ App.Entity.SlaveState = class SlaveState { this.sclerae = "white"; /** "none", "glasses", "blurring glasses", "corrective glasses", "blurring contacts", "corrective contacts" */ this.eyewear = "none"; + /** + * eyes of the slave + */ + this.eyeball = { + left: new App.Entity.EyeState(), + right: new App.Entity.EyeState() + }; /** slave hearing * * -2: deaf; -1: hard of hearing; 0: normal */ @@ -626,6 +691,13 @@ App.Entity.SlaveState = class SlaveState { /** kemonomimi ear color * "hairless" */ this.earTColor = "hairless"; + /** + * ears of the slave + */ + this.auricle = { + left: new App.Entity.EarState(), + right: new App.Entity.EarState() + }; /** sense of smell 0 - yes, -1 - no */ this.smells = 0; @@ -2409,10 +2481,6 @@ App.Entity.SlaveState = class SlaveState { /** @type {{skin:string, eyeColor:string, hColor:string}} */ this.albinismOverride = null; /* eslint-enable */ - /** are eyes missing? - * - * 0: none; 1: yes, left; 2: yes, right; 3: yes, both */ - this.missingEyes = 0; /** Amount of cash paid to acquire the slave * * accepts negative numbers, 0, or 1. @@ -2448,6 +2516,7 @@ App.Entity.SlaveState = class SlaveState { return { arm: {left: {}, right: {}}, leg: {left: {}, right: {}}, + readyProsthetics: [], // yes, not an object, but needed for hero slaves counter: {}, brand: {}, scar: {}, diff --git a/src/js/datatypeCleanupJS.js b/src/js/datatypeCleanupJS.js index 6a3a5f73fd46e059438dfd705ae8a53c66e1bf4f..16be4e587e553fa15c339bfe5ab9313b01ea6a20 100644 --- a/src/js/datatypeCleanupJS.js +++ b/src/js/datatypeCleanupJS.js @@ -984,7 +984,6 @@ window.SlaveDatatypeCleanup = (function SlaveDatatypeCleanup() { } slave.electrolarynx = Math.clamp(+slave.electrolarynx, 0, 1) || 0; slave.accent = Math.clamp(+slave.accent, 0, 3) || 0; - slave.missingEyes = Math.clamp(+slave.missingEyes, 0, 3) || 0; if (typeof slave.ballType !== "string") { slave.ballType = "human"; } diff --git a/src/js/descriptionWidgets.js b/src/js/descriptionWidgets.js index a241e3a949055c6a46b318bdcbcf8a1bee0d0a14..22398e5fb2190a50f99509436c2b94e4bf45a245 100644 --- a/src/js/descriptionWidgets.js +++ b/src/js/descriptionWidgets.js @@ -1016,8 +1016,8 @@ App.Desc.limbs = function(slave) { /* eslint-enable */ /* TODO Arkerthan - description similar in style to the commented out one instead of this simple version. - */ + description similar in style to the commented out one instead of this simple version. + */ if (isAmputee(slave)) { r += `${He} is a quadruple amputee and has not been equipped with prosthetics`; @@ -1250,7 +1250,7 @@ App.Desc.shortLimbs = function(slave) { r += " Heel "; } - return r; + return r; }; /** diff --git a/src/js/eventSelectionJS.js b/src/js/eventSelectionJS.js index 2ba5061c4c3caf22efef4070d514ed8d92a6139f..a0ed57b6376009b7fa03365cb3c8f97457e419c6 100644 --- a/src/js/eventSelectionJS.js +++ b/src/js/eventSelectionJS.js @@ -873,17 +873,8 @@ window.generateRandomEventPoolStandard = function(eventSlave) { if (eventSlave.ovaries === 1) { if (eventSlave.pubertyXX === 0) { if (eventSlave.preg === 0) { - if (eventSlave.physicalAge >= eventSlave.pubertyAgeXX - 0.5) { - State.variables.RESSevent.push("first period"); - State.variables.RESSevent.push("first period"); - State.variables.RESSevent.push("first period"); - State.variables.RESSevent.push("first period"); - State.variables.RESSevent.push("first period"); - State.variables.RESSevent.push("first period"); - State.variables.RESSevent.push("first period"); - State.variables.RESSevent.push("first period"); - State.variables.RESSevent.push("first period"); - State.variables.RESSevent.push("first period"); + if (eventSlave.physicalAge + eventSlave.birthWeek / 52 >= eventSlave.pubertyAgeXX - 0.5) { + State.variables.RESSevent.push(...Array.from({length:10}, i=>"first period")); } } } @@ -891,17 +882,8 @@ window.generateRandomEventPoolStandard = function(eventSlave) { if (canPenetrate(eventSlave)) { if (eventSlave.balls > 0) { if (eventSlave.pubertyXY === 0) { - if (eventSlave.physicalAge >= eventSlave.pubertyAgeXY - 0.5) { - State.variables.RESSevent.push("wet dreams"); - State.variables.RESSevent.push("wet dreams"); - State.variables.RESSevent.push("wet dreams"); - State.variables.RESSevent.push("wet dreams"); - State.variables.RESSevent.push("wet dreams"); - State.variables.RESSevent.push("wet dreams"); - State.variables.RESSevent.push("wet dreams"); - State.variables.RESSevent.push("wet dreams"); - State.variables.RESSevent.push("wet dreams"); - State.variables.RESSevent.push("wet dreams"); + if (eventSlave.physicalAge + eventSlave.birthWeek / 52 >= eventSlave.pubertyAgeXY - 0.5) { + State.variables.RESSevent.push(...Array.from({length:10}, i=>"wet dreams")); } } } diff --git a/src/js/itemAvailability.js b/src/js/itemAvailability.js index 65e11bdb3a17ce0537bc10d78ce83db5cc0d99cc..2cd20284985f8fcbef14d6a9fc58666773d6d7bf 100644 --- a/src/js/itemAvailability.js +++ b/src/js/itemAvailability.js @@ -171,3 +171,88 @@ window.isItemAccessible = function(string) { return true; } }; + +/** + * @param {App.Entity.SlaveState} slave + * @param {string} prosthetic + * @returns {boolean} + */ +window.isProstheticAvailable = function(slave, prosthetic) { + return slave.readyProsthetics.findIndex(function(p) { return p.id === prosthetic; }) !== -1; +}; + +/** + * @param {App.Entity.SlaveState} slave + * @param {string} prosthetic + */ +window.addProsthetic = function(slave, prosthetic) { + if (!isProstheticAvailable(slave, prosthetic)) { + let limb = prostheticToLimb(prosthetic); + if (limb > 0) { + let p = { + id: prosthetic, + arm: {left: new App.Entity.LimbState(), right: new App.Entity.LimbState()}, + leg: {left: new App.Entity.LimbState(), right: new App.Entity.LimbState()} + }; + p.arm.left.type = limb; + p.arm.right.type = limb; + p.leg.left.type = limb; + p.leg.right.type = limb; + slave.readyProsthetics.push(p); + } else { + slave.readyProsthetics.push({id: prosthetic}); + } + } +}; + +/** + * @param {App.Entity.SlaveState} slave + * @param {string} prosthetic + * @returns {{}} + */ +window.findProsthetic = function(slave, prosthetic) { + return slave.readyProsthetics.find(p => p.id === prosthetic); +}; + +/** + * @param {string} prosthetic + * @returns {number} + */ +window.prostheticToLimb = function(prosthetic) { + switch (prosthetic) { + case "basicL": + return 2; + case "sexL": + return 3; + case "beautyL": + return 4; + case "combatL": + return 5; + case "cyberneticL": + return 6; + default: + return 0; + } +}; + +/** + * + * @param {number} limb + * @returns {string} + */ +window.limbToProsthetic = function(limb) { + switch (limb) { + case 2: + return "basicL"; + case 3: + return "sexL"; + case 4: + return "beautyL"; + case 5: + return "combatL"; + case 6: + return "cyberneticL"; + default: + return ""; + } +}; diff --git a/src/js/slaveStatsChecker.js b/src/js/slaveStatsChecker.js index 016be3d2d6960aafff63458c2c17995c8ac9ad6a..a7af1e5eedef699e098316b47f181f9df5959d70 100644 --- a/src/js/slaveStatsChecker.js +++ b/src/js/slaveStatsChecker.js @@ -947,6 +947,16 @@ window.hasAnyNaturalArms = function(slave) { return getLeftArmID(slave) === 1 || getRightArmID(slave) === 1; }; +/** + * True if slave has at least one leg that is prosthetic + * + * @param {App.Entity.SlaveState} slave + * @returns {boolean} + */ +window.hasAnyProstheticLegs = function(slave) { + return getLeftLegID(slave) > 1 || getRightLegID(slave) > 1; +}; + /** * True if slave has at least one arm that is prosthetic * @@ -977,7 +987,6 @@ window.hasBothArms = function(slave) { return !!slave.arm.right && !!slave.arm.left; }; - /** * True if slave has both legs and they are natural * @@ -985,7 +994,7 @@ window.hasBothArms = function(slave) { * @returns {boolean} */ window.hasBothNaturalLegs = function(slave) { - return getLeftLegID(slave) === 1 && getRightLegID(slave) === 1; + return getLeftLegID(slave) === 1 && getRightLegID(slave) === 1; }; /** @@ -998,6 +1007,26 @@ window.hasBothNaturalArms = function(slave) { return getLeftArmID(slave) === 1 && getRightArmID(slave) === 1; }; +/** + * True if slave has both arms and they are artificial + * + * @param {App.Entity.SlaveState} slave + * @returns {boolean} + */ +window.hasBothProstheticArms = function(slave) { + return getLeftArmID(slave) > 1 && getRightArmID(slave) > 1; +}; + +/** + * True if slave has both legs and they are artificial + * + * @param {App.Entity.SlaveState} slave + * @returns {boolean} + */ +window.hasBothProstheticLegs = function(slave) { + return getLeftLegID(slave) > 1 && getRightLegID(slave) > 1; +}; + /** * True if slave has all limbs * @@ -1272,6 +1301,148 @@ window.armsAndLegs = function(slave, arms = "arms", arm = "arm", legs = "legs", return r; }; -window.isProstheticAvailable = function(slave, prosthetic) { - return slave.readyProsthetics.findIndex(function(p) { return p.id === prosthetic; }) !== -1; +/** + * True if slave has at least one eye + * + * @param {App.Entity.SlaveState} slave + * @returns {boolean} + */ +window.hasAnyEyes = function(slave) { + return !!slave.eyeball.right || !!slave.eyeball.left; +}; + +/** + * True if slave has at least one eye that is natural + * + * @param {App.Entity.SlaveState} slave + * @returns {boolean} + */ +window.hasAnyNaturalEyes = function(slave) { + return getLeftEyeID(slave) === 1 || getRightEyeID(slave) === 1; +}; + +/** + * True if slave has at least one eye that is prosthetic + * + * @param {App.Entity.SlaveState} slave + * @returns {boolean} + */ +window.hasAnyProstheticEyes = function(slave) { + return getLeftEyeID(slave) > 1 || getRightEyeID(slave) > 1; +}; + +/** + * True if slave has both eyes + * + * @param {App.Entity.SlaveState} slave + * @returns {boolean} + */ +window.hasBothEyes = function(slave) { + return !!slave.eyeball.right && !!slave.eyeball.left; +}; + +/** + * True if slave has both eyes and they are natural + * + * @param {App.Entity.SlaveState} slave + * @returns {boolean} + */ +window.hasBothNaturalEyes = function(slave) { + return getLeftEyeID(slave) === 1 && getRightEyeID(slave) === 1; +}; + +/** + * True if slave has both eyes and they are prosthetic + * + * @param {App.Entity.SlaveState} slave + * @returns {boolean} + */ +window.hasBothProstheticEyes = function(slave) { + return getLeftEyeID(slave) > 1 && getRightEyeID(slave) > 1; +}; + +/** + * True if slave has left eye + * + * @param {App.Entity.SlaveState} slave + * @returns {boolean} + */ +window.hasLeftEye = function(slave) { + return !!slave.eyeball.left; +}; +/** + * True if slave has right eye + * + * @param {App.Entity.SlaveState} slave + * @returns {boolean} + */ +window.hasRightEye = function(slave) { + return !!slave.eyeball.right; +}; + +/** + * Returns limb ID of the left eye. Uses new IDs. + * + * @param {App.Entity.SlaveState} slave + * @returns {number} + */ +window.getLeftEyeID = function(slave) { + if (hasLeftEye(slave)) { + return slave.eyeball.left.type; + } else { + return 0; + } +}; + +/** + * Returns limb ID of the right eye. Uses new IDs. + * + * @param {App.Entity.SlaveState} slave + * @returns {number} + */ +window.getRightEyeID = function(slave) { + if (hasRightEye(slave)) { + return slave.eyeball.right.type; + } else { + return 0; + } +}; + +/** + * True if slave has at least one ear + * + * @param {App.Entity.SlaveState} slave + * @returns {boolean} + */ +window.hasAnyEars = function(slave) { + return !!slave.auricle.right || !!slave.auricle.left; +}; + +/** + * True if slave has both ears + * + * @param {App.Entity.SlaveState} slave + * @returns {boolean} + */ +window.hasBothEars = function(slave) { + return !!slave.auricle.right && !!slave.auricle.left; +}; + +/** + * True if slave has left ear + * + * @param {App.Entity.SlaveState} slave + * @returns {boolean} + */ +window.hasLeftEar = function(slave) { + return !!slave.auricle.left; +}; +/** + * True if slave has right ear + * + * @param {App.Entity.SlaveState} slave + * @returns {boolean} + */ +window.hasRightEar = function(slave) { + return !!slave.auricle.right; }; diff --git a/src/js/surgery.js b/src/js/surgery.js index dcd5c5a92c8e0a80e04afe18b9ebc9cf0197cd51..b49e8082ff555321e7e851646e822a6ca713fe3c 100644 --- a/src/js/surgery.js +++ b/src/js/surgery.js @@ -1,4 +1,3 @@ - App.Medicine.Surgery = {}; /** * Composes the Procedure object from its parts @@ -137,6 +136,7 @@ App.Medicine.Surgery.ListHelpers = class { this._V = State.variables; this._showCCs = showCCs; } + /** * @param {string} name * @param {number} implantType @@ -453,25 +453,31 @@ App.Medicine.Surgery.sizingProcedures = function() { }(); /** -* Clean up extremities on removal or piercings, tats, and brands -* For limbs use removeLimbs() -* @param {App.Entity.SlaveState} slave -* @param {string} part -*/ + * Clean up extremities on removal or piercings, tats, and brands + * For limbs use removeLimbs() + * @param {App.Entity.SlaveState} slave + * @param {string} part + */ window.surgeryAmp = function(slave, part) { switch (part) { case "left ear": - slave.earShape = "none"; - slave.earT = "none"; + slave.auricle.left = null; delete slave.brand["left ear"]; - slave.earPiercing = 0; + if (!hasAnyEars(slave)) { + slave.earShape = "none"; + slave.earT = "none"; + slave.earPiercing = 0; + } slave.health -= 10; break; case "right ear": - slave.earShape = "none"; - slave.earT = "none"; + slave.auricle.right = null; delete slave.brand["right ear"]; - // slave.earPiercing = 0; + if (!hasAnyEars(slave)) { + slave.earShape = "none"; + slave.earT = "none"; + slave.earPiercing = 0; + } slave.health -= 10; break; case "dick": @@ -513,6 +519,20 @@ window.surgeryAmp = function(slave, part) { slave.skill.oral -= 10; } break; + case "left eye": + slave.eyeball.left = null; + if (!hasAnyEyes(slave)) { + slave.eyes = -4; + } + slave.health -= 20; + break; + case "right eye": + slave.eyeball.right = null; + if (!hasAnyEyes(slave)) { + slave.eyes = -4; + } + slave.health -= 20; + break; default: // eslint-disable-next-line no-console console.log(`ERROR: Unknown amputation type: ` + part); @@ -527,10 +547,22 @@ window.surgeryAmp = function(slave, part) { * @param {string} limb */ window.removeLimbs = function(slave, limb) { - // TODO: add bodymod support for prosthetics + function remove(limb, side) { + const prosthetic = findProsthetic(slave, limbToProsthetic(slave[limb][side].type)); + + if (prosthetic) { + prosthetic[limb][side] = slave[limb][side]; + } + + slave[limb][side] = null; + } + switch (limb) { case "left arm": - slave.arm.left = null; + if (!hasLeftArm(slave)) { + return; + } + remove("arm", "left"); delete slave.brand["left upper arm"]; delete slave.brand["left lower arm"]; delete slave.brand["left wrist"]; @@ -542,7 +574,10 @@ window.removeLimbs = function(slave, limb) { } break; case "right arm": - slave.arm.right = null; + if (!hasRightArm(slave)) { + return; + } + remove("arm", "right"); delete slave.brand["right upper arm"]; delete slave.brand["right lower arm"]; delete slave.brand["right wrist"]; @@ -554,7 +589,10 @@ window.removeLimbs = function(slave, limb) { } break; case "left leg": - slave.leg.left = null; + if (!hasLeftLeg(slave)) { + return; + } + remove("leg", "left"); delete slave.brand["left thigh"]; delete slave.brand["left calf"]; delete slave.brand["left ankle"]; @@ -568,7 +606,10 @@ window.removeLimbs = function(slave, limb) { } break; case "right leg": - slave.leg.right = null; + if (!hasRightLeg(slave)) { + return; + } + remove("leg", "right"); delete slave.brand["right thigh"]; delete slave.brand["right calf"]; delete slave.brand["right ankle"]; @@ -601,23 +642,29 @@ window.removeLimbs = function(slave, limb) { * @param {number} id */ window.attachLimbs = function(slave, limb, id) { - // TODO: add support for body mods + function attach(limb, side) { + let prosthetic = findProsthetic(slave, limbToProsthetic(id)); + + if (prosthetic) { + slave[limb][side] = prosthetic[limb][side]; + } else { + slave[limb][side] = new App.Entity.LimbState(); + slave[limb][side].type = id; + } + } + switch (limb) { case "left arm": - slave.arm.left = new App.Entity.LimbState(); - slave.arm.left.type = id; + attach("arm", "left"); break; case "right arm": - slave.arm.right = new App.Entity.LimbState(); - slave.arm.right.type = id; + attach("arm", "right"); break; case "left leg": - slave.leg.left = new App.Entity.LimbState(); - slave.leg.left.type = id; + attach("leg", "left"); break; case "right leg": - slave.leg.right = new App.Entity.LimbState(); - slave.leg.right.type = id; + attach("leg", "right"); break; case "all": attachLimbs(slave, "left arm", id); @@ -631,6 +678,72 @@ window.attachLimbs = function(slave, limb, id) { } }; +/** + * Changes a slaves limbs to the specified value AND sets all related variables. + * Intended for giving prosthetics during slave generation and events. + * + * @param {App.Entity.SlaveState} slave + * @param {string} limb + * @param {number} id + */ +window.configureLimbs = function(slave, limb, id) { + if (limb === "all") { + configureLimbs(slave, "left arm", id); + configureLimbs(slave, "right arm", id); + configureLimbs(slave, "left leg", id); + configureLimbs(slave, "right leg", id); + return; + } + + let p = limbToProsthetic(id); + if (p) { + addProsthetic(slave, p); + } + + if (id >= 6 && slave.PLimb < 2) { + slave.PLimb = 2; + addProsthetic(slave, "interfaceP2"); + } else if (id >= 2 && slave.PLimb < 1) { + slave.PLimb = 1; + addProsthetic(slave, "interfaceP1"); + } + + switch (limb) { + case "left arm": + if (id !== getLeftArmID(slave)) { + removeLimbs(slave, "left arm"); + if (id > 0) { + attachLimbs(slave, "left arm", id); + } + } + break; + case "right arm": + if (id !== getRightArmID(slave)) { + removeLimbs(slave, "right arm"); + if (id > 0) { + attachLimbs(slave, "right arm", id); + } + } + break; + case "left leg": + if (id !== getLeftLegID(slave)) { + removeLimbs(slave, "left leg"); + if (id > 0) { + attachLimbs(slave, "left leg", id); + } + } + break; + case "right leg": + if (id !== getRightLegID(slave)) { + removeLimbs(slave, "right leg"); + if (id > 0) { + attachLimbs(slave, "right leg", id); + } + } + break; + } +}; + /** * Prepare and set up for new Fuckdoll * @param {App.Entity.SlaveState} slave diff --git a/src/npc/databases/dSlavesDatabase.tw b/src/npc/databases/dSlavesDatabase.tw index 8e0f675647da9302aec51dc42f60e88d21809326..81c7d88c448d6242efdebf034d35025917a61b18 100644 --- a/src/npc/databases/dSlavesDatabase.tw +++ b/src/npc/databases/dSlavesDatabase.tw @@ -208,12 +208,13 @@ /*Reduced weight, changed eyes, added nail polish -BoneyM*/ <<set _HS = App.Entity.SlaveState.makeSkeleton()>> -<<set _HS.slaveName = "Kino", _HS.birthName = "Kino", _HS.origin = "$He was formerly owned by someone who fancied themselves a geneticist, where $he acquired permanently discolored hair and odd fetishes.", _HS.ID = _i++, _HS.birthWeek = random(0,51), _HS.actualAge = 21, _HS.physicalAge = 21, _HS.visualAge = 21, _HS.ovaryAge = 21, _HS.health = 40, _HS.devotion = -75, _HS.height = 155, _HS.race = "white", _HS.eyeColor = "blue-green", _HS.override_H_Color = 1, _HS.hColor = "blue", _HS.pubicHColor = "blue", _HS.override_Skin = 1, _HS.skin = "spray tanned", _HS.hLength = 30, _HS.hStyle = "short, spiky, with a long shoulder-length lock leading from $his temples down, one on each side", _HS.boobs = 650, _HS.vagina = 1, _HS.vaginaLube = 1, _HS.anus = 1, _HS.ovaries = 1, _HS.skill.vaginal = 35, _HS.skill.oral = 35, _HS.skill.anal = 35, _HS.skill.combat = 1, _HS.intelligence = -30, _HS.attrXY = 40, _HS.fetishKnown = 1, _HS.custom.desc = "$He has a vertical scar through $his right eye, is a dabbling artist, and is an oviposition fetishist.">> +<<set _HS.slaveName = "Kino", _HS.birthName = "Kino", _HS.origin = "$He was formerly owned by someone who fancied themselves a geneticist, where $he acquired permanently discolored hair and odd fetishes.", _HS.ID = _i++, _HS.birthWeek = random(0,51), _HS.actualAge = 21, _HS.physicalAge = 21, _HS.visualAge = 21, _HS.ovaryAge = 21, _HS.health = 40, _HS.devotion = -75, _HS.height = 155, _HS.race = "white", _HS.eyeColor = "blue-green", _HS.override_H_Color = 1, _HS.hColor = "blue", _HS.pubicHColor = "blue", _HS.override_Skin = 1, _HS.skin = "spray tanned", _HS.hLength = 30, _HS.hStyle = "short, spiky, with a long shoulder-length lock leading from $his temples down, one on each side", _HS.boobs = 650, _HS.vagina = 1, _HS.vaginaLube = 1, _HS.anus = 1, _HS.ovaries = 1, _HS.skill.vaginal = 35, _HS.skill.oral = 35, _HS.skill.anal = 35, _HS.skill.combat = 1, _HS.intelligence = -30, _HS.attrXY = 40, _HS.fetishKnown = 1, _HS.custom.desc = "$He has a vertical scar through $his right eye, is a dabbling artist, and is an oviposition fetishist.", _HS.eyeball.right.see = 3>> <<set $heroSlaves.push(_HS)>> /*Added combat skill, increased health, added origin -BoneyM*/ <<set _HS = App.Entity.SlaveState.makeSkeleton()>> <<set _HS.slaveName = "Vivienne", _HS.birthName = "Vivienne", _HS.origin = "$He is a former soldier who was sold into slavery after losing $his leg to an IED.", _HS.ID = _i++, _HS.birthWeek = random(0,51), _HS.actualAge = 39, _HS.physicalAge = 39, _HS.visualAge = 39, _HS.ovaryAge = 39, _HS.health = 20, _HS.devotion = 90, _HS.race = "white", _HS.eyeColor = "green", _HS.hColor = "red", _HS.pubicHColor = "red", _HS.skin = "white", _HS.hStyle = "long", _HS.boobs = 400, _HS.butt = 3, _HS.vagina = 1, _HS.vaginaLube = 1, _HS.anus = 1, _HS.skill.vaginal = 15, _HS.skill.oral = 15, _HS.skill.anal = 15, _HS.skill.combat = 1, _HS.intelligence = 25, _HS.intelligenceImplant = 30, _HS.attrXY = 1, _HS.fetishKnown = 1, _HS.backTat = "$He has a military tattoo on $his back.", _HS.custom.desc = "$His left leg is artificial, and $he has a number of scars on $his thigh and shoulder and a burn near $his temple.", _HS.career = "a soldier">> +<<run configureLimbs(_HS, "left leg", 2)>> <<set $heroSlaves.push(_HS)>> /*missing left leg, burn scar, low sex drive, fighter*/ /*Added customdesc, fixed tattoo syntax, added combat skill, eye color and origin -BoneyM*/ diff --git a/src/npc/databases/ddSlavesDatabase.tw b/src/npc/databases/ddSlavesDatabase.tw index 106515e3acf135ad46390d189078a10e9c847e7e..2a98d36c746277727fc7b2bc12f3c896c15cc2b7 100644 --- a/src/npc/databases/ddSlavesDatabase.tw +++ b/src/npc/databases/ddSlavesDatabase.tw @@ -133,7 +133,7 @@ <<set $heroSlaves.push(_HS)>> <<set _HS = App.Entity.SlaveState.makeSkeleton()>> -<<set _HS.slaveName = "'Dragon Goddess' Chae-won", _HS.genes = "XY", _HS.birthName = "Chae-won", _HS.origin = "$He is a former Kkangpae gang member who was sold into slavery by $his former boss as a punishment.", _HS.ID = _i++, _HS.prestige = 1, _HS.prestigeDesc = "$He is a famed Free Cities whore, and commands top prices.", _HS.birthWeek = random(0,51), _HS.actualAge = 26, _HS.physicalAge = 26, _HS.visualAge = 26, _HS.ovaryAge = 26, _HS.health = 50, _HS.devotion = 31, _HS.muscles = 50, _HS.height = 155, _HS.nationality = "Korean", _HS.race = "asian", _HS.override_H_Color = 1, _HS.override_Brow_H_Color = 1, _HS.override_Arm_H_Color = 1, _HS.override_Pubic_H_Color = 1, _HS.origHColor = "black", _HS.hColor = "onyx black and rainbow-streaked", _HS.eyebrowHColor = "black", _HS.pubicHColor = "black", _HS.underArmHColor = "black", _HS.override_Skin = 1, _HS.skin = "sun tanned", _HS.hLength = 60, _HS.hStyle = "styled in high chignon resembling a traditional Japanese geisha's Shimada hairstyle, with plenty of decorated hairpins", _HS.waist = -55, _HS.boobs = 6000, _HS.boobsImplant = 3000, _HS.nipples = "huge", _HS.butt = 4.5, _HS.face = 55, _HS.faceImplant = 15, _HS.lips = 35, _HS.lipsTat = "permanent makeup", _HS.tonguePiercing = 1, _HS.vagina = -1, _HS.preg = -2, _HS.anus = 1, _HS.dick = 5, _HS.prostate = 1, _HS.balls = 4, _HS.scrotum = 4, _HS.anusTat = "bleached", _HS.nails = 3, _HS.earPiercing = 1, _HS.legsTat = "flowers", _HS.stampTat = "flowers", _HS.skill.oral = 100, _HS.skill.anal = 100, _HS.skill.whoring = 100, _HS.clothes = "a slave gown", _HS.collar = "pretty jewelry", _HS.shoes = "heels", _HS.intelligence = -3, _HS.intelligenceImplant = 30, _HS.energy = 100, _HS.attrXX = 40, _HS.attrXY = 40, _HS.fetishKnown = 1, _HS.behavioralFlaw = "arrogant", _HS.custom.tattoo = "$He has two neon-blue butterflies tattooed on $his right temple and one more right above right eyebrow; a bright blue, luminescent tattoo of an oriental dragon is intertwining with floral tattoos on $his right leg.", _HS.custom.desc = "$He is almost never seen without $his long, thin, lavishly decorated smoking pipe, either holding it in hand, or carrying it tucked in $his chignon.", _HS.career = "a gang member">> +<<set _HS.slaveName = "'Dragon Goddess' Chae-won", _HS.genes = "XY", _HS.birthName = "Chae-won", _HS.origin = "$He is a former Kkangpae gang member who was sold into slavery by $his former boss as a punishment.", _HS.ID = _i++, _HS.prestige = 1, _HS.prestigeDesc = "$He is a famed Free Cities whore, and commands top prices.", _HS.birthWeek = random(0,51), _HS.actualAge = 26, _HS.physicalAge = 26, _HS.visualAge = 26, _HS.ovaryAge = 26, _HS.health = 50, _HS.devotion = 31, _HS.muscles = 50, _HS.height = 155, _HS.nationality = "Korean", _HS.race = "asian", _HS.override_H_Color = 1, _HS.override_Brow_H_Color = 1, _HS.override_Arm_H_Color = 1, _HS.override_Pubic_H_Color = 1, _HS.origHColor = "black", _HS.hColor = "onyx black and rainbow-streaked", _HS.eyebrowHColor = "black", _HS.pubicHColor = "black", _HS.underArmHColor = "black", _HS.override_Skin = 1, _HS.skin = "sun tanned", _HS.hLength = 60, _HS.hStyle = "styled in high chignon resembling a traditional Japanese geisha's Shimada hairstyle, with plenty of decorated hairpins", _HS.waist = -55, _HS.boobs = 6000, _HS.boobsImplant = 3000, _HS.nipples = "huge", _HS.butt = 4.5, _HS.face = 55, _HS.faceImplant = 15, _HS.lips = 35, _HS.lipsTat = "permanent makeup", _HS.tonguePiercing = 1, _HS.vagina = -1, _HS.preg = -2, _HS.anus = 1, _HS.dick = 5, _HS.prostate = 1, _HS.balls = 4, _HS.scrotum = 4, _HS.anusTat = "bleached", _HS.nails = 3, _HS.earPiercing = 1, _HS.legsTat = "flowers", _HS.stampTat = "flowers", _HS.skill.oral = 100, _HS.skill.anal = 100, _HS.skill.whoring = 100, _HS.clothes = "a slave gown", _HS.collar = "pretty jewelry", _HS.shoes = "heels", _HS.intelligence = -3, _HS.intelligenceImplant = 30, _HS.energy = 100, _HS.attrXX = 40, _HS.attrXY = 40, _HS.fetishKnown = 1, _HS.behavioralFlaw = "arrogant", _HS.custom.tattoo = "$He has two neon-blue butterflies tattooed on $his right temple and one more right above $his right eyebrow; a bright blue, luminescent tattoo of an oriental dragon is intertwining with floral tattoos on $his right leg.", _HS.custom.desc = "$He is almost never seen without $his long, thin, lavishly decorated smoking pipe, either holding it in hand, or carrying it tucked in $his chignon.", _HS.career = "a gang member">> <<set $heroSlaves.push(_HS)>> <<set _HS = App.Entity.SlaveState.makeSkeleton()>> diff --git a/src/npc/descriptions/limbs.js b/src/npc/descriptions/limbs.js new file mode 100644 index 0000000000000000000000000000000000000000..798c9ec42a1e5cbb7afe2b990e82da78990f8b99 --- /dev/null +++ b/src/npc/descriptions/limbs.js @@ -0,0 +1,258 @@ +App.Desc.limbChange = function() { + return { + currentLimbs: currentLimbs, + amputate: amputate, + prosthetic: prosthetic, + selector: selector, + applySelector: applySelector, + reaction: reaction + }; + + /** + * Generates an object usable with the standard limb check functions. + * @param {App.Entity.SlaveState} slave + * @returns {{}} + */ + function currentLimbs(slave) { + let s = {arm: {left: {type: 1}, right: {type: 1}}, leg: {left: {type: 1}, right: {type: 1}}, PLimb: 0}; + if (hasLeftArm(slave)) { + s.arm.left.type = getLeftArmID(slave); + } else { + s.arm.left = null; + } + if (hasRightArm(slave)) { + s.arm.right.type = getRightArmID(slave); + } else { + s.arm.right = null; + } + if (hasLeftLeg(slave)) { + s.leg.left.type = getLeftLegID(slave); + } else { + s.leg.left = null; + } + if (hasRightLeg(slave)) { + s.leg.right.type = getRightLegID(slave); + } else { + s.leg.right = null; + } + s.PLimb = slave.PLimb; + return s; + } + + /** + * @param {App.Entity.SlaveState} slave + * @param {{}} oldLimbs + * @param {string} returnTo + * @returns {string} + */ + function amputate(slave, oldLimbs, returnTo) { + const {his} = getPronouns(slave); + let implant = false; + let r = ""; + + if (slave.PLimb < 1 && isProstheticAvailable(slave, "interfaceP1")) { + implant = true; + r += `<<link "Install basic interface">>` + + `<<set $activeSlave.PLimb = 1, $activeSlave.health -= 10>>` + + `<<replace "#amputate">><<= App.Desc.limbChange().prosthetic($activeSlave, ${JSON.stringify(oldLimbs)}, "${returnTo}")>><</replace>>` + + `<</link>>`; + } + if (slave.PLimb < 2 && isProstheticAvailable(slave, "interfaceP2")) { + if (implant) { + r += "<br>"; + } + implant = true; + r += `<<link "Install advanced interface">>` + + `<<set $activeSlave.PLimb = 2, $activeSlave.health -= 10>>` + + `<<replace "#amputate">><<= App.Desc.limbChange().prosthetic($activeSlave, ${JSON.stringify(oldLimbs)}, "${returnTo}")>><</replace>>` + + `<</link>>`; + } + + if (implant) { + return `<span id="amputate"> + Since you already have a prosthetic interface prepared for this slave, you can install it during the operation. + The procedure will put additional strain on ${his} health but less so than if you were to perform the procedures separately. + + ${r} + <<link "Do not install">> + <<replace "#amputate">><<= App.Desc.limbChange().reaction($activeSlave, ${JSON.stringify(oldLimbs)}, "${returnTo}")>><</replace>> + <</link>> + </span>`; + } + + if (slave.PLimb > 0) { + return prosthetic(slave, oldLimbs, returnTo); + } + return reaction(slave, oldLimbs, returnTo); + } + + /** + * @param {App.Entity.SlaveState} slave + * @param {{}} oldLimbs + * @param {string} returnTo + * @returns {string} + */ + function prosthetic(slave, oldLimbs, returnTo) { + if (!(isProstheticAvailable(slave, "basicL") || isProstheticAvailable(slave, "sexL") + || isProstheticAvailable(slave, "beautyL") || isProstheticAvailable(slave, "combatL") + || (isProstheticAvailable(slave, "cyberneticL") && slave.PLimb > 1))) { + return reaction(slave, oldLimbs, returnTo); + } + const {him} = getPronouns(slave); + + let r = `<br>Since you already have limbs prepared for ${him} you might as well attach them while you are working on ${him}:` + + selector(slave, oldLimbs, returnTo); + + return `<span id="selector">${r}</span>`; + } + + /** + * Displays a selector for prosthetic limbs of $activeSlave + * @param {App.Entity.SlaveState} slave + * @param {{}} oldLimbs + * @param {string} [returnTo] + * @returns {string} + */ + function selector(slave, oldLimbs, returnTo = "") { + if (hasAllNaturalLimbs((slave))) { + return "//You must amputate your slaves limbs before you can attach prosthetics.//"; + } + if (slave.PLimb < 1) { + return "//You must install a prosthetic interface before you can attach prosthetics.//"; + } + const state = currentState(slave); + + /** + * Generates an array with the current limbs of a slave. + * @param {App.Entity.SlaveState} slave + * @returns {[number]} + */ + function currentState(slave) { + let a = []; + a[0] = getLeftArmID(slave); + a[1] = getRightArmID(slave); + a[2] = getLeftLegID(slave); + a[3] = getRightLegID(slave); + return a; + } + + /** + * @param {number} pos + * @param {number} id + * @returns {string} + */ + function entry(pos, id) { + if (state[pos] === 1) { + return "<div></div>"; + } + return `<div><<radiobutton "_newState[${pos}]" ${id}${state[pos] === id ? " checked" : ""}>></div>`; + } + + /** + * @param {string} title + * @param {number} id + * @returns {string} + */ + function row(title, id) { + return `<div>${title}</div>${entry(0, id)}${entry(1, id)}${entry(2, id)}${entry(3, id)}`; + } + + let r = "<div></div><div>Left Arm</div><div>Right Arm</div><div>Left Leg</div><div>Right Leg</div>"; + + r += row("None", 0); + if (isProstheticAvailable(slave, "basicL")) { + r += row("Basic prosthetic", 2); + } + if (isProstheticAvailable(slave, "sexL")) { + r += row("Advanced sex limb", 3); + } + if (isProstheticAvailable(slave, "beautyL")) { + r += row("Advanced beauty limb", 4); + } + if (isProstheticAvailable(slave, "combatL")) { + r += row("Advanced combat limb", 5); + } + if (isProstheticAvailable(slave, "cyberneticL")) { + if (slave.PLimb > 1) { + r += row("Cybernetic limb", 6); + } else { + r += "<div class='cyber' style='text-align: center;'>//Install an advanced interface to attach cybernetic limbs.//</div>"; + } + } + + r = `<br><br><<set _newState = [${state}]>>` + + "<style> .selector{display: grid; grid-template-columns: 200px 100px 100px 100px 100px;}" + + ".cyber {grid-column-start: 1; grid-column-end: 6;</style>" + + `<div class='selector'>${r}</div>${apply()}`; + + return r; + + function apply() { + let s; + if (!returnTo) { + s = `<<set $prostheticsConfig = "limbs", $oldLimbs = ${JSON.stringify(oldLimbs)}>>` + + '<<goto "Prosthetics Configuration">>'; + } else { + s = `<<replace "#selector">><<= App.Desc.limbChange().reaction($activeSlave, ${JSON.stringify(oldLimbs)}, "${returnTo}")>><</replace>>`; + } + + return `<<link "Apply">><<run App.Desc.limbChange().applySelector($activeSlave, _newState)>>${s}<</link>>`; + } + } + + /** + * + * @param {App.Entity.SlaveState} slave + * @param {[number]} newState + */ + function applySelector(slave, newState) { + if (getLeftArmID(slave) !== newState[0]) { + if (getLeftArmID(slave) > 1) { + removeLimbs(slave, "left arm"); + } + if (newState[0] > 1) { + attachLimbs(slave, "left arm", newState[0]); + } + } + if (getRightArmID(slave) !== newState[1]) { + if (getRightArmID(slave) > 1) { + removeLimbs(slave, "right arm"); + } + if (newState[1] > 1) { + attachLimbs(slave, "right arm", newState[1]); + } + } + if (getLeftLegID(slave) !== newState[2]) { + if (getLeftLegID(slave) > 1) { + removeLimbs(slave, "left leg"); + } + if (newState[2] > 1) { + attachLimbs(slave, "left leg", newState[2]); + } + } + if (getRightLegID(slave) !== newState[3]) { + if (getRightLegID(slave) > 1) { + removeLimbs(slave, "right leg"); + } + if (newState[3] > 1) { + attachLimbs(slave, "right leg", newState[3]); + } + } + } + + /** + * @param {App.Entity.SlaveState} slave + * @param {{}} oldLimbs + * @param {string} returnTo + * @returns {string} + */ + function reaction(slave, oldLimbs, returnTo = "") { + let r = "//Slave's reaction//"; + // TODO + // reaction based on limb change & devotion/trust + if (returnTo) { + r = `<br><br>${r}<br>[[Continue|${returnTo}]]`; + } + return r; + } +}; diff --git a/src/pregmod/widgets/pregmodWidgets.tw b/src/pregmod/widgets/pregmodWidgets.tw index 4d112836bd7a17d0960911e950d31893859c0cae..7d2519e15f160aa751b68251cb709f334ea63b63 100644 --- a/src/pregmod/widgets/pregmodWidgets.tw +++ b/src/pregmod/widgets/pregmodWidgets.tw @@ -38,13 +38,6 @@ <<if ndef $args[0].tailColor>> <<set $args[0].tailColor = "none">> <</if>> -<<if ndef $args[0].missingEyes>> - <<if $args[0].eyes == -4>> - <<set $args[0].missingEyes = 3>> - <<else>> - <<set $args[0].missingEyes = 0>> - <</if>> -<</if>> <<if def $args[0].prostateImplant>> <<if ($args[0].prostateImplant == 1)>> <<set $args[0].prostate = 3>> @@ -537,7 +530,7 @@ <<set $args[0].arm = {left: null, right: null}>> <<set $args[0].leg = {left: null, right: null}>> <<else>> - <<set _newID = ($args[0].amp * -1) +1>> + <<set _newID = ($args[0].amp * -1) + 1>> <<set $args[0].arm = { left: new App.Entity.LimbState(), right: new App.Entity.LimbState() @@ -547,7 +540,7 @@ right: new App.Entity.LimbState() }>> <<set $args[0].arm.left.type = _newID, $args[0].arm.right.type = _newID, $args[0].leg.left.type = _newID, $args[0].leg.right.type = _newID>> - /* no need to check partial amputation, since it is not possible to create proir to this */ + /* no need to check partial amputation, since it is not possible to create prior to this */ <</if>> <<run delete $args[0].amp>> <<run delete $args[0].missingLegs>> @@ -570,6 +563,64 @@ <</if>> <</if>> +<<if ndef $args[0].eyeball>> + <<if $args[0].eyes == -4>> + <<set $args[0].eyeball = {left: null, right: null}>> + <<else>> + <<if $args[0].eyesImplant>> + <<set _newType = 3>> + <<elseif $args[0].eyes == -3>> + <<set _newType = 2>> + <<else>> + <<set _newType = 1>> + <</if>> + <<switch $args[0].eyes>> + <<case 1>> + <<set _newSee = 1>> + <<case -1>> + <<set _newSee = 2>> + <<case -2>> + <<set _newSee = 3>> + <</switch>> + <<set _newColor = $args[0].eyeColor>> + <<set _newOrig = $args[0].origEye>> + <<set _newPupil = $args[0].pupil>> + <<set _newSclerae = $args[0].sclerae>> + <<set $args[0].eyeball = { + left: new App.Entity.EyeState(), + right: new App.Entity.EyeState() + }>> + <<set $args[0].eyeball.left.type = _newType, $args[0].eyeball.right.type = _newType, $args[0].eyeball.left.see = _newSee, $args[0].eyeball.right.see = _newSee>> + <</if>> + <<run delete $args[0].missingEyes>> +<</if>> + +<<if ndef $args[0].auricle>> + <<if $args[0].earShape == "none">> + <<set $args[0].auricle = {left: null, right: null}>> + <<else>> + <<if $args[0].earShape == "damaged">> + <<set _newShape = "normal">> + <<set _newDam = 1>> + <<else>> + <<set _newShape = $args[0].earShape>> + <<set _newDam = 0>> + <</if>> + <<set _newPierce = $args[0].earPiercing>> + <<set $args[0].auricle = { + left: new App.Entity.EarState(), + right: new App.Entity.EarState() + }>> + <<set $args[0].auricle.left.shape = _newShape, $args[0].auricle.right.shape = _newShape, $args[0].auricle.left.damage = _newDam, $args[0].auricle.right.damage = _newDam, $args[0].auricle.left.piercing = _newPierce, $args[0].auricle.right.piercing = _newPierce>> + <</if>> +<</if>> + +<<if ($releaseID < 1052) && $args[0].readyProsthetics>> + <<set _prosthetics = $args[0].readyProsthetics, $args[0].readyProsthetics = []>> + <<for _p range _prosthetics>> + <<run addProsthetic($args[0], _p.id)>> + <</for>> +<</if>> <</widget>> diff --git a/src/uncategorized/BackwardsCompatibility.tw b/src/uncategorized/BackwardsCompatibility.tw index 0b116f26af6d9b1b7167ce197d77a95ef84e4c46..ade73d025203134b5ab26c2a1805af985d98a771 100644 --- a/src/uncategorized/BackwardsCompatibility.tw +++ b/src/uncategorized/BackwardsCompatibility.tw @@ -99,7 +99,7 @@ <</if>> <<if !$customSlave.hasOwnProperty("leg")>> - <<if def $customSlave.amp && $customSlave.amp === 1>> + <<if (def $customSlave.amp) && ($customSlave.amp === 1)>> <<set $customSlave.leg = {left: null, right: null}>> <<else>> <<set $customSlave.leg = {left: new App.Entity.LimbState(), right: new App.Entity.LimbState()}>> @@ -107,7 +107,7 @@ <</if>> <<if !$customSlave.hasOwnProperty("arm")>> - <<if def $customSlave.amp && $customSlave.amp === 1>> + <<if (def $customSlave.amp) && ($customSlave.amp === 1)>> <<set $customSlave.arm = {left: null, right: null}>> <<else>> <<set $customSlave.arm = {left: new App.Entity.LimbState(), right: new App.Entity.LimbState()}>> @@ -3518,15 +3518,15 @@ Setting missing slave variables: <<for _k = 0; _k < _Slave.readyLimbs.length; _k++>> <<switch _Slave.readyLimbs[_k].type>> <<case -1>> - <<set _Slave.readyProsthetics.push({id: "basicL"})>> + <<run addProsthetic(_Slave, "basicL")>> <<case -2>> - <<set _Slave.readyProsthetics.push({id: "sexL"})>> + <<run addProsthetic(_Slave, "sexL")>> <<case -3>> - <<set _Slave.readyProsthetics.push({id: "beautyL"})>> + <<run addProsthetic(_Slave, "beautyL")>> <<case -4>> - <<set _Slave.readyProsthetics.push({id: "combatL"})>> + <<run addProsthetic(_Slave, "combatL")>> <<case -5>> - <<set _Slave.readyProsthetics.push({id: "cyberneticL"})>> + <<run addProsthetic(_Slave, "cyberneticL")>> <</switch>> <</for>> <</if>> @@ -4001,10 +4001,6 @@ Done<br> <</if>> <</if>> -<<if $releaseID < App.Version.release>> - <<set $releaseID = App.Version.release>> -<</if>> - <<if def $activeArcology>> <<unset $activeArcology>> <</if>> @@ -4137,5 +4133,10 @@ Done<br> <br>Fixed NaN FS value for FSStatuesqueGlorification <</if>> + +/* leave this at the bottom of BC */ +<<if $releaseID < App.Version.release>> + <<set $releaseID = App.Version.release>> +<</if>> /* reset NaNArray after BC is run */ <<set $NaNArray = findNaN()>> diff --git a/src/uncategorized/labReport.tw b/src/uncategorized/labReport.tw index a3ccf00a85c7258400aafaa57df4b92e577716f7..e1e7fd506e7527f2d22d1242a1d8486277f84289 100644 --- a/src/uncategorized/labReport.tw +++ b/src/uncategorized/labReport.tw @@ -4,12 +4,11 @@ <br> <<if ($researchLab.hired + $researchLab.menials) > 0>> <<if $researchLab.tasks.length == 0>> - Since the lab is currently not working on any projects it takes contract work and earns you @@.yellowgreen;<<= cashFormat($researchLab.speed * 90)>>.@@ - <<set _cashX = ($researchLab.speed * 90)>> - <<run cashX(_cashX, "lab")>> + <<set _cash = ($researchLab.speed * 90)>> + Since the lab is currently not working on any projects it takes contract work and earns you @@.yellowgreen;<<= cashFormat(_cash)>>.@@ + <<run cashX(_cash, "lab")>> <<else>> <<set _work = $researchLab.speed, _task = $researchLab.tasks[0]>> - /*<<for _i = 0; _i < $researchLab.tasks.length && _work > 0; _i++>>*/ <<for _work > 0>> <<if _work < _task.workLeft>> <<set _task.workLeft -= _work, _work = 0>> @@ -25,7 +24,7 @@ <<= setup.prosthetics[_task.id].name>> construction project. <<set $prosthetics[_task.id].amount += 1>> <<case "craftFit">> - <<set _i = $slaves.findIndex(function(s) {return s.ID == _task.slaveID}), $slaves[_i].readyProsthetics.push({id: _task.id})>> + <<set _i = $slaveIndices[_task.slaveID], addProsthetic($slaves[_i], _task.id)>> project to construct <<= addA(setup.prosthetics[_task.id].name)>> for <<= SlaveFullName($slaves[_i])>>. <</switch>> <<set $researchLab.tasks.shift(), _task = $researchLab.tasks[0]>> diff --git a/src/uncategorized/multiImplant.tw b/src/uncategorized/multiImplant.tw index 210e0eb9a3e3c99a4043d1eabcfc0b81b15dd0b3..88f76ef94c0921c94f8f6e46f3cff0791c9c04d5 100644 --- a/src/uncategorized/multiImplant.tw +++ b/src/uncategorized/multiImplant.tw @@ -1011,7 +1011,7 @@ You head down to your <<if $surgeryUpgrade == 1>>heavily upgraded and customized <<set _p = $adjustProsthetics[_k]>> <<if _p.slaveID == $activeSlave.ID && _p.workLeft <= 0>> <<set $adjustProsthetics.splice(_k, 1), _k-->> - <<set $activeSlave.readyProsthetics.push({id: _p.id})>> + <<set addProsthetic($activeSlave, _p.id)>> <br><hr> <<switch _p.id>> <<case "ocular">> diff --git a/src/uncategorized/reRecruit.tw b/src/uncategorized/reRecruit.tw index eca94478351b23796da893f2e5cd88d66b555018..3ef5cb36ee8a9a535ab62c34e80538476962293c 100644 --- a/src/uncategorized/reRecruit.tw +++ b/src/uncategorized/reRecruit.tw @@ -1715,7 +1715,7 @@ <<set $one_time_age_overrides_pedo_mode = 1>> <<set $oneTimeDisableDisability = 1>> <<set $activeSlave = GenerateNewSlave("XX")>> -<<run attachLimbs($activeSlave, "all", 2)>> +<<run configureLimbs($activeSlave, "all", 2)>> <<set $activeSlave.origin = "You helped free $him from a POW camp after being abandoned by $his country, leaving $him deeply indebted to you.">> <<set $activeSlave.devotion = random(0,20)>> <<set $activeSlave.trust = random(0,20)>> @@ -1793,7 +1793,7 @@ <<set $activeSlave.weight = random(-11 -30)>> <<set $activeSlave.waist = random(-11, -40)>> <<set $activeSlave.skill.combat = 1>> -<<run attachLimbs($activeSlave, "all", 6)>> +<<run configureLimbs($activeSlave, "all", 6)>> <<set $activeSlave.teeth = "pointy">> <<set $activeSlave.muscles = random(30,70)>> <<set $activeSlave.height = Math.round(Height.random($activeSlave, {skew: 3, spread: .2, limitMult: [1, 4]}))>> @@ -2406,7 +2406,7 @@ While digging through the database of a POW camp for anything of value, you find <<if $seeExtreme == 1>> the traces of $his wounds, that $he has been greatly modified for war, and that $he had been raped, repeatedly, despite $his powerful body. <<set $activeSlave.teeth = "pointy", $activeSlave.muscles = random(30,70), $activeSlave.height = Math.round(Height.random($activeSlave, {skew: 3, spread: .2, limitMult: [1, 4]})), $activeSlave.chem = 1000, $activeSlave.attrXX = 0, $activeSlave.attrXY = 0>> - <<run attachLimbs($activeSlave, "all", 6)>> + <<run configureLimbs($activeSlave, "all", 6)>> <<else>> the traces of $his wounds, that $he had been left bound long enough for $his body to atrophy, and that $he had been raped, repeatedly. <</if>> diff --git a/src/uncategorized/reShelterInspection.tw b/src/uncategorized/reShelterInspection.tw index 7c1d54cf889c474696f8badc2bfb75b3da71b0d4..be4b1387fa13ce9e92dbe0bfafd755922cb737dc 100644 --- a/src/uncategorized/reShelterInspection.tw +++ b/src/uncategorized/reShelterInspection.tw @@ -237,6 +237,29 @@ Not waiting to be greeted, the inspector looks up at the nearest camera and dema <<set _inspectionContinues = 0>> <<set $shelterAbuse -= 3>> <</if>> + <<case "$His owner purposely deafened $him by piercing $his eardrums with knitting needles.">> + The inspector gestures for _Inspectee.slaveName to turn away from _him2 and, once $he has done so, asks "Can you hear me, _Inspectee.slaveName?" + <<if _Inspectee.hears > _originSlave.hears>> + <<if canTalk(_Inspectee)>> + <<run Enunciate(_Inspectee)>> + <<if _Inspectee.hears < 0>> + $He nods and responds "It'<<s>> <<s>>till hard, but I can." + <<else>> + $He nods and responds "Loud and clear." + <</if>> + <<else>> + <<if _Inspectee.hears < 0>> + $He cocks $his head to listen, and nods slowly. + <<else>> + $He nods confidently. + <</if>> + <<run Enunciate($activeSlave)>> + The inspector's expression softens, and _he2 pauses a moment before jotting down more notes on _his2 tablet. "Thank you, _Inspectee.slaveName, that will be all." _He2 turns to you and says "You're more than welcome to adopt <<s>>lave<<s>> from our <<sh>>elter." You swear _he2 seems in much better spirits as _he2 leaves your penthouse. + <<set _inspectionContinues = 0>> + <<set $shelterAbuse-->> + <<else>> + Unable to hear _him2, $he does not respond. "Pity," the inspector says. + <</if>> <<case "You got $him at the Slave Shelter. $His owner purposely blinded $him by dumping boiling water into $his eyes.">> "I wi<<sh>> the <<s>>carring wa<<s>>n't so bad, that way people wouldn't <<s>>tare so much." <<if _Inspectee.eyes > _originSlave.eyes>> diff --git a/src/uncategorized/remoteSurgery.tw b/src/uncategorized/remoteSurgery.tw index 870d6ea06c218c2ab4f665a0bf6e35a8e41828a8..7cfdff045e767d885eed19ec86dc911495aeed58 100644 --- a/src/uncategorized/remoteSurgery.tw +++ b/src/uncategorized/remoteSurgery.tw @@ -8,7 +8,7 @@ <<if $adjustProstheticsCompleted > 0>> <<set $adjustProsthetics = $adjustProsthetics.filter(function(p) { if (p.workLeft <= 0 && p.slaveID == $activeSlave.ID) { - $activeSlave.readyProsthetics.push({id: p.id}); + addProsthetic($activeSlave, p.id); $adjustProstheticsCompleted--; return false; } @@ -153,10 +153,11 @@ $His $activeSlave.faceShape face is | [[Blind|Surgery Degradation][$activeSlave.eyes = -2,$activeSlave.eyeColor = "dulled " + $activeSlave.origEye,$activeSlave.eyeColor = $activeSlave.origEye,cashX(forceNeg($surgeryCost), "slaveSurgery", $activeSlave), $activeSlave.health -= 10,$surgeryType = "blind"]] <</if>> <<if ($activeSlave.eyes > -3)>> - | [[Remove eyes|Surgery Degradation][$activeSlave.eyes = -4, cashX(forceNeg($surgeryCost), "slaveSurgery", $activeSlave), $activeSlave.health -= 20, $surgeryType = "remove eyes"]] + | [[Remove eyes|Surgery Degradation][cashX(forceNeg($surgeryCost), "slaveSurgery", $activeSlave), $activeSlave.health -= 20, $surgeryType = "remove eyes"]] + /* eyes are set in Surgery Degredation */ <<if ($activeSlave.eyes > -2)>>//This will greatly restrict $him//<</if>> <</if>> - <<if $activeSlave.readyProsthetics.findIndex(function(p) {return p.id == "ocular"}) != -1>> + <<if isProstheticAvailable($activeSlave, "ocular")>> | [["Give " + $him + " ocular implants"|Surgery Degradation][$activeSlave.eyesImplant = 1, cashX(forceNeg($surgeryCost), "slaveSurgery", $activeSlave), $activeSlave.health -= 20, $surgeryType = "ocular implant"]] <</if>> <</if>> @@ -290,7 +291,7 @@ $He has <<if ($activeSlave.hears > -2)>> | [[Deafen|Surgery Degradation][$activeSlave.hears = -2,cashX(forceNeg($surgeryCost), "slaveSurgery", $activeSlave), $activeSlave.health -= 10,$surgeryType = "deafen"]] <</if>> - <<if $activeSlave.readyProsthetics.findIndex(function(p) {return p.id == "cochlear"}) != -1>> + <<if isProstheticAvailable($activeSlave, "cochlear")>> | [["Give " + $him + " cochlear implants"|Surgery Degradation][$activeSlave.earImplant = 1, cashX(forceNeg($surgeryCost), "slaveSurgery", $activeSlave), $activeSlave.health -= 20, $surgeryType = "cochlear implant"]] <</if>> <</if>> @@ -460,7 +461,7 @@ $He has <<if $seeExtreme == 1>> | [[Remove vocal cords|Surgery Degradation][surgeryAmp($activeSlave, "voicebox"), $surgeryType = "mute", cashX(forceNeg($surgeryCost), "slaveSurgery", $activeSlave)]] <</if>> - <<elseif $activeSlave.readyProsthetics.findIndex(function(p) {return p.id == "electrolarynx"}) != -1>> + <<elseif isProstheticAvailable($activeSlave, "electrolarynx")>> [["Give " + $him + " an electrolarynx"|Surgery Degradation][$activeSlave.electrolarynx = 1, $activeSlave.voice = 2, cashX(forceNeg($surgeryCost), "slaveSurgery", $activeSlave), $activeSlave.health -= 20, $surgeryType = "electrolarynx"]] <</if>> <</if>> @@ -1750,6 +1751,8 @@ Work on $him structurally: <<link "Amputate limb(s)">> <<set _atleastOne = 0>> + /* temporary story variable */ + <<set $oldLimbs = App.Desc.limbChange().currentLimbs($activeSlave)>> <<if _LA === 1>> <<run removeLimbs($activeSlave, "left arm")>> <<set _atleastOne++>> @@ -1771,32 +1774,30 @@ Work on $him structurally: <<if !hasAnyArms($activeSlave)>> <<set $activeSlave.releaseRules = "restrictive">> <</if>> - <<if !hasAnyNaturalLimbs($activeSlave) && (isProstheticAvailable($activeSlave, "interfaceP1") || isProstheticAvailable($activeSlave, "interfaceP2"))>> - <<set $surgeryType = "amp1">> - <<else>> - <<set $surgeryType = "amp">> - <</if>> + <<set $surgeryType = "amp">> <<goto "Surgery Degradation">> + <<else>> + <<unset $oldLimbs>> <</if>> <</link>> //This will greatly restrict $him.// <br> <</if>> /* extreme toggle */ -<<if isAmputee($activeSlave) && $activeSlave.PLimb == 0>> - <<if $activeSlave.readyProsthetics.findIndex(function(p) {return p.id == "interfaceP1"}) != -1>> | - [[Install basic prosthetic interface|Surgery Degradation][$activeSlave.PLimb = 1, cashX(forceNeg($surgeryCost), "slaveSurgery", $activeSlave), $activeSlave.health -= 20, $surgeryType = "PLimb interface1"]] +<<if !hasAllNaturalLimbs($activeSlave) && $activeSlave.PLimb == 0>> + <<if isProstheticAvailable($activeSlave, "interfaceP1")>> + [[Install basic prosthetic interface|Surgery Degradation][$oldLimbs = App.Desc.limbChange().currentLimbs($activeSlave), $activeSlave.PLimb = 1, cashX(forceNeg($surgeryCost), "slaveSurgery", $activeSlave), $activeSlave.health -= 20, $surgeryType = "PLimb interface"]] <</if>> - <<if $activeSlave.readyProsthetics.findIndex(function(p) {return p.id == "interfaceP2"}) != -1>> | - [[Install advanced prosthetic interface|Surgery Degradation][$activeSlave.PLimb = 2, cashX(forceNeg($surgeryCost), "slaveSurgery", $activeSlave), $activeSlave.health -= 20, $surgeryType = "PLimb interface2"]] + <<if isProstheticAvailable($activeSlave, "interfaceP2")>> | + [[Install advanced prosthetic interface|Surgery Degradation][$oldLimbs = App.Desc.limbChange().currentLimbs($activeSlave), $activeSlave.PLimb = 2, cashX(forceNeg($surgeryCost), "slaveSurgery", $activeSlave), $activeSlave.health -= 20, $surgeryType = "PLimb interface"]] <</if>> -<<elseif isAmputee($activeSlave) && $activeSlave.PLimb == 1 && $activeSlave.readyProsthetics.findIndex(function(p) {return p.id == "interfaceP2"}) != -1>> | - [[Upgrade advanced prosthetic interface|Surgery Degradation][$activeSlave.PLimb = 2, cashX(forceNeg($surgeryCost), "slaveSurgery", $activeSlave), $activeSlave.health -= 5, $surgeryType = "PLimb interface3"]] +<<elseif $activeSlave.PLimb == 1 && isProstheticAvailable($activeSlave, "interfaceP2")>> + [[Upgrade to advanced prosthetic interface|Surgery Degradation][$oldLimbs = App.Desc.limbChange().currentLimbs($activeSlave), $activeSlave.PLimb = 2, cashX(forceNeg($surgeryCost), "slaveSurgery", $activeSlave), $activeSlave.health -= 5, $surgeryType = "PLimb interface"]] <</if>> <br> <<if $activeSlave.PTail == 1>> $He has a neural interface allowing attachment of tails. -<<elseif $activeSlave.readyProsthetics.findIndex(function(p) {return p.id == "interfaceTail"}) != -1>> +<<elseif isProstheticAvailable($activeSlave, "interfaceTail")>> $He lacks a neural interface allowing attachment of tails. [[Implant interface|Surgery Degradation][$activeSlave.PTail = 1, $activeSlave.tail = "none", $activeSlave.tailColor = "none", cashX(forceNeg($surgeryCost), "slaveSurgery", $activeSlave), $activeSlave.health -= 10, $surgeryType = "tailInterface"]] <<else>> diff --git a/src/uncategorized/saDiet.tw b/src/uncategorized/saDiet.tw index bbfd0bd47dfb3d79bc6d302fe138ffd7482114fb..1df4786e9e51af9c6ebf5bc31983f0bc09e4c9b2 100644 --- a/src/uncategorized/saDiet.tw +++ b/src/uncategorized/saDiet.tw @@ -632,7 +632,7 @@ $His rear @@.lime;rounds out@@ to fit $his developing femininity. <<set $slaves[$i].butt += 1>> <</if>> - <<if $slaves[$i].waist > -30>> + <<if $slaves[$i].waist > -20>> Hormonal changes @@.lime;slim $his waist.@@ <<set $slaves[$i].waist-->> <</if>> @@ -670,7 +670,7 @@ $His breasts @@.lime;grow slightly@@ from the estrogen. <<set $slaves[$i].boobs += 10>> <</if>> - <<if $slaves[$i].waist > -20>> + <<if $slaves[$i].waist > -30>> Hormonal changes @@.lime;slim $his waist.@@ <<set $slaves[$i].waist-->> <</if>> @@ -737,7 +737,7 @@ Despite some doubts lurking at the back of $his mind, your insistence that $he will be handsomer if $he was more masculine @@.hotpink;lets $him enjoy@@ the testosterone rich food given to $him. <<set $slaves[$i].devotion += 1>> <</if>> - <<if $slaves[$i].muscles < 60>> + <<if $slaves[$i].muscles < 30>> Hormonal changes encourage $his body to @@.lime;gain muscle.@@ <<set $slaves[$i].muscles += 1>> <</if>> @@ -756,7 +756,7 @@ <<set $slaves[$i].boobs -= 10>> <</if>> <</if>> - <<if $slaves[$i].waist < 0>> + <<if $slaves[$i].waist < 15>> Hormonal changes @@.lime;thicken $his waist.@@ <<set $slaves[$i].waist++>> <</if>> @@ -776,7 +776,7 @@ <<set $slaves[$i].boobs -= 10>> <</if>> <</if>> - <<if $slaves[$i].waist < 15>> + <<if $slaves[$i].waist < 0>> Hormonal changes @@.orange;thicken $his waist.@@ <<set $slaves[$i].waist++>> <</if>> @@ -785,7 +785,7 @@ Despite some doubts lurking at the back of $his mind, your insistence that $he will be handsomer if $he was more masculine @@.hotpink;lets $him enjoy@@ the testosterone rich food given to $him. <<set $slaves[$i].devotion += 1>> <</if>> - <<if $slaves[$i].muscles < 30>> + <<if $slaves[$i].muscles < 60>> Hormonal changes encourage $his body to @@.lime;gain muscle.@@ <</if>> <<if (($slaves[$i].geneMods.NCS == 0) && ($slaves[$i].dick < 4) && (random(1,100) > 95))>> diff --git a/src/uncategorized/seRaiding.tw b/src/uncategorized/seRaiding.tw index 1384302b737e8f0e047bdc4cd17d313989529b11..a5729ac0a006802998c99bacc31418d5381e6791 100644 --- a/src/uncategorized/seRaiding.tw +++ b/src/uncategorized/seRaiding.tw @@ -141,7 +141,7 @@ target <<set $oneTimeDisableDisability = 1>> <<set $activeSlave = GenerateNewSlave("XX")>> <<set $activeSlave.career = "a student">> - <<set $activeSlave.face = random(-20,0)>> + <<set $activeSlave.face = random(15,100)>> <<set $activeSlave.anus = 0>> <<set $activeSlave.vagina = 1>> <<set $activeSlave.skill.vaginal = 0>> @@ -191,12 +191,12 @@ target <<set $oneTimeDisableDisability = 1>> <<set $activeSlave = GenerateNewSlave("XY")>> <<set $activeSlave.career = "a military officer">> - <<set $activeSlave.face = Math.clamp($activeSlave.face+20,-100,100)>> - <<set $activeSlave.faceImplant += 20>> <<set $activeSlave.skill.anal = 0>> <<set $activeSlave.skill.oral = 0>> <<set $activeSlave.skill.whoring = 0>> <<set $activeSlave.skill.combat = 1>> + <<set $activeSlave.intelligence = random(20,60)>> + <<set activeSlave.intelligenceImplant = 15>> <<set $activeSlave.hStyle = either("short", "very short")>> <<set $activeSlave.boobs = 150>> <<set $activeSlave.vagina = -1>> @@ -305,6 +305,8 @@ target <<set $activeSlave.skill.oral = 0>> <<set $activeSlave.skill.whoring = 0>> <<set $activeSlave.skill.entertainment = 35>> + <<set $activeSlave.intelligence = random(0,100)>> + <<set $activeSlave.intelligenceImplant = 15>> <<set $activeSlave.behavioralFlaw = "liberated">> <<set $activeSlave.sexualFlaw = "idealistic">> <<set $activeSlave.weight = random(-40,40)>> diff --git a/src/uncategorized/surgeryDegradation.tw b/src/uncategorized/surgeryDegradation.tw index 8820520c09674f3c5862b3ccdd3ca6e1189d8e01..eafa9bec44215867f3369512c3b47ed6b5317962 100644 --- a/src/uncategorized/surgeryDegradation.tw +++ b/src/uncategorized/surgeryDegradation.tw @@ -310,7 +310,7 @@ As the remote surgery's long recovery cycle completes, <<case "remove eyes">> Surgery doesn't take long, but since it was invasive there are @@.red;moderate health consequences.@@ As anesthesia wears off $he tries to open $his eyes and finds $he is unable to. <<if $activeSlave.fetish != "mindbroken" && $activeSlave.fuckdoll == 0>> - <<if $activeSlave.eyes != -2>> + <<if $activeSlave.eyes > -2>> <<if ($activeSlave.devotion > 50)>> When $he realizes why, $he begins to weep, not understanding what $he did to deserve this. After a short cry that trails off into a few sniffles, $he carries on. <<elseif ($activeSlave.devotion > 20)>> @@ -1842,6 +1842,17 @@ As the remote surgery's long recovery cycle completes, <</if>> <<case "amp">> + <<set $nextButton = " ">> + <<= App.Desc.limbChange().amputate($activeSlave, $oldLimbs, "Remote Surgery")>> + <<unset $oldLimbs>> + +<<case "PLimb interface">> + <<set $nextButton = " ">> + <<= App.Desc.limbChange().prosthetic($activeSlave, $oldLimbs, "Remote Surgery")>> + <<unset $oldLimbs>> + + /* +<<case "bla">> <<if $activeSlave.fetish == "mindbroken">> Of course, $he could not walk out of the surgery; you carried $him. $He squirms the entire time, trying to move the arms and legs $he now lacks. Since the surgery was invasive, @@.red;$his health has been greatly affected.@@ <<elseif ($activeSlave.devotion > 50)>> @@ -1882,6 +1893,7 @@ As the remote surgery's long recovery cycle completes, <<include "Prosthetics Configuration">> <<set $nextLink = "Remote Surgery">> + */ <<case "PLimb interface1">> When $he is carried out of surgery $he <<if canSee($activeSlave)>>cranes $his neck to better see the ports<<else>>wiggles $his stumps trying to feel the ports<</if>> installed in $his 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. diff --git a/src/utility/slaveCreationWidgets.tw b/src/utility/slaveCreationWidgets.tw index da88fcf7a380c0b5a66882afdf75d49b519aa402..e991469dab8ee3acd882f3f2fc6338583b476ee9 100644 --- a/src/utility/slaveCreationWidgets.tw +++ b/src/utility/slaveCreationWidgets.tw @@ -802,7 +802,7 @@ <<case "Bodyguard">> <<set $activeSlave.devotion = 90, $activeSlave.muscles = random(30,70), $activeSlave.height = Math.round(Height.random($activeSlave, {skew: 3, spread: .2, limitMult: [1, 4]})), $activeSlave.weight = random(-10,10), $activeSlave.teeth = either("normal", "pointy"), $activeSlave.skill.combat = 1>> <<if jsRandom(0, 2) === 0>> - <<run attachLimbs($activeSlave, "all", 5)>> + <<run configureLimbs($activeSlave, "all", 5)>> <</if>> <<set $activeSlave.career = either("a bodyguard", "a kunoichi", "a law enforcement officer", "a military brat", "a revolutionary", "a soldier", "a transporter", "an assassin", "in a militia")>> <<case "Wardeness">>