From 00c5ed09d57b41b118bfc3be98bbf4a045bebedc Mon Sep 17 00:00:00 2001 From: lowercase-donkey <lowercasedonkey@gmail.com> Date: Sat, 27 Jul 2019 20:00:59 -0400 Subject: [PATCH] move tat widgets inside desc fix --- .../nursery/longChildDescription.tw | 17 +++--- src/js/describeTattoos.js | 61 +++++++++++++++++++ src/js/descriptionWidgets.js | 9 ++- src/npc/descriptions/boobs/boobs.js | 12 ---- src/uncategorized/bodyModification.tw | 22 +++---- src/uncategorized/longSlaveDescription.tw | 22 ++++--- src/utility/descriptionWidgetsFlesh.tw | 27 +++----- src/utility/descriptionWidgetsTattoos.tw | 18 ------ 8 files changed, 107 insertions(+), 81 deletions(-) create mode 100644 src/js/describeTattoos.js diff --git a/src/facilities/nursery/longChildDescription.tw b/src/facilities/nursery/longChildDescription.tw index 9c6b3dd183d..da979d185e6 100644 --- a/src/facilities/nursery/longChildDescription.tw +++ b/src/facilities/nursery/longChildDescription.tw @@ -1317,12 +1317,13 @@ $He is <<if $activeChild.fuckdoll == 0>> <<nailsDescription>> - <<if $showBodyMods == 1>> - <<backTatDescription>> - <<shouldersTatDescription>> - <<armsTatDescription>> - <</if>> <</if>> +<<= App.Desc.mods($activeChild, "back")>> +<<= App.Desc.mods($activeChild, "shoulder")>> +<<= App.Desc.mods($activeChild, "upper arm")>> +<<= App.Desc.mods($activeChild, "lower arm")>> +<<= App.Desc.mods($activeChild, "hand")>> +<<= App.Desc.mods($activeChild, "wrist")>> <<if $activeChild.fuckdoll == 0>> <<if $activeChild.minorInjury != 0>> @@ -1338,10 +1339,8 @@ $He is <<BoobsDescription>> <<boobsShapeDescription>> <<boobsExtraDescription>> -<<if $showBodyMods == 1>> - <<boobsTatDescription>> -<</if>> -<<boobBrandDescription>> +<<= App.Desc.mods($activeChild, "chest")>> +<<= App.Desc.mods($activeChild, "breast")>> <<shouldersDescription>> <<nipplesDescription>> <<if $showBodyMods == 1>> diff --git a/src/js/describeTattoos.js b/src/js/describeTattoos.js new file mode 100644 index 00000000000..acdd17f24f2 --- /dev/null +++ b/src/js/describeTattoos.js @@ -0,0 +1,61 @@ +/** + * @param {App.Entity.SlaveState} slave + * @returns {string} Relevant slave tattoo, if present + */ +App.Desc.tattoo = function(slave, surface) { + "use strict"; + const V = State.variables; + let r = ``; + /* eslint-disable no-unused-vars*/ + const { + he, him, his, hers, himself, boy, He, His + } = getPronouns(slave); + /* eslint-enable */ + switch (surface) { + case "shoulder": { + r += `<<shouldersTatDescription>>`; + break; + } + case "lips": { + r += `<<lipsTatDescription>>`; + break; + } + case "breast": { + r += `<<boobsTatDescription>>`; + break; + } + case "upper arm": { /* technically the old widget describes the ENTIRE arm, but we are going to display it here to preserve order */ + r += `<<armsTatDescription>>`; + break; + } + case "back": { + r += `<<backTatDescription>>`; + break; + } + case "lower back": { + r += `<<stampTatDescription>>`; + break; + } + case "buttock": { + r += `<<buttTatDescription>>`; + break; + } + case "vagina": { + r += `<<vaginaTatDescription>>`; + break; + } + case "penis": { + r += `<<dickTatDescription>>`; + break; + } + case "anus": { + r += `<<anusTatDescription>>`; + break; + } + case "thigh": { /* technically the old widget describes the ENTIRE leg, but we are going to display it here to preserve order */ + r += `<<legsTatDescription>>`; + break; + } + } + return r; +}; diff --git a/src/js/descriptionWidgets.js b/src/js/descriptionWidgets.js index 3322ea84ec8..28ac6fa97b2 100644 --- a/src/js/descriptionWidgets.js +++ b/src/js/descriptionWidgets.js @@ -581,7 +581,14 @@ App.Desc.ageAndHealth = function(slave) { * @returns {string} Slave's mods. */ App.Desc.mods = function(slave, surface) { - return App.Desc.brand(slave, surface) + App.Desc.scar(slave, surface); + const V = State.variables; + if (V.showBodyMods !== 1) { + return; + } + if (slave.fuckdoll !== 0 && !["vagina", "anus", "lips"].includes(surface)) { /* Fuckdoll vulva and anus alone are visibile, plus enormus lips */ + return; + } + return App.Desc.tattoo(slave, surface) + App.Desc.brand(slave, surface) + App.Desc.scar(slave, surface); }; /** diff --git a/src/npc/descriptions/boobs/boobs.js b/src/npc/descriptions/boobs/boobs.js index b3f7eeadbaa..a7d93502f6f 100644 --- a/src/npc/descriptions/boobs/boobs.js +++ b/src/npc/descriptions/boobs/boobs.js @@ -1479,18 +1479,6 @@ App.Desc.boobsExtra = function(slave, pronouns) { return r.join(' '); }; -/** - * @param {App.Entity.SlaveState} slave - * @returns {string} - */ -App.Desc.boobsBrand = function(slave) { - if (State.variables.showBodyMods === 1) { - if (slave.fuckdoll === 0) { - return(App.Desc.mods(slave, "chest") + App.Desc.mods(slave, "breast")); - } - } -}; - /** * @param {App.Entity.SlaveState} slave * @param {App.Utils.Pronouns} pronouns diff --git a/src/uncategorized/bodyModification.tw b/src/uncategorized/bodyModification.tw index 759b8a7ee50..b6829ef34dd 100644 --- a/src/uncategorized/bodyModification.tw +++ b/src/uncategorized/bodyModification.tw @@ -616,17 +616,17 @@ Choose piercing style: /* TATTOOS */ Tattoos: -<<if $activeSlave.shouldersTat != 0>> <br> <<shouldersTatDescription>><<set _hasTat = 1>><</if>> -<<if $activeSlave.lipsTat != 0>> <br> <<lipsTatDescription>><<set _hasTat = 1>><</if>> -<<if $activeSlave.boobsTat != 0>> <br> <<boobsTatDescription>><<set _hasTat = 1>><</if>> -<<if $activeSlave.armsTat != 0 && $activeSlave.amp != 1>> <br> <<armsTatDescription>><<set _hasTat = 1>><</if>> -<<if $activeSlave.backTat != 0>> <br> <<backTatDescription>><<set _hasTat = 1>><</if>> -<<if $activeSlave.stampTat != 0>> <br> <<stampTatDescription>><<set _hasTat = 1>><</if>> -<<if $activeSlave.buttTat != 0>> <br> <<buttTatDescription>><<set _hasTat = 1>><</if>> -<<if $activeSlave.vaginaTat != 0>> <br> <<vaginaTatDescription>><<set _hasTat = 1>><</if>> -<<if $activeSlave.dickTat != 0 && $activeSlave.dick > 0>> <br> <<dickTatDescription>><<set _hasTat = 1>><</if>> -<<if $activeSlave.anusTat != 0>> <br> <<anusTatDescription>><<set _hasTat = 1>><</if>> -<<if $activeSlave.legsTat != 0 && $activeSlave.amp != 1>> <br> <<legsTatDescription>><<set _hasTat = 1>><</if>> +<<if $activeSlave.shouldersTat != 0>> <br> <<= App.Desc.tattoo($activeSlave, "shoulder")>><<set _hasTat = 1>><</if>> +<<if $activeSlave.lipsTat != 0>> <br> <<= App.Desc.tattoo($activeSlave, "lips")>><<set _hasTat = 1>><</if>> +<<if $activeSlave.boobsTat != 0>> <br> <<= App.Desc.tattoo($activeSlave, "breast")>><<set _hasTat = 1>><</if>> +<<if $activeSlave.armsTat != 0 && $activeSlave.amp != 1>> <br> <<= App.Desc.tattoo($activeSlave, "upper arm")>><<set _hasTat = 1>><</if>> +<<if $activeSlave.backTat != 0>> <br> <<= App.Desc.tattoo($activeSlave, "back")>><<set _hasTat = 1>><</if>> +<<if $activeSlave.stampTat != 0>> <br> <<= App.Desc.tattoo($activeSlave, "lower back")>><<set _hasTat = 1>><</if>> +<<if $activeSlave.buttTat != 0>> <br> <<= App.Desc.tattoo($activeSlave, "buttock")>><<set _hasTat = 1>><</if>> +<<if $activeSlave.vaginaTat != 0>> <br> <<= App.Desc.tattoo($activeSlave, "vagina")>><<set _hasTat = 1>><</if>> +<<if $activeSlave.dickTat != 0 && $activeSlave.dick > 0>> <br> <<= App.Desc.tattoo($activeSlave, "penis")>><<set _hasTat = 1>><</if>> +<<if $activeSlave.anusTat != 0>> <br> <<= App.Desc.tattoo($activeSlave, "anus")>><<set _hasTat = 1>><</if>> +<<if $activeSlave.legsTat != 0 && $activeSlave.amp != 1>> <br> <<= App.Desc.tattoo($activeSlave, "thigh")>><<set _hasTat = 1>><</if>> <br> Choose a tattoo style: diff --git a/src/uncategorized/longSlaveDescription.tw b/src/uncategorized/longSlaveDescription.tw index a44ccee3490..582036d6452 100644 --- a/src/uncategorized/longSlaveDescription.tw +++ b/src/uncategorized/longSlaveDescription.tw @@ -1957,7 +1957,10 @@ $He is <</if>> <</if>> -<<legsTatDescription>> +<<= App.Desc.mods($activeSlave, "thigh")>> +<<= App.Desc.mods($activeSlave, "calf")>> +<<= App.Desc.mods($activeSlave, "ankle")>> +<<= App.Desc.mods($activeSlave, "foot")>> <<heelDescription>> <<skinDescription>> @@ -2115,12 +2118,13 @@ $He is <<if $activeSlave.fuckdoll == 0>> <<nailsDescription>> - <<if $showBodyMods == 1>> - <<backTatDescription>> - <<shouldersTatDescription>> - <<armsTatDescription>> - <</if>> <</if>> +<<= App.Desc.mods($activeSlave, "back")>> +<<= App.Desc.mods($activeSlave, "shoulder")>> +<<= App.Desc.mods($activeSlave, "upper arm")>> +<<= App.Desc.mods($activeSlave, "lower arm")>> +<<= App.Desc.mods($activeSlave, "hand")>> +<<= App.Desc.mods($activeSlave, "wrist")>> <<if $activeSlave.fuckdoll == 0>> <<if $activeSlave.minorInjury != 0>> @@ -2136,10 +2140,8 @@ $He is <<BoobsDescription>> <<boobsShapeDescription>> <<boobsExtraDescription>> -<<if $showBodyMods == 1>> - <<boobsTatDescription>> -<</if>> -<<boobBrandDescription>> +<<= App.Desc.mods($activeSlave, "chest")>> +<<= App.Desc.mods($activeSlave, "breast")>> <<shouldersDescription>> <<nipplesDescription>> <<if $showBodyMods == 1>> diff --git a/src/utility/descriptionWidgetsFlesh.tw b/src/utility/descriptionWidgetsFlesh.tw index 8ee62efc68f..715142ccb42 100644 --- a/src/utility/descriptionWidgetsFlesh.tw +++ b/src/utility/descriptionWidgetsFlesh.tw @@ -294,12 +294,6 @@ $He has <<print App.Desc.boobsExtra($activeSlave)>> <</widget>> - -<<widget "boobBrandDescription">> - <<print App.Desc.boobsBrand($activeSlave)>> -<</widget>> - - <<widget "nipplesDescription">> <<print App.Desc.nipples($activeSlave)>> <</widget>> @@ -1197,9 +1191,7 @@ $He has <</if>> -<<if $showBodyMods == 1>> - <<stampTatDescription>> -<</if>> +<<= App.Desc.mods($activeSlave, "lower back")>> $He's got a <<if $activeSlave.butt <= 1>> @@ -1398,9 +1390,7 @@ $He's got a <</if>> <</if>> -<<if $showBodyMods == 1>> - <<buttTatDescription>> -<</if>> +<<= App.Desc.mods($activeSlave, "buttock")>> <</widget>> @@ -1480,9 +1470,9 @@ $He's got a <<buttplugDescription>> +<<= App.Desc.mods($activeSlave, "anus")>> <<if $showBodyMods == 1>> <<anusPiercingDescription>> - <<anusTatDescription>> <</if>> <<if $activeSlave.fuckdoll > 0>> @@ -3612,12 +3602,11 @@ $He's got a <</if>> <</if>> +<<= App.Desc.mods($activeSlave, "dick")>> +<<= App.Desc.mods($activeSlave, "testicle")>> <<if $activeSlave.fuckdoll == 0>> <<if $showBodyMods == 1>> - <<dickTatDescription>> <<dickPiercingDescription>> - <<= App.Desc.mods($activeSlave, "penis")>> - <<= App.Desc.mods($activeSlave, "testicle")>> <</if>> <</if>> @@ -4024,10 +4013,8 @@ $He's got a <<if $showBodyMods == 1>> <<vaginaPiercingDescription>> <<clitPiercingDescription>> - <<if $activeSlave.fuckdoll == 0>> - <<vaginaTatDescription>> - <</if>> <</if>> +<<= App.Desc.mods($activeSlave, "vagina")>> <<if $activeSlave.fuckdoll == 0>> <<if ($activeSlave.releaseRules == "permissive") || $activeSlave.releaseRules == "masturbation">> @@ -4396,9 +4383,9 @@ $His <<if $showBodyMods == 1>> <<if $activeSlave.fuckdoll == 0>> <<makeupDescription>> - <<lipsTatDescription>> <</if>> <</if>> +<<= App.Desc.mods($activeSlave, "lips")>> <</widget>> diff --git a/src/utility/descriptionWidgetsTattoos.tw b/src/utility/descriptionWidgetsTattoos.tw index 3b578fee440..be380ebb67f 100644 --- a/src/utility/descriptionWidgetsTattoos.tw +++ b/src/utility/descriptionWidgetsTattoos.tw @@ -44,7 +44,6 @@ $activeSlave.shouldersTat <</switch>> <</if>> - <<= App.Desc.mods($activeSlave, "shoulder")>> <</if>> <</widget>> @@ -91,7 +90,6 @@ $activeSlave.lipsTat <</switch>> <</if>> - <<= App.Desc.mods($activeSlave, "lips")>> <</if>> <</widget>> @@ -135,8 +133,6 @@ $activeSlave.boobsTat <</switch>> <</if>> - /* App.Desc.boobsBrand handles boobBrands */ - /*<<= App.Desc.mods($activeSlave, "breast")>>*/ <</if>> <</widget>> @@ -224,10 +220,6 @@ $activeSlave.armsTat <</switch>> <</if>> - <<= App.Desc.mods($activeSlave, "upper arm")>> - <<= App.Desc.mods($activeSlave, "lower arm")>> - <<= App.Desc.mods($activeSlave, "hand")>> - <<= App.Desc.mods($activeSlave, "wrist")>> <</if>> <</widget>> @@ -309,7 +301,6 @@ $activeSlave.backTat <</switch>> <</if>> - <<= App.Desc.mods($activeSlave, "back")>> <</if>> <</widget>> @@ -359,7 +350,6 @@ $activeSlave.stampTat <</switch>> <</if>> - <<= App.Desc.mods($activeSlave, "lower back")>> <</if>> <</widget>> @@ -424,7 +414,6 @@ $activeSlave.buttTat <</switch>> <</if>> -<<= App.Desc.mods($activeSlave, "buttock")>> <</if>> <</widget>> @@ -590,9 +579,6 @@ $activeSlave.anusTat <</switch>> <</if>> -/* Just in case someone makes these someday: */ -<<= App.Desc.mods($activeSlave, "anus")>> -<<= App.Desc.mods($activeSlave, "asshole")>> <</widget>> <<widget "legsTatDescription">> @@ -633,9 +619,5 @@ $activeSlave.legsTat <</switch>> <</if>> - <<= App.Desc.mods($activeSlave, "thigh")>> - <<= App.Desc.mods($activeSlave, "calf")>> - <<= App.Desc.mods($activeSlave, "ankle")>> - <<= App.Desc.mods($activeSlave, "foot")>> <</if>> <</widget>> -- GitLab