diff --git a/src/js/generateMarketSlave.js b/src/js/generateMarketSlave.js index 42f49887829273456e425e5ed837748f5f5798a9..c7d852c1e832dc2c3e7a042b689d1a26661813e6 100644 --- a/src/js/generateMarketSlave.js +++ b/src/js/generateMarketSlave.js @@ -202,8 +202,7 @@ window.generateMarketSlave = function(market = "kidnappers", numArcology = 1) { V.activeSlave.face = Math.clamp(V.activeSlave.face+20, -100, 100); } if ((V.activeSlave.ageImplant !== 1) && (V.activeSlave.visualAge >= 25)) { - V.activeSlave.ageImplant = 1; - ageImplantAdjustment(V.activeSlave); + applyAgeImplant(V.activeSlave); } if ((V.activeSlave.voice === 1) && (V.activeSlave.voiceImplant === 0)) { V.activeSlave.voice += 1; @@ -808,9 +807,8 @@ window.generateMarketSlave = function(market = "kidnappers", numArcology = 1) { } } else { r += `And if they aren't, they sure don't look their age. `; - V.activeSlave.ageImplant = 1; V.activeSlave.faceImplant += jsRandom(10, 30); - ageImplantAdjustment(V.activeSlave); + applyAgeImplant(V.activeSlave); } } } else if (V.arcologies[market].FSMaturityPreferentialist > 20) { @@ -1310,9 +1308,8 @@ window.generateMarketSlave = function(market = "kidnappers", numArcology = 1) { V.activeSlave.face = Math.clamp(V.activeSlave.face+V.activeSlave.faceImplant, -100, 100); } if (V.activeSlave.physicalAge >= 30) { - V.activeSlave.ageImplant += jsRandom(0, 1); - if (V.activeSlave.ageImplant === 1) { - ageImplantAdjustment(V.activeSlave); + if (jsRandom(0, 1) > 0) { + applyAgeImplant(V.activeSlave); } } } diff --git a/src/js/rulesAutosurgery.js b/src/js/rulesAutosurgery.js index 2a8c0648f39c151f71a514e420c1e1bf3447f70f..a089d206b8e19659d5b54a5d6a61a36dd0f11dd4 100644 --- a/src/js/rulesAutosurgery.js +++ b/src/js/rulesAutosurgery.js @@ -319,17 +319,8 @@ window.rulesAutosurgery = (function() { }); } else if (slave.faceImplant <= 15 && slave.ageImplant !== 1 && slave.visualAge >= 25 && thisSurgery.cosmetic > 0) { commitProcedure("an age lift", slave => { - slave.ageImplant = 1; slave.faceImplant += 25 - 5 * Math.trunc(V.PC.skill.medicine / 50) - 5 * V.surgeryUpgrade; - if (slave.visualAge > 80) { - slave.visualAge -= 40; - } else if (slave.visualAge >= 70) { - slave.visualAge -= 30; - } else if (slave.visualAge > 50) { - slave.visualAge -= 20; - } else if (slave.visualAge > 36) { - slave.visualAge -= 10; - } else { slave.visualAge -= 5; } + applyAgeImplant(slave); }); } else if (((slave.underArmHStyle !== "bald" && slave.underArmHStyle !== "hairless") || (slave.pubicHStyle !== "bald" && slave.pubicHStyle !== "hairless")) && thisSurgery.bodyhair === 2) { commitProcedure("body hair removal", slave => { @@ -380,18 +371,7 @@ window.rulesAutosurgery = (function() { }); } else if (slave.faceImplant <= 45 && slave.ageImplant !== 1 && slave.visualAge >= 25 && thisSurgery.cosmetic === 2) { commitProcedure("an age lift", slave => { - slave.ageImplant = 1; - if (slave.visualAge > 80) { - slave.visualAge -= 40; - } else if (slave.visualAge >= 70) { - slave.visualAge -= 30; - } else if (slave.visualAge > 50) { - slave.visualAge -= 20; - } else if (slave.visualAge > 36) { - slave.visualAge -= 10; - } else { - slave.visualAge -= 5; - } + applyAgeImplant(slave); slave.faceImplant += 25 - 5 * Math.trunc(V.PC.skill.medicine / 50) - 5 * V.surgeryUpgrade; }); } else if (slave.voice < 3 && slave.voiceImplant === 0 && thisSurgery.cosmetic === 2) { diff --git a/src/js/slaveGenerationJS.js b/src/js/slaveGenerationJS.js index d228006a17af6dd7fc376c5926e6e2f58d34e6b6..c4de55dadbdb853959bde69a776cc1ea6b1ce82c 100644 --- a/src/js/slaveGenerationJS.js +++ b/src/js/slaveGenerationJS.js @@ -1550,18 +1550,25 @@ window.generatePuberty = function(slave) { }; /** + * Apply the effects of an age lift (make them appear younger than they do currently) * @param {App.Entity.SlaveState} slave */ -window.ageImplantAdjustment = function(slave) { - if (slave.visualAge > 80) { - slave.visualAge -= 40; - } else if (slave.visualAge >= 70) { - slave.visualAge -= 30; - } else if (slave.visualAge > 50) { - slave.visualAge -= 20; - } else if (slave.visualAge > 36) { - slave.visualAge -= 10; - } else { - slave.visualAge -= 5; +window.applyAgeImplant = function(slave) { + if (slave.visualAge >= 25) { + slave.ageImplant = 1; + /* roughly: 25 -> 19, 35 -> 25, 50 -> 32, 80 -> 40, 130 -> 50 */ + slave.visualAge = Math.round(18.5 * Math.log(slave.visualAge) - 40); + } +}; + +/** + * Makes someone appear older than they do currently + * @param {App.Entity.SlaveState} slave + */ +window.applyAgeImplantOlder = function(slave) { + if (slave.visualAge < 80) { + // doesn't currently set ageImplant + /* roughly: 5 -> 20, 35 -> 45, 50 -> 56, 60 -> 64, 79 -> 80 */ + slave.visualAge = Math.round(0.8 * slave.visualAge + 16); } }; diff --git a/src/player/pcSurgeryDegradation.tw b/src/player/pcSurgeryDegradation.tw index 48515a7cec732f3750606cb5587e1fdf74cbb0e2..4a385785081241bae8c63149e32ddde7f7f98703 100644 --- a/src/player/pcSurgeryDegradation.tw +++ b/src/player/pcSurgeryDegradation.tw @@ -17,11 +17,11 @@ <<case "ageDown">> After a few hours, you awaken in the recovery wing with a face both sore and somewhat numb. Sitting up, you catch sight of yourself in the mirror-covered wall across from your bed. An oddly familiar face is staring back at you; it takes you a moment to register in your groggy state that it isn't your past self but rather the result of the age reduction surgery. You attempt to smile at yourself, only to find your face doesn't want to comply; guess the drugs haven't completely worn off yet. You lie back down to sleep off the rest of the anesthesia before returning to your arcology. - <<PCAgeImplantAdjustmentDown>> + <<applyAgeImplant($PC)>> <<case "ageUp">> After a few hours, you awaken in the recovery wing with a face both sore and somewhat numb. Sitting up, you catch sight of yourself in the mirror-covered wall across from your bed. An oddly familiar face is staring back at you; it takes you a moment to register in your groggy state that you are in fact looking at the result of the age increasing surgery. You attempt to smile at yourself, only to find your face doesn't want to comply; guess the drugs haven't completely worn off yet. You lie back down to sleep off the rest of the anesthesia before returning to your arcology. - <<PCAgeImplantAdjustmentUp>> + <<applyAgeImplantOlder($PC)>> <<case "breastReductionImplant">> After a few hours, you awaken in the recovery wing with a sore chest. <<if $PC.belly >= 10000>>Struggling to sit<<else>>Sitting<</if>> up, you immediately notice how much lighter your breasts are. Pulling the covers off yourself, you observe your implant free boobs in the mirror-covered wall across from your bed. "So do you like them?", asks the surgeon's assistant, seating _himselfU behind you and wrapping _hisU hands around to your natural breasts. "We made sure to tighten them up a bit, get rid of that sag from not having the silicone pouch in them anymore." _HeU begins groping your breasts, feeling for any oddities. "I know you're still a little sore, but bear with it." _HeU moves on to your nipples and begins teasing them. <<if $PC.lactation > 0>>_HeU lets out a surprised squeak when a gush of milk escapes your breasts and a moan escapes your lips. "<<if $PC.pregKnown == 1>>Should have expected that with the pregnancy and all.<<else>>You did recently have a child didn't you? Or have you just been enjoying your nipples too much?<</if>> Either way, this is a good thing. Your breasts work."<</if>> You can't help but moan under your building arousal as _heU massages and teases your breasts. "Enjoying yourself are we? Let me finish you off." _HeU sneaks a hand down to your <<if $PC.dick != 0>>stiff prick and begins stroking its length, quickly bringing you to orgasm and relieving you of your built up tension.<<else>>stiff clit and begins teasing it as well, quickly bringing you to orgasm and relieving you of your built up tension.<</if>> _HeU states, while licking _hisU fingers, "I always did enjoy the way you taste. Feel free to rest as long as you need before departing. If you need, or want, me, I'll be around." Satisfied, you lie back down to sleep off the rest of the anesthesia before returning to your arcology. diff --git a/src/pregmod/widgets/pregmodWidgets.tw b/src/pregmod/widgets/pregmodWidgets.tw index b7b05d0bc64e1b59c654d6fb5c50b0e33c18d1b6..89bf73f4cd289dad0c2bf6573e0c17ac98387b71 100644 --- a/src/pregmod/widgets/pregmodWidgets.tw +++ b/src/pregmod/widgets/pregmodWidgets.tw @@ -144,34 +144,6 @@ <<set _WivesALisp = lispReplace(_WivesA)>> <</widget>> -<<widget "PCAgeImplantAdjustmentUp">> - <<if $PC.visualAge < 35>> - <<set $PC.visualAge += 15>> - <<elseif $PC.visualAge <= 50>> - <<set $PC.visualAge += 10>> - <<elseif $PC.visualAge < 60>> - <<set $PC.visualAge += 5>> - <<elseif $PC.visualAge < 80>> - <<set $PC.visualAge += 3>> - <<else>> - <<set $PC.visualAge += 1>> - <</if>> -<</widget>> - -<<widget "PCAgeImplantAdjustmentDown">> - <<if $PC.visualAge > 80>> - <<set $PC.visualAge -= 40>> - <<elseif $PC.visualAge >= 70>> - <<set $PC.visualAge -= 30>> - <<elseif $PC.visualAge > 50>> - <<set $PC.visualAge -= 20>> - <<elseif $PC.visualAge > 36>> - <<set $PC.visualAge -= 10>> - <<else>> - <<set $PC.visualAge -= 5>> - <</if>> -<</widget>> - <<widget "InitStandards">> <<set $activeStandard = {age: 24, weightMax: 0, weightMin: 0, musclesMin: 0, musclesMax: 0, raceSup: "white", raceSub: "white", boobs: 0, boobsImplant: 0, lactation: 0, hips: 0, hipsImplant: 0, butt: 0, buttImplant: 0, face: 0, faceImplant: 0, lips: 15, lipsImplant: 0, chem: 0, addict: 0, intelligence: 0, intelligenceImplant: 0, bellyImplant: -1, beauty: 0, dick: 0, balls: 0, health: 0, skill: 0, accent: 0, height: 150, energy: 100}>> @@ -938,124 +910,6 @@ $activeSlave.slaveName is up for review: <</widget>> -/* -<<widget "GenSkinTone">> - -black 5 -brown 4 -dark 3 -olive 2 -light brown 1 -natural 0 -light -1 -white -2 -fair -3 -pale -4 -extremely pale -5 - -<<set _skin = 0>> -<<set _skin0 = 0>> -<<set _skin1 = 0>> - -<<switch $args[0].skin>> -<<case "black">> - <<set _skin0 = 10>> -<<case "brown">> - <<set _skin0 = 9>> -<<case "dark">> - <<set _skin0 = 8>> -<<case "olive">> - <<set _skin0 = 7>> -<<case "light brown">> - <<set _skin0 = 6>> -<<case "natural">> - <<set _skin1 = 5>> -<<case "light">> - <<set _skin0 = 4>> -<<case "white">> - <<set _skin0 = 3>> -<<case "fair">> - <<set _skin0 = 2>> -<<case "pale">> - <<set _skin0 = 1>> -<<case "extremely pale">> - <<set _skin0 = 0>> -<<default>> - <<set _skin0 = 5>> -<</switch>> - -<<switch $args[1].skin>> -<<case "black">> - <<set _skin1 = 10>> -<<case "brown">> - <<set _skin1 = 9>> -<<case "dark">> - <<set _skin1 = 8>> -<<case "olive">> - <<set _skin1 = 7>> -<<case "light brown">> - <<set _skin1 = 6>> -<<case "natural">> - <<set _skin1 = 5>> -<<case "light">> - <<set _skin1 = 4>> -<<case "white">> - <<set _skin1 = 3>> -<<case "fair">> - <<set _skin1 = 2>> -<<case "pale">> - <<set _skin1 = 1>> -<<case "extremely pale">> - <<set _skin1 = 0>> -<<default>> - <<set _skin1 = 5>> -<</switch>> - -<<set _skin = Math.round((_skin1+_skin0)/2)>> - -<<switch _skin>> -<<case 10>> - <<set $activeSlave.skin = "black">> -<<case 9>> - <<set $activeSlave.skin = "brown">> -<<case 8>> - <<set $activeSlave.skin = "dark">> -<<case 7>> - <<set $activeSlave.skin = "olive">> -<<case 6>> - <<set $activeSlave.skin = "light brown">> -<<case 5>> - <<set $activeSlave.skin = "natural">> -<<case 4>> - <<set $activeSlave.skin = "light">> -<<case 3>> - <<set $activeSlave.skin = "white">> -<<case 2>> - <<set $activeSlave.skin = "fair">> -<<case 1>> - <<set $activeSlave.skin = "pale">> -<<case 0>> - <<set $activeSlave.skin = "extremely pale">> -<<default>> - <<set $activeSlave.skin = either($args[0].skin, $args[1].skin)>> -<</switch>> - -<</widget>> -*/ - -<<widget "GenSkinTone">> -<<script>> -(function() { - var skinToMelanin = {'pure black': 10, ebony: 9.5, black: 9, 'dark brown': 8.5, brown: 8, 'light brown': 7.5, dark: 7, 'dark olive': 6.5, bronzed: 6, tanned: 5.5, natural: 5, olive: 4.5, 'light olive': 4, lightened: 3.5, light: 3, white: 2.5, fair: 2, 'very fair': 1.5, 'extremely fair': 1.25, pale: 1, 'extremely pale': 0.5, 'pure white': 0}; - var parents = State.variables.args; - var skin0 = parents[0] ? (skinToMelanin[parents[0].skin] || 5) : 3; - var skin1 = parents[1] ? (skinToMelanin[parents[1].skin] || 5) : 3; - var skin = Math.round(Math.random() * (skin1 - skin0) + skin0); - State.variables.activeSlave.skin = ['pure white', 'extremely pale', 'pale', 'extremely fair', 'very fair', 'fair', 'white', 'light', 'lightened', 'light olive', 'olive', 'natural', 'tanned', 'bronzed', 'dark olive', 'dark', 'light brown', 'brown', 'dark brown', 'black', 'ebony', 'pure black'][skin]; -})(); -<</script>> -<</widget>> - <<widget "ParentNames">> <<set _currentSlaveNames = $slaves.map(s => s.slaveName)>> <<if $allowMaleSlaveNames>> diff --git a/src/uncategorized/PESS.tw b/src/uncategorized/PESS.tw index 7eb76a7e239731ff4a1f95dea53360ac40b13efe..1afe67e53607ecbabb0d75afe0a365952a4aacee 100644 --- a/src/uncategorized/PESS.tw +++ b/src/uncategorized/PESS.tw @@ -284,7 +284,7 @@ $He sees you examining at $him, and looks back at you submissively, too tired to <<set $slaves[$i].waist -= 20>> <<run cashX(forceNeg(Math.trunc(200*$upgradeMultiplierMedicine)), "slaveSurgery", $activeSlave)>> <<elseif $slaves[$i].visualAge > 35 && $slaves[$i].ageImplant == 0 && $slaves[$i].faceImplant <= 10>> - <<set $slaves[$i].ageImplant = 1>><<run ageImplantAdjustment($slaves[$i])>> + <<run applyAgeImplant($slaves[$i])>> <<set $slaves[$i].faceImplant += 25-5*Math.trunc($PC.skill.medicine/100)-5*$surgeryUpgrade>> <<run cashX(forceNeg(Math.trunc(200*$upgradeMultiplierMedicine)), "slaveSurgery", $activeSlave)>> <<elseif $slaves[$i].lips <= 40>> diff --git a/src/uncategorized/pRivalryCapture.tw b/src/uncategorized/pRivalryCapture.tw index d2991a39af010aa838ee6d4790e2fdc5183d625e..8eb1226e6527704f56ff0f1b453bdeb4c6c85796 100644 --- a/src/uncategorized/pRivalryCapture.tw +++ b/src/uncategorized/pRivalryCapture.tw @@ -406,7 +406,7 @@ <<set $activeSlave.prestige = 3>> <<set $activeSlave.prestigeDesc = "You bankrupted and enslaved $him in revenge for $his part in the attack on your arcology by the Daughters of Liberty.">> <<run setHealth($activeSlave, 100, 0, 0, 0, jsRandom(10, 30))>> -<<if $activeSlave.physicalAge > 35>><<set $activeSlave.ageImplant = 1>><<run ageImplantAdjustment($activeSlave)>><</if>> +<<if $activeSlave.physicalAge > 35>><<run applyAgeImplant($activeSlave)>><</if>> <<set $activeSlave.pubicHStyle = "waxed">> <<set $activeSlave.underArmHStyle = "waxed">> diff --git a/src/uncategorized/remoteSurgery.tw b/src/uncategorized/remoteSurgery.tw index 6972f1dfb55a06dc1066216aacd8d2f3c36b1166..e76f31c0eea7415e9e44417743e2d5b94aae1f0d 100644 --- a/src/uncategorized/remoteSurgery.tw +++ b/src/uncategorized/remoteSurgery.tw @@ -128,7 +128,7 @@ <<elseif ($activeSlave.physicalAge >= 25) && ($activeSlave.visualAge >= 25)>> $He's old enough that a face lift and other minor cosmetic procedures could make $him look younger. <div class="choices"> - [[Age lift|Surgery Degradation][$activeSlave.ageImplant = 1,$activeSlave.faceImplant = Math.clamp($activeSlave.faceImplant+_artificiality,0,100),cashX(forceNeg($surgeryCost), "slaveSurgery", $activeSlave), surgeryDamage($activeSlave,10),$surgeryType = "age"]] + [[Age lift|Surgery Degradation][applyAgeImplant($activeSlave),$activeSlave.faceImplant = Math.clamp($activeSlave.faceImplant+_artificiality,0,100),cashX(forceNeg($surgeryCost), "slaveSurgery", $activeSlave), surgeryDamage($activeSlave,10),$surgeryType = "age"]] </div> <</if>> <</if>> diff --git a/src/uncategorized/surgeryDegradation.tw b/src/uncategorized/surgeryDegradation.tw index 4625abb71b8b5676cb7c7c5d9183503d9225b173..68e8ac2b31bd9525855bb1ebc63a2ca3d1d969e0 100644 --- a/src/uncategorized/surgeryDegradation.tw +++ b/src/uncategorized/surgeryDegradation.tw @@ -1094,17 +1094,6 @@ As the remote surgery's long recovery cycle completes, <</if>> <<case "age">> - <<if $activeSlave.visualAge > 80>> - <<set $activeSlave.visualAge -= 40>> - <<elseif $activeSlave.visualAge >= 70>> - <<set $activeSlave.visualAge -= 30>> - <<elseif $activeSlave.visualAge > 50>> - <<set $activeSlave.visualAge -= 20>> - <<elseif $activeSlave.visualAge > 36>> - <<set $activeSlave.visualAge -= 10>> - <<else>> - <<set $activeSlave.visualAge -= 5>> - <</if>> <<if $activeSlave.fetish == "mindbroken">> $He doesn't notice the improvements to $his face, but $he's not the one looking at it. As with all surgery @@.red;$his health has been slightly affected.@@ <<elseif ($activeSlave.devotion > 50)>>