From 5d838ec34d536a1662ebfd1e43c9849f9946af6d Mon Sep 17 00:00:00 2001 From: DCoded <dcoded@live.com> Date: Mon, 25 Mar 2019 18:01:33 -0400 Subject: [PATCH] Bugfix --- .../nursery/longChildDescription.tw | 2 +- src/js/descriptionWidgets.js | 49 +++++++------------ src/uncategorized/longSlaveDescription.tw | 2 +- 3 files changed, 20 insertions(+), 33 deletions(-) diff --git a/src/facilities/nursery/longChildDescription.tw b/src/facilities/nursery/longChildDescription.tw index a74f29c8cc6..c74a6a2c12a 100644 --- a/src/facilities/nursery/longChildDescription.tw +++ b/src/facilities/nursery/longChildDescription.tw @@ -355,7 +355,7 @@ $he's <</if>> <</if>> - <<= App.Desc.eye($activeChild)>> + <<= App.Desc.Eye($activeChild)>> <<if $activeChild.fetish == "mindbroken">> However, @@.coral;$his mind is fundamentally broken;@@ everything $he experiences will quickly be forgotten. diff --git a/src/js/descriptionWidgets.js b/src/js/descriptionWidgets.js index d0046abb9a4..e2139b6ad8e 100644 --- a/src/js/descriptionWidgets.js +++ b/src/js/descriptionWidgets.js @@ -1,27 +1,22 @@ /* eslint-disable no-undef */ -App.Desc.eye = /** @param {App.Entity.SlaveState} slave */ function(slave) { +App.Desc.Eye = /** @param {App.Entity.SlaveState} slave */ function(slave) { "use strict"; const V = State.variables; let r; - let hc; let p = getPronouns(slave); if (slave.eyes === -2) { - if (hasVisibleHeterochromia(slave)) { - hc = 1; - } else { - hc = 0; - } - if (slave.eyeColor !== "empty") { + const HC = hasVisibleHeterochromia(slave) ? 1 : 0; + if (slave.EyeColor !== "empty") { r += `${p.His} eyes are dull`; if (V.saleDescription && V.PC.medicine >= 50 || V.PC.slaving >= 50) { r += `, unfocused`; - if (hc) { + if (HC) { r += `, heterochromatic,`; } r += ` and clearly nonfunctional` } else { - if (hc) { + if (HC) { r += `, heterochromatic,`; } r += ` and unfocused`; @@ -129,7 +124,7 @@ App.Desc.eye = /** @param {App.Entity.SlaveState} slave */ function(slave) { } } else { if (slave.intelligence > 95) { - r += `${p.His} ${App.Desc.eyeColor(slave)}-eyed gaze is incisive, quick, cunning;`; + r += `${p.His} ${App.Desc.EyeColor(slave)}-eyed gaze is incisive, quick, cunning;`; if (slave.intelligence+slave.intelligenceImplant >= 130) { r += `with ${p.his} education, ${p.he} is so far <span class=deepskyblue>beyond brilliant</span> that ${p.he} is nearly peerless.`; } else if (slave.intelligenceImplant >= 15) { @@ -148,15 +143,15 @@ App.Desc.eye = /** @param {App.Entity.SlaveState} slave */ function(slave) { r += `education is unimportant.`; } } else if (slave.intelligence > 50) { - r += `${p.His} ${App.Desc.eyeColor(slave)}-eyed gaze is incisive, quick, cunning; with ${p.his} education, ${p.he} can be considered <span class=deepskyblue>brilliant.</span>`; + r += `${p.His} ${App.Desc.EyeColor(slave)}-eyed gaze is incisive, quick, cunning; with ${p.his} education, ${p.he} can be considered <span class=deepskyblue>brilliant.</span>`; if (slave.intelligence+slave.intelligenceImplant > 95) { - r += `${p.His} ${App.Desc.eyeColor(slave)} eyes are alive with intelligence; ${p.he} is both <span class=deepskyblue>highly intelligent</span> and `; + r += `${p.His} ${App.Desc.EyeColor(slave)} eyes are alive with intelligence; ${p.he} is both <span class=deepskyblue>highly intelligent</span> and `; } else if (slave.intelligenceImplant >= 15) { r += `well `; if (slave.intelligenceImplant >= 30) { r += `educated.`; } - r += `${p.His} ${App.Desc.eyeColor(slave)} eyes are alive with intelligence; ${p.he} is so <span class=deepskyblue>highly intelligent</span> that ${p.his} `; + r += `${p.His} ${App.Desc.EyeColor(slave)} eyes are alive with intelligence; ${p.he} is so <span class=deepskyblue>highly intelligent</span> that ${p.his} `; } else { r += `meager`; if (slave.intelligenceImplant > 0) { @@ -166,7 +161,7 @@ App.Desc.eye = /** @param {App.Entity.SlaveState} slave */ function(slave) { } } } else if (slave.intelligence > 15) { - r += `${p.His} ${App.Desc.eyeColor(slave)} eyes are`; + r += `${p.His} ${App.Desc.EyeColor(slave)} eyes are`; if (slave.intelligence+slave.intelligenceImplant >= 50) { r += `alive with intelligence; with ${p.his} education, ${p.he} can be considered <span class=deepskyblue>highly intelligent.</span>`; if (slave.intelligenceImplant >= 15) { @@ -180,7 +175,7 @@ App.Desc.eye = /** @param {App.Entity.SlaveState} slave */ function(slave) { } } } else if (slave.intelligence >= -15) { - r += `${p.His} ${App.Desc.eyeColor(slave)} eyes are`; + r += `${p.His} ${App.Desc.EyeColor(slave)} eyes are`; if (slave.intelligence+slave.intelligenceImplant >= 15) { r += `clever; with ${p.his} education, ${p.he} can be considered of <span class=deepskyblue>above average intelligence.</span>`; if (slave.intelligenceImplant >= 15) { @@ -194,7 +189,7 @@ App.Desc.eye = /** @param {App.Entity.SlaveState} slave */ function(slave) { } } } else if (slave.intelligence >= -50) { - r += `${p.His} ${App.Desc.eyeColor(slave)} eyes are`; + r += `${p.His} ${App.Desc.EyeColor(slave)} eyes are`; if (slave.intelligence+slave.intelligenceImplant >= -15) { r += `alert; with ${p.his} education, ${p.he} can be considered of average intelligence.`; if (slave.intelligenceImplant >= 15) { @@ -210,7 +205,7 @@ App.Desc.eye = /** @param {App.Entity.SlaveState} slave */ function(slave) { } } } else if (slave.intelligence >= -95) { - r += `${p.His} ${App.Desc.eyeColor(slave)} eyes are`; + r += `${p.His} ${App.Desc.EyeColor(slave)} eyes are`; if (slave.intelligence+slave.intelligenceImplant >= -50) { r += `dull; ${p.he} is <span class=orangered>quite stupid</span> despite having `; if (slave.intelligenceImplant >= 15) { @@ -224,7 +219,7 @@ App.Desc.eye = /** @param {App.Entity.SlaveState} slave */ function(slave) { } } } else { - r += `${p.His} ${App.Desc.eyeColor(slave)}-eyed gaze betrays near-total insensibility;`; + r += `${p.His} ${App.Desc.EyeColor(slave)}-eyed gaze betrays near-total insensibility;`; if (slave.intelligence+slave.intelligenceImplant >= -95) { r += `even with ${p.his} education, ${p.he} is still <span class=orangered>really stupid.</span>`; } if (slave.intelligenceImplant > 0) { @@ -237,23 +232,15 @@ App.Desc.eye = /** @param {App.Entity.SlaveState} slave */ function(slave) { return r; } -App.Desc.eyeColor = /** @param {App.Entity.SlaveState} slave */ function(slave) { +App.Desc.EyeColor = /** @param {App.Entity.SlaveState} slave */ function(slave) { "use strict"; const V = State.variables; let r; - if (typeof V.args[0] !== 'undefined') { - if (hasVisibleHeterochromia(V.args[0])) { - r += `heterochromatic ${V.args[0].eyeColor} and ${V.args[0].geneticQuirks.heterochromia}`; - } else { - r += `${V.args[0].eyeColor}` - } + if (hasVisibleHeterochromia(slave)) { + r += `heterochromatic ${slave.EyeColor} and ${slave.geneticQuirks.heterochromatia}`; } else { - if (hasVisibleHeterochromia(slave)) { - r += `heterochromatic ${slave.eyeColor} and ${slave.geneticQuirks.heterochromatia}`; - } else { - r += `${slave.eyeColor}`; - } + r += `${slave.EyeColor}`; } return r; } \ No newline at end of file diff --git a/src/uncategorized/longSlaveDescription.tw b/src/uncategorized/longSlaveDescription.tw index 538d938defb..bc2c7ee5115 100644 --- a/src/uncategorized/longSlaveDescription.tw +++ b/src/uncategorized/longSlaveDescription.tw @@ -541,7 +541,7 @@ is <<if $activeSlave.fuckdoll == 0>> /* NORMAL NON-FUCKDOLL MENTAL REPORT */ - <<= App.Desc.eye($activeSlave)>> + <<= App.Desc.Eye($activeSlave)>> <<if $activeSlave.fetish == "mindbroken">> However, @@.coral;$his mind is fundamentally broken;@@ everything $he experiences will quickly be forgotten. -- GitLab