From 1137f299ceb1feb14ce6ffb1f36832d399d8f827 Mon Sep 17 00:00:00 2001 From: lowercasedonkey <lowercasedonkey@gmail.com> Date: Thu, 4 Jun 2020 21:16:43 -0400 Subject: [PATCH] height implant with dedupe --- src/npc/descriptions/heightImplant.js | 43 +++++++++++++++++++++++ src/uncategorized/longSlaveDescription.tw | 2 +- src/utility/descriptionWidgetsFlesh.tw | 14 -------- 3 files changed, 44 insertions(+), 15 deletions(-) create mode 100644 src/npc/descriptions/heightImplant.js diff --git a/src/npc/descriptions/heightImplant.js b/src/npc/descriptions/heightImplant.js new file mode 100644 index 00000000000..7e28d4980d1 --- /dev/null +++ b/src/npc/descriptions/heightImplant.js @@ -0,0 +1,43 @@ +App.Desc.heightImplant = function(slave) { + let r; + const { + he, him, his, hers, himself, boy, He, His + } = getPronouns(slave); + if (slave.heightImplant > 1) { + r = limbs(); + r.push(`are wrong; it's obvious that they have been artificially lengthened.`); + } else if (slave.heightImplant > 0) { + r = limbs(); + r.push(` are odd, as though they have been artificially lengthened.`); + } else if (slave.heightImplant < -1) { + r = limbs(); + r.push(` are wrong; it's obvious that they have been artificially shortened.`); + } else if (slave.heightImplant < 0) { + r = limbs(); + r.push(` are odd, as though they have been artificially shortened.`); + } + + function limbs() { + const r = []; + r.push(`The proportions of ${his} `); + if (hasAnyArms(slave)) { + if (hasBothArms(slave)) { + r.push(`arms`); + } else { + r.push(`arm`); + } + if (hasAnyLegs(slave)) { + r.push(` and `); + } + } + if (hasAnyLegs(slave)) { + if (hasBothLegs(slave)) { + r.push(`legs`); + } else { + r.push(`leg`); + } + } + return r; + } + return r.join(" "); +}; diff --git a/src/uncategorized/longSlaveDescription.tw b/src/uncategorized/longSlaveDescription.tw index 67180fadbe0..24040ec47ee 100644 --- a/src/uncategorized/longSlaveDescription.tw +++ b/src/uncategorized/longSlaveDescription.tw @@ -1658,7 +1658,7 @@ and <</if>> <</if>> -<<heightImplantDescription>> +<<= App.Desc.heightImplant($activeSlave)>> $He is <<if $activeSlave.muscles > 95>> diff --git a/src/utility/descriptionWidgetsFlesh.tw b/src/utility/descriptionWidgetsFlesh.tw index 9bae1ba8232..00503bf093b 100644 --- a/src/utility/descriptionWidgetsFlesh.tw +++ b/src/utility/descriptionWidgetsFlesh.tw @@ -1,19 +1,5 @@ :: flesh description widgets [widget nobr] -<<widget "heightImplantDescription">> - -<<if $activeSlave.heightImplant > 1>> - The proportions of $his <<if hasAnyArms($activeSlave)>>arm<<if hasBothArms($activeSlave)>>s<</if>><<if hasAnyLegs($activeSlave)>> and <</if>><</if>><<if hasAnyLegs($activeSlave)>>leg<<if hasBothLegs($activeSlave)>>s<</if>><</if>> are wrong; it's obvious that they have been artificially lengthened. -<<elseif $activeSlave.heightImplant > 0>> - The proportions of $his <<if hasAnyArms($activeSlave)>>arm<<if hasBothArms($activeSlave)>>s<</if>><<if hasAnyLegs($activeSlave)>> and <</if>><</if>><<if hasAnyLegs($activeSlave)>>leg<<if hasBothLegs($activeSlave)>>s<</if>><</if>> are odd, as though they have been artificially lengthened. -<<elseif $activeSlave.heightImplant < -1>> - The proportions of $his <<if hasAnyArms($activeSlave)>>arm<<if hasBothArms($activeSlave)>>s<</if>><<if hasAnyLegs($activeSlave)>> and <</if>><</if>><<if hasAnyLegs($activeSlave)>>leg<<if hasBothLegs($activeSlave)>>s<</if>><</if>> are wrong; it's obvious that they have been artificially shortened. -<<elseif $activeSlave.heightImplant < 0>> - The proportions of $his <<if hasAnyArms($activeSlave)>>arm<<if hasBothArms($activeSlave)>>s<</if>><<if hasAnyLegs($activeSlave)>> and <</if>><</if>><<if hasAnyLegs($activeSlave)>>leg<<if hasBothLegs($activeSlave)>>s<</if>><</if>> are odd, as though they have been surgically shortened. -<</if>> - -<</widget>> - <<widget "boobsShapeDescription">> <<if $showImplantEffects == 1>> -- GitLab