diff --git a/src/SpecialForce/SpecialForce.js b/src/SpecialForce/SpecialForce.js index dc2c50286c2f66f934617931c948c77bb82c7946..2781621225f12ac7d729fb08ae2e5b91ae147fcf 100644 --- a/src/SpecialForce/SpecialForce.js +++ b/src/SpecialForce/SpecialForce.js @@ -44,7 +44,7 @@ window.SFInit = function() { window.SFBC = function() { function jsDel(input) { - while(input.length > 0) { + while (input.length > 0) { delete input[0]; input.splice(input[0],1); } } @@ -213,7 +213,7 @@ window.SFBC = function() { window.SFReport = function() { "use strict"; const V = State.variables, T = State.temporary, S = V.SF.Squad; - const target = 50000, baseLine = 5000;let profit = 0, upkeep = 0, income = 0; + const target = 50000, baseLine = 5000; let profit = 0, upkeep = 0, income = 0; let Multiplier = {action:1, troop:1, unit:1, depravity:1}; let FNG = 10, unitCap = 2500, Trade = 0.025; let cost = {a:0.01,b:2.5}, NO = 1+(V.SF.Size/5), N1 = 1+(V.SF.Size/5); @@ -1124,4 +1124,4 @@ window.UnitText = function(input) { } text += `<br>`; return text; -};*/ \ No newline at end of file +};*/ diff --git a/src/endWeek/minorInjuryResponse.js b/src/endWeek/minorInjuryResponse.js index 0a3c400e7d949136f20c8be5a9782091f8baf3f1..d955c359411d6e595747c26b2653f32787b30441 100644 --- a/src/endWeek/minorInjuryResponse.js +++ b/src/endWeek/minorInjuryResponse.js @@ -3,12 +3,12 @@ window.minorInjuryResponse = /** @param {App.Entity.SlaveState} slave */ function minorInjuryResponse(slave) { const arcology = State.variables.arcologies[0]; const arcologyUpgrade = State.variables.arcologyUpgrade; - let pronouns = getPronouns(slave); + const pronouns = getPronouns(slave); const he = pronouns.pronoun; const himself = pronouns.objectReflexive; const He = capFirstChar(he); let r = ""; - + if (arcology.FSDegradationist > 20) { r += ` ${He} carries on, knowing that in your degradationist arcology, this is accepted behavior.`; } else if (arcology.FSPaternalist > 20) { @@ -40,6 +40,6 @@ window.minorInjuryResponse = /** @param {App.Entity.SlaveState} slave */ functio cashX(10, "slaveUpkeep", slave); } } - + return r; -} +}; diff --git a/src/facilities/nursery/longChildDescription.tw b/src/facilities/nursery/longChildDescription.tw index 1c7eb0f0ffcf6ad0495fe5a38670d83e3311b48a..702d7bb835287badf55726145f44c9011d2b67b2 100644 --- a/src/facilities/nursery/longChildDescription.tw +++ b/src/facilities/nursery/longChildDescription.tw @@ -122,103 +122,7 @@ is <</if>> <</if>> -<<if $activeChild.health < -90>> - $He is nearly unresponsive. $He's obviously @@.red;dangerously sick,@@ -<<elseif $activeChild.health < -50>> - $He seems @@.red;very sick,@@ -<<elseif $activeChild.health < -20>> - $He seems @@.red;ill,@@ -<<elseif $activeChild.health <= 20>> - $He seems reasonably @@.yellow;healthy,@@ -<<elseif $activeChild.health <= 50>> - $He shines with @@.green;good health,@@ -<<else>> - $He almost gleams; $he's in the absolute @@.green;best of health,@@ -<</if>> -and -<<set _age = $activeChild.actualAge + 1>> -$he's -<<if $activeChild.birthWeek >= 52 && $seeAge == 1>> - going to turn _age this week, -<<elseif $activeChild.actualAge < 3>> - an infant, - <<if $showAgeDetail == 1>> - <<if $activeChild.actualAge == 0>> - <<print 0+$week-$activeChild.weekAcquired>> weeks - <<elseif $activeChild.actualAge == 1>> - $activeChild.actualAge year - <<else>> - $activeChild.actualAge years - <</if>> - old<<if ($seeAge != 0)>>; <<if $activeChild.birthWeek == 51>>$his birthday is next week<<else>>$his birthday is in <<print 52-$activeChild.birthWeek>> weeks<</if>><</if>>. - <<else>> - only - <<if $activeChild.actualAge == 0>> - <<print 0+$week-$activeChild.weekAcquired>> weeks - <<elseif $activeChild.actualAge == 1>> - $activeChild.actualAge year - <<else>> - $activeChild.actualAge years - <</if>> - old. - <</if>> -<<elseif $activeChild.actualAge < 5>> - a toddler, - <<if $showAgeDetail == 1>> - $activeChild.actualAge years old<<if ($seeAge != 0)>>; <<if $activeChild.birthWeek == 51>>$his birthday is next week<<else>>$his birthday is in <<print 52-$activeChild.birthWeek>> weeks<</if>><</if>>. - <<else>> - only $activeChild.actualAge years old. - <</if>> -<<elseif $activeChild.actualAge < 13>> - a little $girl, - <<if $showAgeDetail == 1>> - $activeChild.actualAge years old<<if ($seeAge != 0)>>; <<if $activeChild.birthWeek == 51>>$his birthday is next week<<else>>$his birthday is in <<print 52-$activeChild.birthWeek>> weeks<</if>><</if>>. - <<else>> - only $activeChild.actualAge years old. - <</if>> -<<elseif $activeChild.actualAge < 16>> - almost a child, - <<if $showAgeDetail == 1>> - $activeChild.actualAge years old<<if ($seeAge != 0)>>; <<if $activeChild.birthWeek == 51>>$his birthday is next week<<else>>$his birthday is in <<print 52-$activeChild.birthWeek>> weeks<</if>><</if>>. - <<else>> - less than 17 years old. - <</if>> -<<elseif $activeChild.actualAge < 17>> - young and fresh at $activeChild.actualAge<<if $showAgeDetail == 1 && ($seeAge != 0)>>; <<if $activeChild.birthWeek == 51>>$his birthday is next week<<else>>$his birthday is in <<print 52-$activeChild.birthWeek>> weeks<</if>><</if>>. -<<elseif $activeChild.actualAge < 18>> - young, fresh, and nearly 18<<if $showAgeDetail == 1 && ($seeAge != 0)>>; <<if $activeChild.birthWeek == 51>>$his birthday is next week<<if $seeAge == 1>> and people are already beginning to eye $him<</if>><<else>>$his birthday is in <<print 52-$activeChild.birthWeek>> weeks<</if>><</if>>. -<<elseif $activeChild.actualAge < 19>> - <<if $activeChild.birthWeek == 0 && $seeAge == 1>> - just turned $activeChild.actualAge this week, which many citizens find especially appealing. - <<elseif $activeChild.birthWeek < 4 && $seeAge == 1>> - only turned $activeChild.actualAge this month. - <<else>> - $activeChild.actualAge years old<<if $showAgeDetail == 1 && ($seeAge != 0)>>; <<if $activeChild.birthWeek == 51>>$his birthday is next week<<else>>$his birthday is in <<print 52-$activeChild.birthWeek>> weeks<</if>><</if>>. - <</if>> -<</if>> -/* TODO: do we need this? */ -<<if $activeChild.physicalAge != $activeChild.visualAge>> - <<if $activeChild.visualAge <= $activeChild.physicalAge-20 || $activeChild.visualAge >= $activeChild.physicalAge+20>> - $He has undergone radical age therapy that makes $him look - <<elseif $activeChild.visualAge <= $activeChild.physicalAge-10 || $activeChild.visualAge >= $activeChild.physicalAge+10>> - $He has undergone drastic age therapy that makes $him look - <<elseif $activeChild.visualAge <= $activeChild.physicalAge-5 || $activeChild.visualAge >= $activeChild.physicalAge+5>> - $He has undergone noticeable age therapy that makes $him look - <<else>> - For various reasons, $he looks - <</if>> - <<if $activeChild.physicalAge > $activeChild.visualAge>> - <<if $activeChild.physicalAge < $activeChild.visualAge+5>> - a slightly younger <<print $activeChild.visualAge>>. - <<else>> - a younger <<print $activeChild.visualAge>>. - <</if>> - <<else>> - <<if $activeChild.physicalAge > $activeChild.visualAge-5>> - a slightly older <<print $activeChild.visualAge>>. - <</if>> - <</if>> -<</if>> +<<= App.Desc.AgeAndHealth($activeChild)>> <<if $saleDescription != 1>> <<if $clinic != 0 && $clinicUpgradeScanner == 1>> diff --git a/src/js/SlaveState.js b/src/js/SlaveState.js index eb71a9720937419070e9fc4c6cec88f73bddab1b..aa78876a4fd2f890b60df30c8d94d564da7beae7 100644 --- a/src/js/SlaveState.js +++ b/src/js/SlaveState.js @@ -91,7 +91,6 @@ App.Entity.SlavePornPerformanceState = class SlavePornPerformanceState { }; App.Entity.SlaveState = class SlaveState { - constructor() { /** Slave's current name */ this.slaveName = "blank"; @@ -211,7 +210,7 @@ App.Entity.SlaveState = class SlaveState { /** 2: complete protection; 1: some protection; 0: no protection */ this.indentureRestrictions = 0; /** week she was born (int between 0-51) */ - this.birthWeek = random(0, 51); + this.birthWeek = jsRandom(0, 51); /** How old she really is. */ this.actualAge = 18; /** How old her body looks. */ diff --git a/src/js/descriptionWidgets.js b/src/js/descriptionWidgets.js index 810adf3ee28b080295cb22b1790a91b1d3033614..f86ef1d11aa86d418c30b3b75fb3edf204672522 100644 --- a/src/js/descriptionWidgets.js +++ b/src/js/descriptionWidgets.js @@ -1,6 +1,6 @@ /* eslint-disable no-unused-vars */ /* eslint-disable no-undef */ -App.Desc.Eyes = /** @param {App.Entity.SlaveState} slave */ function(slave) { +App.Desc.Eyes = /** @param {App.Entity.SlaveState} slave */ function (slave) { "use strict"; const V = State.variables; let r = ``; @@ -36,7 +36,7 @@ App.Desc.Eyes = /** @param {App.Entity.SlaveState} slave */ function(slave) { } if (slave.intelligence > 95) { r += `but ${his} facial expressions reveal ${he} is incisive, quick, cunning; `; - if (slave.intelligence+slave.intelligenceImplant >= 130) { + if (slave.intelligence + slave.intelligenceImplant >= 130) { r += `with ${his} education, ${he} is so far <span class=deepskyblue>beyond brilliant</span> that ${he} is nearly peerless.`; } else if (slave.intelligenceImplant >= 15) { r += `${he} is both <span class=deepskyblue>brilliant</span> and `; @@ -53,8 +53,8 @@ App.Desc.Eyes = /** @param {App.Entity.SlaveState} slave */ function(slave) { } r += ` education is unimportant.`; } - } else if(slave.intelligence > 50) { - if (slave.intelligence+slave.intelligenceImplant > 95) { + } else if (slave.intelligence > 50) { + if (slave.intelligence + slave.intelligenceImplant > 95) { r += `but ${his} facial expressions reveal ${he} is incisive, quick, cunning; with ${his} education, ${he} can be considered <span class=deepskyblue>brilliant.</span>`; } else if (slave.intelligenceImplant >= 15) { r += `but ${his} face is alive with intelligence; ${he} is both <span class=deepskyblue>highly intelligent</span> and `; @@ -72,7 +72,7 @@ App.Desc.Eyes = /** @param {App.Entity.SlaveState} slave */ function(slave) { r += ` education is unimportant.`; } } else if (slave.intelligence > 15) { - if (slave.intelligence+slave.intelligenceImplant > 50) { + if (slave.intelligence + slave.intelligenceImplant > 50) { r += `but ${his} face is alive with intelligence; with ${his} education, ${he} can be considered <span class=deepskyblue>highly intelligent.</span>`; } else if (slave.intelligenceImplant >= 15) { r += `but ${his} facial expressions reveal ${his} cleverness; ${he} is of <span class=deepskyblue>above average intelligence</span> and `; @@ -84,7 +84,7 @@ App.Desc.Eyes = /** @param {App.Entity.SlaveState} slave */ function(slave) { r += `but ${his} facial expressions reveal ${his} cleverness; ${he} is of <span class=deepskyblue>above average intelligence</span> despite being undereducated.`; } } else if (slave.intelligence >= -15) { - if (slave.intelligence+slave.intelligenceImplant > 15) { + if (slave.intelligence + slave.intelligenceImplant > 15) { r += `but ${his} facial expressions reveal ${his} cleverness; with ${his} education, ${he} can be considered of <span class=deepskyblue>above average intelligence.</span>`; } else if (slave.intelligenceImplant >= 15) { r += `but ${his} facial expressions reveal ${his} alertness; ${he} is of average intelligence due to being `; @@ -96,7 +96,7 @@ App.Desc.Eyes = /** @param {App.Entity.SlaveState} slave */ function(slave) { r += `but ${his} facial expressions reveal ${his} alertness; ${he} is of average intelligence and is undereducated.`; } } else if (slave.intelligence >= -50) { - if (slave.intelligence+slave.intelligenceImplant >= -15) { + if (slave.intelligence + slave.intelligenceImplant >= -15) { r += `but ${his} facial expressions reveal ${his} alertness; with ${his} education, ${he} can be considered of average intelligence.`; } else if (slave.intelligenceImplant >= 15) { r += `but ${his} facial expressions reveal ${he} is rather dim; ${he} is of <span class=orangered>below average intelligence</span> despite having been `; @@ -108,7 +108,7 @@ App.Desc.Eyes = /** @param {App.Entity.SlaveState} slave */ function(slave) { r += `but ${his} facial expressions reveal ${he} is rather dim; ${he} is of <span class=orangered>below average intelligence</span> and is poorly educated.`; } } else if (slave.intelligence >= -95) { - if (slave.intelligence+slave.intelligenceImplant >= -50) { + if (slave.intelligence + slave.intelligenceImplant >= -50) { r += `but ${his} facial expressions reveal ${he} is rather dim; even with ${his} education, ${he} can only be considered of <span class=orangered>below average intelligence.</span>`; } else if (slave.intelligenceImplant >= 15) { r += `but ${his} facial expressions reveal ${he} is as dull as ${his} eyes; ${he} is <span class=orangered>quite stupid</span> despite having `; @@ -123,7 +123,7 @@ App.Desc.Eyes = /** @param {App.Entity.SlaveState} slave */ function(slave) { } } else { r += `though you doubt it would be much different if ${he} could see; `; - if (slave.intelligence+slave.intelligenceImplant >= -95) { + if (slave.intelligence + slave.intelligenceImplant >= -95) { r += `even with ${his} education, ${he} is still <span class=orangered>really stupid.</span>`; } else if (slave.intelligenceImplant > 0) { r += `${he} is <span class=orangered>a moron,</span> yet somehow still remembers the basics of an education.`; @@ -134,7 +134,7 @@ App.Desc.Eyes = /** @param {App.Entity.SlaveState} slave */ function(slave) { } else { if (slave.intelligence > 95) { r += `${His} ${App.Desc.EyeColor(slave)}-eyed gaze is incisive, quick, cunning; `; - if (slave.intelligence+slave.intelligenceImplant >= 130) { + if (slave.intelligence + slave.intelligenceImplant >= 130) { r += `with ${his} education, ${he} is so far <span class=deepskyblue>beyond brilliant</span> that ${he} is nearly peerless.`; } else if (slave.intelligenceImplant >= 15) { r += `${he} is both <span class=deepskyblue>brilliant</span> and `; @@ -153,7 +153,7 @@ App.Desc.Eyes = /** @param {App.Entity.SlaveState} slave */ function(slave) { } } else if (slave.intelligence > 50) { r += `${His} ${App.Desc.EyeColor(slave)}-eyed gaze is incisive, quick, cunning; `; - if (slave.intelligence+slave.intelligenceImplant >= 95) { + if (slave.intelligence + slave.intelligenceImplant >= 95) { r += `${His} ${App.Desc.EyeColor(slave)} eyes are alive with intelligence; ${he} is both <span class=deepskyblue>highly intelligent</span> and `; } else if (slave.intelligenceImplant >= 15) { r += `well `; @@ -171,7 +171,7 @@ App.Desc.Eyes = /** @param {App.Entity.SlaveState} slave */ function(slave) { } } else if (slave.intelligence > 15) { r += `${His} ${App.Desc.EyeColor(slave)} eyes are `; - if (slave.intelligence+slave.intelligenceImplant >= 50) { + if (slave.intelligence + slave.intelligenceImplant >= 50) { r += `alive with intelligence; with ${his} education, ${he} can be considered <span class=deepskyblue>highly intelligent.</span>`; } else if (slave.intelligenceImplant >= 15) { r += `clever; ${he} is of <span class=deepskyblue>above average intelligence</span> and `; @@ -184,9 +184,9 @@ App.Desc.Eyes = /** @param {App.Entity.SlaveState} slave */ function(slave) { } } else if (slave.intelligence >= -15) { r += `${His} ${App.Desc.EyeColor(slave)} eyes are `; - if (slave.intelligence+slave.intelligenceImplant >= 15) { + if (slave.intelligence + slave.intelligenceImplant >= 15) { r += `clever; with ${his} education, ${he} can be considered of <span class=deepskyblue>above average intelligence.</span>`; - }else if (slave.intelligenceImplant >= 15) { + } else if (slave.intelligenceImplant >= 15) { r += `alert; ${he} is of average intelligence due to being `; if (slave.intelligenceImplant >= 30) { r += `well `; @@ -197,7 +197,7 @@ App.Desc.Eyes = /** @param {App.Entity.SlaveState} slave */ function(slave) { } } else if (slave.intelligence >= -50) { r += `${His} ${App.Desc.EyeColor(slave)} eyes are `; - if (slave.intelligence+slave.intelligenceImplant >= -15) { + if (slave.intelligence + slave.intelligenceImplant >= -15) { r += `alert; with ${his} education, ${he} can be considered of average intelligence.`; } else if (slave.intelligenceImplant >= 15) { r += `dim; ${he} is of <span class=orangered>below average intelligence</span> despite having been `; @@ -212,7 +212,7 @@ App.Desc.Eyes = /** @param {App.Entity.SlaveState} slave */ function(slave) { } } else if (slave.intelligence >= -95) { r += `${His} ${App.Desc.EyeColor(slave)} eyes are `; - if (slave.intelligence+slave.intelligenceImplant >= -50) { + if (slave.intelligence + slave.intelligenceImplant >= -50) { r += `dull; ${he} is <span class=orangered>quite stupid</span> despite having `; } else if (slave.intelligenceImplant >= 15) { r += `an advanced `; @@ -225,7 +225,7 @@ App.Desc.Eyes = /** @param {App.Entity.SlaveState} slave */ function(slave) { } } else { r += `${His} ${App.Desc.EyeColor(slave)}-eyed gaze betrays near-total insensibility; `; - if (slave.intelligence+slave.intelligenceImplant >= -95) { + if (slave.intelligence + slave.intelligenceImplant >= -95) { r += `even with ${his} education, ${he} is still <span class=orangered>really stupid.</span>`; } else if (slave.intelligenceImplant > 0) { r += `${he} is <span class=orangered>a moron,</span> yet somehow still remembers the basics of an education.`; @@ -237,7 +237,7 @@ App.Desc.Eyes = /** @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"; let r; @@ -247,4 +247,383 @@ App.Desc.EyeColor = /** @param {App.Entity.SlaveState} slave */ function(slave) r = `${slave.eyeColor}`; } return r; +} + +App.Desc.AgeAndHealth = /** @param {App.Entity.SlaveState} slave */ function (slave) { + /* TODO: should age and health be split into two widgets? */ + "use strict"; + const V = State.variables; + let r = ``; + var pronouns = getPronouns(slave); + var he = pronouns.pronoun; + var him = pronouns.object; + var his = pronouns.possessive; + var hers = pronouns.possessivePronoun; + var himself = pronouns.objectReflexive; + var boy = pronouns.noun; + var He = capFirstChar(he); + var His = capFirstChar(his); + + if (!slave.fuckdoll) { + if (slave.health < -90) { + r += `${He} is nearly unresponsive. ${He}'s obviously <span class=red>dangerously sick,</span>`; + } else if (slave.health < -50) { + r += `${He} seems <span class=red>very sick,</span>`; + } else if (slave.health < -20) { + r += `${He} seems <span class=red>ill,</span>`; + } else if (slave.health <= 20) { + r += `${He} seems reasonably <span class=yellow>healthy,</span>`; + } else if (slave.health <= 50) { + r += `${He} shines with <span class=green>good health,</span>`; + } else { + r += `${He} almost gleams; ${he}'s in the absolute <span class=green>best of health,</span>`; + } + r += ` and `; + let age = slave.actualAge + 1; + r += `${he}'s `; + if (slave.birthWeek >= 52 && V.seeAge) { + r += `going to turn ${age} this week. ${He}'s `; + } else if (slave.actualAge < 3) { + r += `an infant, `; + if (V.showAgeDetail) { + if (slave.actualAge === 0) { + r += `${0+V.week-slave.weekAcquired} weeks`; + } else if (slave.actualAge === 1) { + r += `${num(slave.actualAge)} year`; + } else { + r += `${num(slave.actualAge)} years`; + } + r += `old. `; + } + if (V.seeAge) { + if (slave.birthWeek === 51) { + r += `${his} birthday is next week.`; + } else { + r += `${his} birthday is in ${num(52-slave.birthWeek)} weeks.`; + } + } else { + r += `only `; + if (slave.actualAge === 0) { + r += `${0+V.week-slave.weekAcquired} weeks`; + } else if (slave.actualAge === 1) { + r += `${num(slave.actualAge)} year`; + } else { + r += `${num(slave.actualAge)} years`; + } + r += ` old.`; + } + } else if (slave.actualAge < 5) { + r += `a toddler, `; + if (V.showAgeDetail) { + r += `${num(slave.actualAge)} years old; `; + if (V.seeAge) { + if (slave.birthWeek === 51) { + r += `${his} birthday is next week.`; + } else { + r += `${his} birthday is in ${num(52-slave.birthWeek)} weeks.`; + } + } else { + r += ` only ${num(slave.actualAge)} years old.`; + } + } + } else if (slave.actualAge < 13) { + r += `a little ${boy}, `; + if (V.showAgeDetail) { + if (V.seeAge) { + r += `${num(slave.actualAge)} years old; `; + if (slave.birthWeek === 51) { + r += `${his} birthday is next week.`; + } else { + r += `${his} birthday is in ${num(52-slave.birthWeek)} weeks.`; + } + } else { + r += ` only ${num(slave.actualAge)} years old.`; + } + } + } else if (slave.actualAge < 16) { + r += `almost a child, `; + if (V.showAgeDetail) { + r += `${num(slave.actualAge)} years old; `; + if (V.seeAge) { + if (slave.birthWeek === 51) { + r += `${his} birthday is next week.`; + } else { + r += `${his} birthday is in ${num(52-slave.birthWeek)} weeks.`; + } + } else { + r += `less than 17 years old.`; + } + } + } else if (slave.actualAge < 17) { + r += `young and fresh at ${num(slave.actualAge)}; `; + if (V.showAgeDetail && (V.seeAge)) { + if (slave.birthWeek === 51) { + r += `${his} birthday is next week.`; + } else { + r += `${his} birthday is in ${num(52-slave.birthWeek)} weeks`; + } + } + } else if (slave.actualAge < 18) { + r += `young, fresh, and nearly 18; `; + if (V.showAgeDetail && (V.seeAge)) { + if (slave.birthWeek === 51) { + r += `${his} birthday is next week.`; + if (V.seeAge) { + r += `people are already beginning to eye ${him}`; + } + } else { + r += `${his} birthday is in ${num(52-slave.birthWeek)} weeks.`; + } + } + } else if (slave.actualAge < 19) { + if (slave.birthWeek === 0 && V.seeAge) { + r += `just turned ${num(slave.actualAge)} this week, which many citizens find especially appealing.`; + } else if (slave.birthWeek < 4 && V.seeAge) { + r += `only turned ${num(slave.actualAge)} this month.`; + } else { + r += `${num(slave.actualAge)} years old; `; + if (V.showAgeDetail && (V.seeAge)) { + if (slave.birthWeek === 51) { + r += `${his} birthday is next week.`; + } + } else { + r += `${his} birthday is in ${num(52-slave.birthWeek)} weeks.`; + } + } + } else if (slave.actualAge < 20) { + r += `in ${his} final year as a teenager at age 19`; + if (V.showAgeDetail && (V.seeAge)) { + if (slave.birthWeek === 51) { + r += `${his} birthday is next week.`; + } else { + r += `${his} birthday is in ${num(52-slave.birthWeek)} weeks.`; + } + } + } else if (slave.actualAge < 26) { + r += `a young V.woman, `; + if (V.showAgeDetail) { + r += `${num(slave.actualAge)} years old; `; + if (V.seeAge); + if (slave.birthWeek === 51) { + r += `${his} birthday is next week.`; + } else { + r += `${his} birthday is in ${num(52-slave.birthWeek)} weeks.`; + } + } else { + r += `in ${his} early twenties.`; + } + } else if (slave.actualAge < 30) { + r += `a younger V.woman, `; + if (V.showAgeDetail) { + r += `${num(slave.actualAge)} years old; `; + if (V.seeAge); + if (slave.birthWeek === 51) { + r += `${his} birthday is next week.`; + } else { + r += `${his} birthday is in ${num(52-slave.birthWeek)} weeks.`; + } + } else { + r += `in ${his} late twenties.`; + } + } else if (slave.actualAge < 36) { + if (V.showAgeDetail) { + r += `${num(slave.actualAge)} years old; `; + if (V.seeAge); + if (slave.birthWeek === 51) { + r += `${his} birthday is next week.`; + } else { + r += `${his} birthday is in ${num(52-slave.birthWeek)} weeks.`; + } + } else { + r += `in ${his} early thirties.`; + } + } else if (slave.actualAge < 40) { + r += `middle-aged for a slave`; + if (V.showAgeDetail) { + r += ` at ${num(slave.actualAge)} years old; `; + if (V.seeAge); + if (slave.birthWeek === 51) { + r += `${his} birthday is next week.`; + } else { + r += `${his} birthday is in ${num(52-slave.birthWeek)} weeks.`; + } + } else { + r += `, in ${his} late thirties.`; + } + } else { + if (V.showAgeDetail) { + r += `old for a slave, at ${num(slave.actualAge)} years old; `; + if (V.seeAge) { + r += `; `; + if (slave.birthWeek === 51) { + r += `${his} birthday is next week.`; + } else { + r += `${his} birthday is in ${num(52-slave.birthWeek)} weeks.`; + } + } + } else { + if (slave.actualAge < 70) { + r += `old for a slave, `; + if (slave.actualAge < 50) { + r += `in ${his} forties.`; + } else if (slave.actualAge < 60) { + r += `in ${his} fifties`; + } + } else if (slave.actualAge < 70) { + r += `extremely old for a slave, in ${his} 60s.`; + } else if (slave.actualAge < 80) { + r += `extremely old for a slave, in ${his} 70s.`; + } else if (slave.actualAge < 90) { + r += `extremely old for a slave, in ${his} 80s.`; + } else if (slave.actualAge < 100) { + r += `extremely old for a slave, in ${his} 90s.`; + } else if (slave.actualAge >= 100) { + r += `ancient by any measure, over a century old.`; + } + } + } + if (slave.actualAge !== slave.physicalAge) { + r += ` However, ${he} has the body of a ${num(slave.physicalAge)}-year old; `; + if (slave.physicalAge < 18 && slave.actualAge >= 18) { + r += `a stark contrast given ${his} maturity.`; + } else if (slave.physicalAge < 18 && slave.actualAge < 18) { + r += `a noticeable difference thanks to ${his} immaturity.`; + } else if (slave.physicalAge <= slave.actualAge - 20 || slave.physicalAge > slave.actualAge + 20) { + r += `a shocking difference from ${his} actual age.`; + } else if (slave.physicalAge <= slave.actualAge - 10 || slave.physicalAge > slave.actualAge + 10) { + r += `a noticeable difference from ${his} actual age.`; + } else if (slave.physicalAge <= slave.actualAge - 5 || slave.physicalAge > slave.actualAge + 5) { + r += `a barely noticeable difference from ${his} actual age.`; + } else { + r += `though it is hard to tell the difference from ${his} actual age. `; + } + } + /* + ** This section replaces the age/therapy texts, giving more details for the NCS condition. + */ + if (slave.geneMods.NCS) { + if ((slave.vagina < 0) && (slave.dick <= 0)) { + bodyNCS = 'childlike' + } else if ((slave.vagina < 0) && (slave.dick > 0)) { + bodyNCS = 'shota' + } else if ((slave.vagina > 0) && (slave.dick <= 0)) { + bodyNCS = 'loli' + } else { + bodyNCS = 'loli/shota' + } + + r += `${He} appears to be ${slave.visualAge} years old `; + if (slave.visualAge <= 8) { + r += `and ${he} has induced <span class=orange>NCS</span> and will always have a ${bodyNCS} body, no matter how long ${he} lives.`; + } else if ((slave.visualAge < 13)) { + r += `and ${he} has induced <span class=orange>NCS</span> and will have a ${bodyNCS} body for the rest of ${his} life.`; + } else if ((slave.visualAge < 20)) { + r += `and ${he} still has a teen body for now, but with ${his} <span class=orange>NCS,</span> ${he} will eventually regress in age to look like a little ${boy} again.`; + } else { + r += `and ${he} still has the body of an adult, but ${his} <span class=orange>NCS</span> has `; + if ((slave.physicalAge - slave.visualAge <= 5)) { + r += `not really begun to youthen ${his} appearance yet.`; + } else if ((slave.physicalAge - slave.visualAge <= 10)) { + r += `clearly been at work on ${him}, making ${him} appear younger.`; + } else if ((slave.physicalAge - slave.visualAge <= 20)) { + r += `obviously helped take more than a decade off of ${his} age.`; + } else { + r += `intensely youthened ${him}.`; + } + } + } else if (slave.physicalAge !== slave.visualAge) { + if (slave.visualAge <= slave.physicalAge - 20 || slave.visualAge >= slave.physicalAge + 20) { + r += `${He} has undergone radical age therapy that makes ${him} look `; + } else if (slave.visualAge <= slave.physicalAge - 10 || slave.visualAge > slave.physicalAge + 10) { + r += `${He} has undergone drastic age therapy that makes ${him} look `; + } else if (slave.visualAge <= slave.physicalAge - 5 || slave.visualAge > slave.physicalAge + 5) { + r += `${He} has undergone noticeable age therapy that makes ${him} look `; + } else { + r += `For various reasons, ${he} looks `; + } + if (slave.physicalAge > slave.visualAge) { + if (slave.physicalAge < slave.visualAge + 5) { + r += `a slightly younger ${slave.visualAge}.`; + } else if (slave.visualAge < 20) { + r += `like ${he}'s barely an adult.`; + } else if (slave.visualAge < 25) { + r += `barely into ${his} early twenties.`; + } else if (slave.visualAge < 30) { + r += `like ${he}'s still in ${his} twenties.`; + } else if (slave.visualAge < 35) { + r += `barely thirty.`; + } else if (slave.visualAge < 40) { + r += `still in ${his} thirties.`; + } else if (slave.visualAge < 45) { + r += `barely forty.`; + } else if (slave.visualAge < 50) { + r += `still in ${his} forties.`; + } else if (slave.visualAge < 55) { + r += `barely fifty.`; + } else if (slave.visualAge < 60) { + r += `still in ${his} fifties.`; + } else if (slave.visualAge < 65) { + r += `barely sixty.`; + } else if (slave.visualAge < 70) { + r += `still in ${his} sixties.`; + } else if (slave.visualAge < 75) { + r += `barely seventy.`; + } else if (slave.visualAge < 80) { + r += `still in ${his} seventies.`; + } else { + r += `a younger ${slave.visualAge}.`; + } + } else { + if (slave.physicalAge > slave.visualAge - 5) { + r += `a slightly older ${slave.visualAge}.`; + } else if (slave.visualAge < 20) { + r += `like a fresh adult.`; + } else if (slave.visualAge < 25) { + r += `just over twenty.`; + } else if (slave.visualAge < 30) { + r += `nearly thirty.`; + } else if (slave.visualAge < 35) { + r += `just over thirty.`; + } else if (slave.visualAge < 40) { + r += `nearly forty.`; + } else if (slave.visualAge < 45) { + r += `just over forty.`; + } else if (slave.visualAge < 50) { + r += `nearly fifty.`; + } else if (slave.visualAge < 55) { + r += `just over fifty.`; + } else if (slave.visualAge < 60) { + r += `nearly sixty.`; + } else if (slave.visualAge < 65) { + r += `just over sixty.`; + } else if (slave.visualAge < 70) { + r += `nearly seventy.`; + } else if (slave.visualAge < 75) { + r += `just over seventy.`; + } else if (slave.visualAge < 80) { + r += `nearly eighty.`; + } else { + r += `an ancient ${slave.visualAge}.`; + } + } + } + } else { + r += `The Fuckdoll gives no external indication of ${his} health or age, but upon query ${his} systems reports that ${he} is `; + if (slave.health < -90) { + r += `<span class=red>dangerously sick</span>`; + } else if (slave.health < -50) { + r += `<span class=red>very sick</span>`; + } else if (slave.health < -20) { + r += `<span class=red>ill</span>`; + } else if (slave.health <= 20) { + r += `<span class=yellow>healthy</span>`; + } else if (slave.health <= 50) { + r += `<span class=green>ve + ry health</span>`; + } else { + r += `<span class=green>extremely healthy</span>`; + } + r += ` and ${slave.physicalAge} years old.`; + } + return r; } \ No newline at end of file diff --git a/src/js/itemAvailability.js b/src/js/itemAvailability.js index 4eb32c78ce097da43c71f05aa9967d94855b1ff7..2bbfa0e66945ce80ac3b0987975c0af345cc3505 100644 --- a/src/js/itemAvailability.js +++ b/src/js/itemAvailability.js @@ -3,157 +3,157 @@ window.isItemAccessible = function(string) { const V = State.variables; - if (V.cheatMode === 1){ + if (V.cheatMode === 1) { return true; } else { switch (string) { /* no breaks needed because we always return */ - case 'attractive lingerie for a pregnant woman': - return (V.arcologies[0].FSRepopulationFocus > 0 || V.clothesBoughtMaternityLingerie === 1); - case 'a bunny outfit': - return (V.arcologies[0].FSGenderFundamentalist > 0 || V.clothesBoughtBunny === 1); - case 'body oil': - return (V.arcologies[0].FSPhysicalIdealist > 0 || V.clothesBoughtOil === 1); - case 'chains': - return (V.arcologies[0].FSDegradationist > 0 || V.clothesBoughtChains === 1); - case 'a chattel habit': - return (V.arcologies[0].FSChattelReligionist > 0 || V.clothesBoughtHabit === 1); - case 'conservative clothing': - return (V.arcologies[0].FSPaternalist > 0 || V.clothesBoughtConservative === 1); - case 'harem gauze': - return (V.arcologies[0].FSArabianRevivalist > 0 || V.clothesBoughtHarem === 1); - case 'a huipil': - return (V.arcologies[0].FSAztecRevivalist > 0 || V.clothesBoughtHuipil === 1); - case 'a kimono': - return (V.arcologies[0].FSEdoRevivalist > 0 || V.clothesBoughtKimono === 1 || V.continent === 'Japan'); - case 'a maternity dress': - return (V.arcologies[0].FSRepopulationFocus > 0 || V.clothesBoughtMaternityDress === 1); - case 'a slutty qipao': - return (V.arcologies[0].FSChineseRevivalist > 0 || V.clothesBoughtQipao === 1); - case 'a long qipao': - return (V.arcologies[0].FSChineseRevivalist > 0 || V.clothesBoughtCultural === 1); - case 'stretch pants and a crop-top': - return (V.arcologies[0].FSHedonisticDecadence > 0 || V.clothesBoughtLazyClothes === 1); - case 'a toga': - return (V.arcologies[0].FSRomanRevivalist > 0 || V.clothesBoughtToga === 1); - case 'Western clothing': - return (V.arcologies[0].FSPastoralist > 0 || V.clothesBoughtWestern === 1); - case 'battlearmor': - case 'a military uniform': - case 'a red army uniform': - case 'battledress': - return (V.clothesBoughtMilitary === 1); - case 'a biyelgee costume': - case 'a dirndl': - case 'lederhosen': - case 'a mounty outfit': - case 'a hanbok': - return (V.clothesBoughtCultural === 1); - case 'a burqa': - case 'a niqab and abaya': - return (V.clothesBoughtMiddleEastern === 1 || V.continent === 'the Middle East'); - case 'a hijab and blouse': - return (V.clothesBoughtMiddleEastern === 1 || V.clothesBoughtConservative === 1 || V.continent === 'the Middle East'); - case 'a burkini': - return (V.clothesBoughtMiddleEastern === 1 && V.clothesBoughtSwimwear === 1 || V.continent === 'the Middle East'); - case 'a Santa dress': - return (V.clothesBoughtCostume === 1); - case 'a klan robe': - case 'a slutty klan robe': - case 'a schutzstaffel uniform': - case 'a slutty schutzstaffel uniform': - return (V.clothesBoughtPol === 1); - case 'nice business attire': - case 'a nice nurse outfit': - case 'a police uniform': - return (V.clothesBoughtCareer === 1); - case 'a nice maid outfit': - return (V.clothesBoughtCareer === 1 || V.PC.career === 'servant'); - case 'a ball gown': - case 'a gothic lolita dress': - //case 'a halter top dress': - //case 'a mini dress': - //case 'a slave gown': - return (V.clothesBoughtDresses === 1); - case 'a cybersuit': - case 'a latex catsuit': - return (V.clothesBoughtBodysuits === 1); - case 'a button-up shirt and panties': - case 'a button-up shirt': - case 'cutoffs': - case 'jeans': - case 'leather pants and a tube top': - case 'leather pants': - case 'an oversized t-shirt': - case 'a sweater and cutoffs': - case 'a sweater and panties': - case 'a sweater': - case 'a t-shirt and jeans': - case 'a t-shirt and panties': - case 'a t-shirt': - case 'a tank-top and panties': - case 'a tank-top': - case 'a tube top': - return (V.clothesBoughtCasual === 1); - case 'boyshorts': - case 'a bra': - case 'kitty lingerie': - case 'panties and pasties': - case 'a skimpy loincloth': - case 'a thong': - return (V.clothesBoughtUnderwear === 1); - case 'leather pants and pasties': - case 'a t-shirt and thong': - case 'a tube top and thong': - case 'an oversized t-shirt and boyshorts': - return (V.clothesBoughtUnderwear === 1 && V.clothesBoughtCasual === 1); - case 'sport shorts and a sports bra': - case 'sport shorts': - case 'a sports bra': - return (V.clothesBoughtSports === 1); - case 'sport shorts and a t-shirt': - return (V.clothesBoughtSports === 1 && V.clothesBoughtCasual === 1); - case 'a nice pony outfit': - case 'a slutty pony outfit': - return (V.clothesBoughtPony === 1); - case 'a monokini': - case 'a one-piece swimsuit': - return (V.clothesBoughtSwimwear === 1); - case 'shimapan panties': - case 'a striped bra': - case 'striped panties': - case 'striped underwear': - return (V.clothesBoughtPantsu === 1 || V.continent === 'Japan'); - case 'bowtie': - return (V.arcologies[0].FSGenderFundamentalist > 0 || V.clothesBoughtBunny === 1); - case 'ancient Egyptian': - return (V.arcologies[0].FSEgyptianRevivalist > 0 || V.clothesBoughtEgypt === 1); - case 'pasties': /* an option in saChoosesOwnClothes.tw, but everything else (e.g. descriptions, artwork, option in wardrobeUse.tw) is missing or not hooked up correctly */ - return false; - case 'massive dildo gag': - return (V.toysBoughtGags === 1); - case 'a small empathy belly': - case 'a medium empathy belly': - case 'a large empathy belly': - case 'a huge empathy belly': - return (V.arcologies[0].FSRepopulationFocus > 0 || V.clothesBoughtBelly === 1); - case 'bullet vibrator': - case 'smart bullet vibrator': - case 'long dildo': - case 'long, large dildo': - case 'long, huge dildo': - return (V.toysBoughtDildos === 1); - case 'vibrator': - return (V.toysBoughtVaginalAttachments === 1); - case 'long plug': - case 'long, large plug': - case 'long, huge plug': - return (V.toysBoughtButtPlugs === 1); - case 'tail': - case 'cat tail': - case 'fox tail': - return (V.toysBoughtButtPlugTails === 1); - default: - return true; + case "attractive lingerie for a pregnant woman": + return (V.arcologies[0].FSRepopulationFocus > 0 || V.clothesBoughtMaternityLingerie === 1); + case "a bunny outfit": + return (V.arcologies[0].FSGenderFundamentalist > 0 || V.clothesBoughtBunny === 1); + case "body oil": + return (V.arcologies[0].FSPhysicalIdealist > 0 || V.clothesBoughtOil === 1); + case "chains": + return (V.arcologies[0].FSDegradationist > 0 || V.clothesBoughtChains === 1); + case "a chattel habit": + return (V.arcologies[0].FSChattelReligionist > 0 || V.clothesBoughtHabit === 1); + case "conservative clothing": + return (V.arcologies[0].FSPaternalist > 0 || V.clothesBoughtConservative === 1); + case "harem gauze": + return (V.arcologies[0].FSArabianRevivalist > 0 || V.clothesBoughtHarem === 1); + case "a huipil": + return (V.arcologies[0].FSAztecRevivalist > 0 || V.clothesBoughtHuipil === 1); + case "a kimono": + return (V.arcologies[0].FSEdoRevivalist > 0 || V.clothesBoughtKimono === 1 || V.continent === "Japan"); + case "a maternity dress": + return (V.arcologies[0].FSRepopulationFocus > 0 || V.clothesBoughtMaternityDress === 1); + case "a slutty qipao": + return (V.arcologies[0].FSChineseRevivalist > 0 || V.clothesBoughtQipao === 1); + case "a long qipao": + return (V.arcologies[0].FSChineseRevivalist > 0 || V.clothesBoughtCultural === 1); + case "stretch pants and a crop-top": + return (V.arcologies[0].FSHedonisticDecadence > 0 || V.clothesBoughtLazyClothes === 1); + case "a toga": + return (V.arcologies[0].FSRomanRevivalist > 0 || V.clothesBoughtToga === 1); + case "Western clothing": + return (V.arcologies[0].FSPastoralist > 0 || V.clothesBoughtWestern === 1); + case "battlearmor": + case "a military uniform": + case "a red army uniform": + case "battledress": + return (V.clothesBoughtMilitary === 1); + case "a biyelgee costume": + case "a dirndl": + case "lederhosen": + case "a mounty outfit": + case "a hanbok": + return (V.clothesBoughtCultural === 1); + case "a burqa": + case "a niqab and abaya": + return (V.clothesBoughtMiddleEastern === 1 || V.continent === "the Middle East"); + case "a hijab and blouse": + return (V.clothesBoughtMiddleEastern === 1 || V.clothesBoughtConservative === 1 || V.continent === "the Middle East"); + case "a burkini": + return (V.clothesBoughtMiddleEastern === 1 && V.clothesBoughtSwimwear === 1 || V.continent === "the Middle East"); + case "a Santa dress": + return (V.clothesBoughtCostume === 1); + case "a klan robe": + case "a slutty klan robe": + case "a schutzstaffel uniform": + case "a slutty schutzstaffel uniform": + return (V.clothesBoughtPol === 1); + case "nice business attire": + case "a nice nurse outfit": + case "a police uniform": + return (V.clothesBoughtCareer === 1); + case "a nice maid outfit": + return (V.clothesBoughtCareer === 1 || V.PC.career === "servant"); + case "a ball gown": + case "a gothic lolita dress": + //case 'a halter top dress': + //case 'a mini dress': + //case 'a slave gown': + return (V.clothesBoughtDresses === 1); + case "a cybersuit": + case "a latex catsuit": + return (V.clothesBoughtBodysuits === 1); + case "a button-up shirt and panties": + case "a button-up shirt": + case "cutoffs": + case "jeans": + case "leather pants and a tube top": + case "leather pants": + case "an oversized t-shirt": + case "a sweater and cutoffs": + case "a sweater and panties": + case "a sweater": + case "a t-shirt and jeans": + case "a t-shirt and panties": + case "a t-shirt": + case "a tank-top and panties": + case "a tank-top": + case "a tube top": + return (V.clothesBoughtCasual === 1); + case "boyshorts": + case "a bra": + case "kitty lingerie": + case "panties and pasties": + case "a skimpy loincloth": + case "a thong": + return (V.clothesBoughtUnderwear === 1); + case "leather pants and pasties": + case "a t-shirt and thong": + case "a tube top and thong": + case "an oversized t-shirt and boyshorts": + return (V.clothesBoughtUnderwear === 1 && V.clothesBoughtCasual === 1); + case "sport shorts and a sports bra": + case "sport shorts": + case "a sports bra": + return (V.clothesBoughtSports === 1); + case "sport shorts and a t-shirt": + return (V.clothesBoughtSports === 1 && V.clothesBoughtCasual === 1); + case "a nice pony outfit": + case "a slutty pony outfit": + return (V.clothesBoughtPony === 1); + case "a monokini": + case "a one-piece swimsuit": + return (V.clothesBoughtSwimwear === 1); + case "shimapan panties": + case "a striped bra": + case "striped panties": + case "striped underwear": + return (V.clothesBoughtPantsu === 1 || V.continent === "Japan"); + case "bowtie": + return (V.arcologies[0].FSGenderFundamentalist > 0 || V.clothesBoughtBunny === 1); + case "ancient Egyptian": + return (V.arcologies[0].FSEgyptianRevivalist > 0 || V.clothesBoughtEgypt === 1); + case "pasties": /* an option in saChoosesOwnClothes.tw, but everything else (e.g. descriptions, artwork, option in wardrobeUse.tw) is missing or not hooked up correctly */ + return false; + case "massive dildo gag": + return (V.toysBoughtGags === 1); + case "a small empathy belly": + case "a medium empathy belly": + case "a large empathy belly": + case "a huge empathy belly": + return (V.arcologies[0].FSRepopulationFocus > 0 || V.clothesBoughtBelly === 1); + case "bullet vibrator": + case "smart bullet vibrator": + case "long dildo": + case "long, large dildo": + case "long, huge dildo": + return (V.toysBoughtDildos === 1); + case "vibrator": + return (V.toysBoughtVaginalAttachments === 1); + case "long plug": + case "long, large plug": + case "long, huge plug": + return (V.toysBoughtButtPlugs === 1); + case "tail": + case "cat tail": + case "fox tail": + return (V.toysBoughtButtPlugTails === 1); + default: + return true; } } }; diff --git a/src/js/slaveSummaryWidgets.js b/src/js/slaveSummaryWidgets.js index 79a169e9e896ee10cec839450a2e570d141b8ab0..6a238b32eca009c670d7e4b31e23cd31fe1408a0 100644 --- a/src/js/slaveSummaryWidgets.js +++ b/src/js/slaveSummaryWidgets.js @@ -1,27 +1,29 @@ /* eslint-disable no-unused-vars */ /* eslint-disable no-undef */ window.clearSummaryCache = /** @param {App.Entity.SlaveState | number} slave */ function clearSummaryCache(slave) { - if (!slave) + if (!slave) { setup.summaryCache = {}; - else if (slave instanceof Object && slave.ID !== Infinity && slave.ID !== -Infinity) + } else if (slave instanceof Object && slave.ID !== Infinity && slave.ID !== -Infinity) { setup.summaryCache[slave.ID] = undefined; - else + } else { setup.summaryCache[slave] = undefined; + } }; window.SlaveSummary = /** @param {App.Entity.SlaveState} slave */ function SlaveSummary(slave) { const V = State.variables; - if(V.useSummaryCache) { - if (setup.summaryCache[slave.ID] === undefined) + if (V.useSummaryCache) { + if (setup.summaryCache[slave.ID] === undefined) { setup.summaryCache[slave.ID] = SlaveSummaryUncached(slave); + } //this.output.appendChild(setup.summaryCache[State.temporary.Slave.ID].cloneNode(true)) return setup.summaryCache[slave.ID]; } else return SlaveSummaryUncached(slave); }; -window.SlaveSummaryUncached = (function(){ +window.SlaveSummaryUncached = (function() { "use strict"; - let V, r; + let V; let r; /* let pronouns; let he; @@ -51,70 +53,83 @@ window.SlaveSummaryUncached = (function(){ His = capFirstChar(his); */ - if (V.abbreviateDevotion === 1) + if (V.abbreviateDevotion === 1) { short_devotion(slave); - else if (V.abbreviateDevotion === 2) + } else if (V.abbreviateDevotion === 2) { long_devotion(slave); + } if (slave.fuckdoll === 0) { - if (V.abbreviateRules === 1) + if (V.abbreviateRules === 1) { short_rules(slave); - else if (V.abbreviateRules === 2) + } else if (V.abbreviateRules === 2) { long_rules(slave); + } } - if (slave.tired !== 0) + if (slave.tired !== 0) { r += `Tired.`; - if (V.abbreviateDiet === 1) + } + if (V.abbreviateDiet === 1) { short_weight(slave); - else if (V.abbreviateDiet === 2) + } else if (V.abbreviateDiet === 2) { long_weight(slave); - if (V.abbreviateDiet === 1) + } + if (V.abbreviateDiet === 1) { short_diet(slave); - else if (V.abbreviateDiet === 2) + } else if (V.abbreviateDiet === 2) { long_diet(slave); - if (V.abbreviateHealth === 1) + } + if (V.abbreviateHealth === 1) { short_health(slave); - else if (V.abbreviateHealth === 2) + } else if (V.abbreviateHealth === 2) { long_health(slave); - if (V.abbreviateDrugs === 1) + } + if (V.abbreviateDrugs === 1) { short_drugs(slave); - else if (V.abbreviateDrugs === 2) + } else if (V.abbreviateDrugs === 2) { long_drugs(slave); + } if (V.abbreviateNationality + V.abbreviateGenitalia + V.abbreviatePhysicals + V.abbreviateSkills + V.abbreviateMental !== 0) { r += `<br>`; - if (V.seeImages !== 1 || V.seeSummaryImages !== 1 || V.imageChoice === 1) - r += ` `; + if (V.seeImages !== 1 || V.seeSummaryImages !== 1 || V.imageChoice === 1) { + r += " "; + } } V.desc = SlaveTitle(slave); - let first_letter = V.desc.substring(0, 1).toUpperCase(); + const first_letter = V.desc.substring(0, 1).toUpperCase(); V.desc = first_letter + V.desc.substring(1); r += `<strong><span class="coral">${V.desc}${V.abbreviatePhysicals === 2? '.' : ''}</span></strong> `; if (V.seeRace === 1) { r += `<span class="tan">`; - if (V.abbreviateRace === 1) + if (V.abbreviateRace === 1) { short_race(slave); - else if (V.abbreviateRace === 2) + } else if (V.abbreviateRace === 2) { long_race(slave); + } r += `</span> `; } - if (V.abbreviateNationality === 1) + if (V.abbreviateNationality === 1) { short_nationality(slave); - else if (V.abbreviateNationality === 2) + } else if (V.abbreviateNationality === 2) { long_nationality(slave); - if (V.abbreviatePhysicals === 1) + } + if (V.abbreviatePhysicals === 1) { short_skin(slave); - else + } else { r += `<span class="pink">${slave.skin.charAt(0).toUpperCase() + slave.skin.slice(1)} skin.</span> `; - if (V.abbreviateGenitalia === 1) + } + if (V.abbreviateGenitalia === 1) { short_genitals(slave); - else if (V.abbreviateGenitalia === 2) + } else if (V.abbreviateGenitalia === 2) { long_genitals(slave); + } if (V.abbreviatePhysicals === 1) { short_age(slave); short_face(slave); short_eyes(slave); short_ears(slave); - if (slave.markings !== "none") - r += `Markings`; + if (slave.markings !== "none") { + r += "Markings"; + } short_lips(slave); short_teeth(slave); short_muscles(slave); @@ -143,8 +158,9 @@ window.SlaveSummaryUncached = (function(){ long_implants(slave); long_lactation(slave); long_mods(slave); - if (slave.brand !== 0) + if (slave.brand !== 0) { r += `Branded.`; + } r += `</span>`; } if (V.abbreviateHormoneBalance === 1) { @@ -192,32 +208,37 @@ window.SlaveSummaryUncached = (function(){ } r += ` hormone balance.</span>`; } - r += `<br>`; - if (V.seeImages !== 1 || V.seeSummaryImages !== 1 || V.imageChoice === 1) - r += ` `; + r += "<br>"; + if (V.seeImages !== 1 || V.seeSummaryImages !== 1 || V.imageChoice === 1) { + r += " "; + } if (V.abbreviateSkills === 1) { short_intelligence(slave); short_sex_skills(slave); - if (slave.combatSkill > 0) - r += `C`; - r += `</span> `; + if (slave.combatSkill > 0) { + r += "C"; + } + r += "</span> "; short_prestige(slave); short_porn_prestige(slave); } else if (V.abbreviateSkills === 2) { long_intelligence(slave); long_sex_skills(slave); - if (slave.combatSkill > 0) - r += `Trained fighter.`; - r += `</span> `; + if (slave.combatSkill > 0) { + r += "Trained fighter."; + } + r += "</span> "; long_prestige(slave); long_porn_prestige(slave); } if (V.abbreviateMental === 1) { if (slave.fetish !== "mindbroken") { - if (slave.fetishKnown === 1) + if (slave.fetishKnown === 1) { short_fetish(slave); - if (slave.attrKnown === 1) + } + if (slave.attrKnown === 1) { short_attraction(slave); + } } if (slave.clitPiercing === 3) { short_smart_fetish(slave); @@ -229,10 +250,12 @@ window.SlaveSummaryUncached = (function(){ short_sex_quirk(slave); } else if (V.abbreviateMental === 2) { if (slave.fetish !== "mindbroken") { - if (slave.fetishKnown === 1) + if (slave.fetishKnown === 1) { long_fetish(slave); - if (slave.attrKnown === 1) + } + if (slave.attrKnown === 1) { long_attraction(slave); + } } if (slave.clitPiercing === 3) { long_smart_fetish(slave); @@ -243,42 +266,49 @@ window.SlaveSummaryUncached = (function(){ long_behavior_quirk(slave); long_sex_quirk(slave); } - if (slave.customLabel) + if (slave.customLabel) { r += `<strong><span class="yellow">${capFirstChar(slave.customLabel)}</span></strong>`; + } if ((slave.relationship !== 0) || (slave.relation !== 0) || (V.abbreviateClothes === 2) || (V.abbreviateRulesets === 2)) { r += `<br>`; - if (V.seeImages !== 1 || V.seeSummaryImages !== 1 || V.imageChoice === 1) + if (V.seeImages !== 1 || V.seeSummaryImages !== 1 || V.imageChoice === 1) { r += ` `; + } } if (V.abbreviateMental === 1) { r += `<span class="lightgreen">`; - if (V.familyTesting === 1) + if (V.familyTesting === 1) { short_extended_family(slave); - else + } else { short_legacy_family(slave); + } r += `</span>`; short_clone(slave); short_rival(slave); } else if (V.abbreviateMental === 2) { - if (V.familyTesting === 1) + if (V.familyTesting === 1) { long_extended_family(slave); - else + } else { long_legacy_family(slave); + } long_clone(slave); long_rival(slave); } if (slave.fuckdoll === 0) { if (V.abbreviateClothes === 2) { r += ` `; - if (slave.choosesOwnClothes === 1) - r += `Dressing herself. `; + if (slave.choosesOwnClothes === 1) { + r += "Dressing herself. "; + } long_clothes(slave); long_collar(slave); long_belly(slave); - if (slave.amp !== 1) + if (slave.amp !== 1) { long_legs(slave); - if (canWalk(slave)) + } + if (canWalk(slave)) { long_shoes(slave); + } long_chastity(slave); long_vaginal_acc(slave); long_dick_acc(slave); @@ -287,8 +317,9 @@ window.SlaveSummaryUncached = (function(){ } r += ` `; rules_assistant(slave); - if (V.abbreviateOrigins === 2 && slave.origin !== 0) + if (V.abbreviateOrigins === 2 && slave.origin !== 0) { origins(slave); + } return r; } @@ -599,7 +630,6 @@ window.SlaveSummaryUncached = (function(){ } } r += " "; - } /** @param {App.Entity.SlaveState} slave */ @@ -2651,7 +2681,7 @@ window.SlaveSummaryUncached = (function(){ /** @param {App.Entity.SlaveState} slave */ function short_intelligence(slave) { - var intelligence = slave.intelligence + slave.intelligenceImplant; + const intelligence = slave.intelligence + slave.intelligenceImplant; if (slave.fetish === "mindbroken") { return; } else if (slave.intelligenceImplant >= 30) { @@ -2797,7 +2827,7 @@ window.SlaveSummaryUncached = (function(){ /** @param {App.Entity.SlaveState} slave */ function long_intelligence(slave) { - var intelligence = slave.intelligence + slave.intelligenceImplant; + const intelligence = slave.intelligence + slave.intelligenceImplant; if (slave.fetish === "mindbroken") { return; } else if (slave.intelligenceImplant >= 30) { @@ -3805,13 +3835,13 @@ window.SlaveSummaryUncached = (function(){ function short_extended_family(slave) { let handled = 0; if (slave.mother > 0) { - let _ssj = V.slaves.findIndex(function(s) { + const _ssj = V.slaves.findIndex(function(s) { return s.ID === slave.mother; }); if (_ssj !== -1) { r += `${SlaveFullName(V.slaves[_ssj])}'s daughter`; if (slave.relationshipTarget === V.slaves[_ssj].ID) { - let friendShipShort = relationshipTermShort(slave); + const friendShipShort = relationshipTermShort(slave); r += ` & ${friendShipShort}`; handled = 1; } @@ -3831,13 +3861,13 @@ window.SlaveSummaryUncached = (function(){ r += `${V.missingTable[slave.mother].fullName}'s daughter `; } if (slave.father > 0 && slave.father !== slave.mother) { - let _ssj = V.slaves.findIndex(function(s) { + const _ssj = V.slaves.findIndex(function(s) { return s.ID === slave.father; }); if (_ssj !== -1) { r += `${SlaveFullName(V.slaves[_ssj])}'s daughter`; if (slave.relationshipTarget === V.slaves[_ssj].ID && handled !== 1) { - let friendShipShort = relationshipTermShort(slave); + const friendShipShort = relationshipTermShort(slave); r += ` & ${friendShipShort}`; handled = 1; } @@ -3863,7 +3893,7 @@ window.SlaveSummaryUncached = (function(){ if (_ssj !== -1) { r += `${SlaveFullName(V.slaves[_ssj])}'s mother`; if (slave.relationshipTarget === V.slaves[_ssj].ID) { - let friendShipShort = relationshipTermShort(slave); + const friendShipShort = relationshipTermShort(slave); r += ` & ${friendShipShort}`; handled = 1; } @@ -3875,7 +3905,7 @@ window.SlaveSummaryUncached = (function(){ if (_ssj !== -1) { r += `${SlaveFullName(V.slaves[_ssj])}'s father`; if (slave.relationshipTarget === V.slaves[_ssj].ID && handled !== 1) { - let friendShipShort = relationshipTermShort(slave); + const friendShipShort = relationshipTermShort(slave); r += ` & ${friendShipShort}`; handled = 1; } @@ -3885,13 +3915,13 @@ window.SlaveSummaryUncached = (function(){ r += `multiple daughters `; } if (slave.sisters === 1) { - let _ssj = V.slaves.findIndex(function(s) { + const _ssj = V.slaves.findIndex(function(s) { return areSisters(s, slave) > 0; }); if (_ssj !== -1) { r += `${SlaveFullName(V.slaves[_ssj])}'s sister`; if (slave.relationshipTarget === V.slaves[_ssj].ID) { - let friendShipShort = relationshipTermShort(slave); + const friendShipShort = relationshipTermShort(slave); r += `& ${friendShipShort}`; handled = 1; } @@ -3901,12 +3931,12 @@ window.SlaveSummaryUncached = (function(){ r += `multiple sisters `; } if (slave.relationship > 0 && handled !== 1) { - let _ssj = V.slaves.findIndex(function(s) { + const _ssj = V.slaves.findIndex(function(s) { return s.ID === slave.relationshipTarget; }); if (_ssj !== -1) { r += `${SlaveFullName(V.slaves[_ssj])}'s`; - let friendShipShort = relationshipTermShort(slave); + const friendShipShort = relationshipTermShort(slave); r += ` ${friendShipShort}`; } } else if (slave.relationship === -3 && slave.mother !== -1 && slave.father !== -1) { @@ -3922,7 +3952,7 @@ window.SlaveSummaryUncached = (function(){ /** @param {App.Entity.SlaveState} slave */ function short_legacy_family(slave) { if (slave.relation !== 0) { - let _ssj = V.slaves.findIndex(function(s) { + const _ssj = V.slaves.findIndex(function(s) { return s.ID === slave.relationTarget; }); if (_ssj !== -1) { @@ -3930,11 +3960,11 @@ window.SlaveSummaryUncached = (function(){ } } if (slave.relationship > 0) { - let _ssj = V.slaves.findIndex(function(s) { + const _ssj = V.slaves.findIndex(function(s) { return s.ID === slave.relationshipTarget; }); if (_ssj !== -1) { - var friendship = relationshipTerm(slave); + const friendship = relationshipTerm(slave); if (slave.relationshipTarget !== slave.relationTarget) { r += `${SlaveFullName(V.slaves[_ssj])}'s`; } else { @@ -3962,7 +3992,7 @@ window.SlaveSummaryUncached = (function(){ function short_rival(slave) { if (slave.rivalry !== 0) { r += ` `; - let _ssj = V.slaves.findIndex(function(s) { + const _ssj = V.slaves.findIndex(function(s) { return s.ID === slave.rivalryTarget; }); if (_ssj !== -1) { @@ -3983,13 +4013,13 @@ window.SlaveSummaryUncached = (function(){ function long_extended_family(slave) { let handled = 0; if (slave.mother > 0) { - let _ssj = V.slaves.findIndex(function(s) { + const _ssj = V.slaves.findIndex(function(s) { return s.ID === slave.mother; }); if (_ssj !== -1) { r += `${SlaveFullName(V.slaves[_ssj])}'s <span class="lightgreen">daughter`; if (slave.relationshipTarget === V.slaves[_ssj].ID) { - let friendShipShort = relationshipTerm(slave); + const friendShipShort = relationshipTerm(slave); r += ` and ${friendShipShort}`; handled = 1; } @@ -4010,13 +4040,13 @@ window.SlaveSummaryUncached = (function(){ r += `${V.missingTable[slave.mother].fullName}'s <span class="lightgreen">daughter.</span> `; } if (slave.father > 0 && slave.father !== slave.mother) { - let _ssj = V.slaves.findIndex(function(s) { + const _ssj = V.slaves.findIndex(function(s) { return s.ID === slave.father; }); if (_ssj !== -1) { r += `${SlaveFullName(V.slaves[_ssj])}'s <span class="lightgreen">daughter`; if (slave.relationshipTarget === V.slaves[_ssj].ID) { - let friendShipShort = relationshipTerm(slave); + const friendShipShort = relationshipTerm(slave); r += ` and ${friendShipShort}`; handled = 1; } @@ -4043,7 +4073,7 @@ window.SlaveSummaryUncached = (function(){ if (_ssj !== -1) { r += `${SlaveFullName(V.slaves[_ssj])}'s <span class="lightgreen">mother`; if (slave.relationshipTarget === V.slaves[_ssj].ID) { - let friendShipShort = relationshipTerm(slave); + const friendShipShort = relationshipTerm(slave); r += ` and ${friendShipShort}`; handled = 1; } @@ -4055,7 +4085,7 @@ window.SlaveSummaryUncached = (function(){ if (_ssj !== -1) { r += `${SlaveFullName(V.slaves[_ssj])}'s <span class="lightgreen">father`; if (slave.relationshipTarget === V.slaves[_ssj].ID) { - let friendShipShort = relationshipTerm(slave); + const friendShipShort = relationshipTerm(slave); r += ` and ${friendShipShort}`; handled = 1; } @@ -4071,13 +4101,13 @@ window.SlaveSummaryUncached = (function(){ } } if (slave.sisters === 1) { - let _ssj = V.slaves.findIndex(function(s) { + const _ssj = V.slaves.findIndex(function(s) { return areSisters(s, slave) > 0; }); if (_ssj !== -1) { r += `${SlaveFullName(V.slaves[_ssj])}'s <span class="lightgreen">sister`; if (slave.relationshipTarget === V.slaves[_ssj].ID) { - let friendShipShort = relationshipTerm(slave); + const friendShipShort = relationshipTerm(slave); r += ` and ${friendShipShort}`; handled = 1; } @@ -4093,11 +4123,11 @@ window.SlaveSummaryUncached = (function(){ } } if (slave.relationship > 0 && handled !== 1) { - let _ssj = V.slaves.findIndex(function(s) { + const _ssj = V.slaves.findIndex(function(s) { return s.ID === slave.relationshipTarget; }); if (_ssj !== -1) { - var friendship = relationshipTerm(slave); + const friendship = relationshipTerm(slave); r += `${SlaveFullName(V.slaves[_ssj])}'s `; r += `<span class="lightgreen">${friendship}.</span> `; } @@ -4113,7 +4143,7 @@ window.SlaveSummaryUncached = (function(){ /** @param {App.Entity.SlaveState} slave */ function long_legacy_family(slave) { if (slave.relation !== 0) { - let _ssj = V.slaves.findIndex(function(s) { + const _ssj = V.slaves.findIndex(function(s) { return s.ID === slave.relationTarget; }); if (_ssj !== -1) { @@ -4129,11 +4159,11 @@ window.SlaveSummaryUncached = (function(){ } } if (slave.relationship > 0) { - let _ssj = V.slaves.findIndex(function(s) { + const _ssj = V.slaves.findIndex(function(s) { return s.ID === slave.relationshipTarget; }); if (_ssj !== -1) { - var friendship = relationshipTerm(slave); + const friendship = relationshipTerm(slave); if (slave.relationshipTarget !== slave.relationTarget) { r += `${SlaveFullName(V.slaves[_ssj])}'s `; } else { @@ -4161,7 +4191,7 @@ window.SlaveSummaryUncached = (function(){ function long_rival(slave) { if (slave.rivalry !== 0) { r += ` `; - let _ssj = V.slaves.findIndex(function(s) { + const _ssj = V.slaves.findIndex(function(s) { return s.ID === slave.rivalryTarget; }); if (_ssj !== -1) { @@ -4859,7 +4889,7 @@ App.UI.slaveSummaryList = function (passageName) { 'use strict'; const V = State.variables; - let _indexed = 0; + const _indexed = 0; /** @type {App.Entity.SlaveState[]} */ const slaves = V.slaves; @@ -4888,28 +4918,29 @@ App.UI.slaveSummaryList = function (passageName) { * Usage: << htag attributes tag >> ... << /htag>> */ function htag(text, attributes, tag) { - const payload = text.replace(/(^\n+|\n+$)/, ''); - let htag = tag || 'div'; + const payload = text.replace(/(^\n+|\n+$)/, ""); + const htag = tag || "div"; - if ("object" === typeof attributes) - attributes = $.map(attributes, (val, key) => key + '="' + val + '"').join(" "); - else - attributes = 'id="' + String(this.args[0]).trim() + '"'; + if ("object" === typeof attributes) { + attributes = $.map(attributes, (val, key) => `${key }="${ val }"`).join(" "); + } else { + attributes = `id="${ String(this.args[0]).trim() }"`; + } - return '<' + htag + ' ' + attributes + '>' + payload + '</' + htag + '>'; + return `<${ htag } ${ attributes }>${ payload }</${ htag }>`; } function SlaveArt(slave, option) { - return '<<SlaveArtById ' + slave.ID + ' ' + option + '>>'; + return `<<SlaveArtById ${ slave.ID } ${ option }>>`; } function slaveImage(s) { - return '<div class="imageRef smlImg">' + SlaveArt(s, 1) + '</div>'; + return `<div class="imageRef smlImg">${ SlaveArt(s, 1) }</div>`; } function dividerAndImage(s, showImage) { showImage = showImage || true; - let r = [V.lineSeparations === 0 ? '<br>' : '<hr style="margin:0">']; + const r = [V.lineSeparations === 0 ? "<br>" : "<hr style=\"margin:0\">"]; if (showImage && (V.seeImages === 1) && (V.seeSummaryImages === 1)) { r.push(slaveImage(s)); } @@ -4928,7 +4959,7 @@ App.UI.slaveSummaryList = function (passageName) { return idx !== null; }); - let res = []; + const res = []; const tabName = V.slaveAssignmentTab; let _tableCount = 0; @@ -4938,11 +4969,9 @@ App.UI.slaveSummaryList = function (passageName) { * <<print 'pass/count/indexed/flag::[' + passageName + '/' + _Count + '/' + _indexed + '/' + $Flag + ']'>> */ - if (((_Count > 1) && (_indexed === 0) && (((passageName === 'Main') && (V.Flag === undefined) && ((V.useSlaveSummaryTabs === 0) || (V.slaveAssignmentTab === "all"))) || (V.Flag === 1)))) { - let _indexed = 1, - _counter = 0, - _buttons = [], - _offset = -50; + if (((_Count > 1) && (_indexed === 0) && (((passageName === "Main") && (V.Flag === undefined) && ((V.useSlaveSummaryTabs === 0) || (V.slaveAssignmentTab === "all"))) || (V.Flag === 1)))) { + const _buttons = []; + let _offset = -50; if (/Select/i.test(passageName)) { _offset = -25; } @@ -4958,20 +4987,20 @@ App.UI.slaveSummaryList = function (passageName) { /* * we want <div id="list_index3" class=" hidden">... */ - var listIndexContent = ""; + let listIndexContent = ""; - for (let _ssii of _indexSlavesIdxs) { + for (const _ssii of _indexSlavesIdxs) { const _IndexSlave = slaves[_ssii]; const _indexSlaveName = SlaveFullName(_IndexSlave); const _devotionClass = getSlaveDevotionClass(_IndexSlave); const _trustClass = getSlaveTrustClass(_IndexSlave); _buttons.push({ - 'data-name': _indexSlaveName, - 'data-scroll-to': '#slave-' + _IndexSlave.ID, - 'data-scroll-offset': _offset, - 'data-devotion': _IndexSlave.devotion, - 'data-trust': _IndexSlave.trust, - class: _devotionClass + ' ' + _trustClass + "data-name": _indexSlaveName, + "data-scroll-to": `#slave-${ _IndexSlave.ID}`, + "data-scroll-offset": _offset, + "data-devotion": _IndexSlave.devotion, + "data-trust": _IndexSlave.trust, + "class": `${_devotionClass } ${ _trustClass}` }); } if (_buttons.length > 0) { @@ -5002,7 +5031,7 @@ App.UI.slaveSummaryList = function (passageName) { } } - for (let _ssi of _filteredSlaveIdxs) { + for (const _ssi of _filteredSlaveIdxs) { let _Slave = slaves[_ssi]; if (passageName === "Main" && V.useSlaveSummaryTabs === 1) { @@ -5021,7 +5050,7 @@ App.UI.slaveSummaryList = function (passageName) { const _slaveName = SlaveFullName(_Slave); - let _tableCount = 0; + const _tableCount = 0; let slaveImagePrinted = (V.seeImages === 1) && (V.seeSummaryImages === 1); res.push('<div id="slave_' + _Slave.ID + '" style="clear:both">'); @@ -5039,8 +5068,7 @@ App.UI.slaveSummaryList = function (passageName) { else if ("recruit girls" === _Slave.assignment) res.push('<strong>@@.lightcoral;RC@@</strong> '); else if ("guard you" === _Slave.assignment) res.push('<strong>@@.lightcoral;BG@@</strong> '); - if (Array.isArray(V.personalAttention) && V.personalAttention.findIndex(s => s.ID === _Slave.ID) !== -1) - { + if (Array.isArray(V.personalAttention) && V.personalAttention.findIndex(s => s.ID === _Slave.ID) !== -1) { res.push('<strong>@@.lightcoral; PA@@</strong> '); } res.push(this.passageLink(_slaveName, 'Slave Interact', `$activeSlave = $slaves[${_ssi}]`)); /* lists their names */ @@ -5294,7 +5322,7 @@ App.UI.slaveSummaryList = function (passageName) { case "Farmyard": if (V.Flag === 0) { if (_Slave.assignment === "work as a farmhand") { res.pop(); continue; } - if (V.farmyard <= V.farmyardSlaves){ res.pop(); continue; } + if (V.farmyard <= V.farmyardSlaves) { res.pop(); continue; } res.push(dividerAndImage(_Slave)); res.push(`[[${_slaveName}|Slave Interact][$activeSlave = $slaves[${_ssi}]]]`); } else if (V.Flag === 1) { @@ -5483,7 +5511,7 @@ App.UI.slaveSummaryList = function (passageName) { res.push('. '); /** @type {string[]} */ - let assignments = []; + const assignments = []; if ((V.displayAssignments === 1) && (passageName === "Main") && (_Slave.ID !== V.HeadGirl.ID) && (_Slave.ID !== V.Recruiter.ID) && (_Slave.ID !== V.Bodyguard.ID)) { if (_Slave.assignment !== "rest") { assignments.push(`<<link "Rest" "Main">><<= removeJob($slaves[${_ssi}], $slaves[${_ssi}].assignment)>><</link>>`); @@ -5553,7 +5581,7 @@ App.UI.slaveSummaryList = function (passageName) { res.push(assignments.join(" | ")); } - let _numFacilities = V.brothel + V.club + V.dairy + V.farmyard + V.servantsQuarters + V.masterSuite + V.spa + V.clinic + V.schoolroom + V.cellblock + V.arcade + V.HGSuite; + const _numFacilities = V.brothel + V.club + V.dairy + V.farmyard + V.servantsQuarters + V.masterSuite + V.spa + V.clinic + V.schoolroom + V.cellblock + V.arcade + V.HGSuite; if (_numFacilities > 0) { if (passageName === "Main" || passageName === "Head Girl Suite" || passageName === "Spa" || passageName === "Brothel" || passageName === "Club" || passageName === "Arcade" || passageName === "Clinic" || passageName === "Schoolroom" || passageName === "Dairy" || passageName === "Farmyard" || passageName === "Servants' Quarters" || passageName === "Master Suite" || passageName === "Cellblock") { @@ -5561,7 +5589,7 @@ App.UI.slaveSummaryList = function (passageName) { res.push('<br>Transfer to: '); /** @type {string[]} */ - let transfers = []; + const transfers = []; if (_Slave.assignment !== "rest" && _Slave.assignment !== "please you" && _Slave.assignment !== "take classes" && _Slave.assignment !== "be a servant" && _Slave.assignment !== "whore" && _Slave.assignment !== "serve the public" && _Slave.assignment !== "get milked" && _Slave.assignment !== "stay confined") { transfers.push(`<<link "Penthouse" "Main">><<= removeJob($slaves[${_ssi}], $slaves[${_ssi}].assignment)>><</link>>`); } else { @@ -5634,7 +5662,7 @@ App.UI.slaveSummaryList = function (passageName) { } if (V.dairy !== 0) { - let _dairySeed = V.bioreactorsXY + V.bioreactorsXX + V.bioreactorsHerm + V.bioreactorsBarren; + const _dairySeed = V.bioreactorsXY + V.bioreactorsXX + V.bioreactorsHerm + V.bioreactorsBarren; if (V.dairy <= V.dairySlaves + _dairySeed) { transfers.push('Dairy'); } else if (((_Slave.indentureRestrictions > 0) && (V.dairyRestraintsSetting > 1)) || ((_Slave.indentureRestrictions > 1) && (V.dairyRestraintsSetting > 0)) || (_Slave.breedingMark === 1 && V.propOutcome === 1 && V.dairyRestraintsSetting > 0) || ((V.dairyPregSetting > 0) && ((_Slave.bellyImplant !== -1) || (_Slave.broodmother > 0)))) { @@ -5954,8 +5982,9 @@ App.UI.selectSlaveForPersonalAttention = function (id) { } else { /* already a PA target; remove */ V.personalAttention.deleteAt(_pai); - if (V.personalAttention.length === 0) + if (V.personalAttention.length === 0) { V.personalAttention = "sex"; + } } } SugarCube.Engine.play("Personal Attention Select"); diff --git a/src/js/storyJS.js b/src/js/storyJS.js index 6fac9f460ef408594025b6afe0fd9f2c9f444ca1..7420b66b7462dc2f417bf87b5c62e547c2285da0 100644 --- a/src/js/storyJS.js +++ b/src/js/storyJS.js @@ -27,7 +27,7 @@ window.isSexuallyPure = /** @param {App.Entity.SlaveState} slave */ function (sl } }; if (typeof interpolate === "undefined") { - const interpolate = function(x0,y0,x1,y1,x) { + const interpolate = function(x0, y0, x1, y1, x) { if (x <= x0) { return y0; } else if (x >= x1) { @@ -41,8 +41,9 @@ if (typeof interpolate === "undefined") { window.removeFromArray = function(arr, val) { for (let i = 0; i < arr.length; i++) { - if (val === arr[i]) - return arr.splice(i,1); + if (val === arr[i]) { + return arr.splice(i, 1); + } } return null; }; @@ -51,8 +52,9 @@ window.filterInPlace = function(arr, callback, thisArg) { let j = 0; arr.forEach(function(e, i) { - if (callback.call(thisArg, e, i, arr)) + if (callback.call(thisArg, e, i, arr)) { arr[j++] = e; + } }); arr.length = j; @@ -352,7 +354,7 @@ window.ngUpdateMissingTable = function(missingTable) { const newTable = {}; (State.variables.slaves || []) - .forEach(s => ([s.pregSource+1200000,s.mother+1200000,s.father+1200000] + .forEach(s => ([s.pregSource+1200000, s.mother+1200000, s.father+1200000] .filter(i => (i in missingTable)) .forEach(i => { newTable[i-1200000] = missingTable[i]; @@ -364,36 +366,36 @@ window.ngUpdateMissingTable = function(missingTable) { window.toJson = function(obj) { let jsontext = JSON.stringify(obj); - jsontext = jsontext.replace(/^{/,""); - jsontext = jsontext.replace(/}$/,""); + jsontext = jsontext.replace(/^{/, ""); + jsontext = jsontext.replace(/}$/, ""); return jsontext; }; window.nippleColor = /** @param {App.Entity.SlaveState} slave */ function (slave) { slave = slave || State.variables.activeSlave; - if (slave.skin === 'tanned' || slave.skin === 'fair') { + if (slave.skin === "tanned" || slave.skin === "fair") { if (slave.preg > slave.pregData.normalBirth/4 || (slave.birthsTotal > 0 && slave.lactation > 0)) { - return 'dark brown'; + return "dark brown"; } else { - return 'pink'; + return "pink"; } - } else if ((slave.skin === 'pale' || slave.race === 'white')) { + } else if ((slave.skin === "pale" || slave.race === "white")) { if (slave.preg > slave.pregData.normalBirth/4 || (slave.birthsTotal > 0 && slave.lactation > 0)) { - return 'brown'; + return "brown"; } else { - return 'pink'; + return "pink"; } - } else if ((slave.skin === 'brown' || slave.race === 'black')) { + } else if ((slave.skin === "brown" || slave.race === "black")) { if (slave.preg > slave.pregData.normalBirth/4 || (slave.birthsTotal > 0 && slave.lactation > 0)) { - return 'black'; + return "black"; } else { - return 'dark brown'; + return "dark brown"; } } else { if (slave.preg > slave.pregData.normalBirth/4 || (slave.birthsTotal > 0 && slave.lactation > 0)) { - return 'dark brown'; + return "dark brown"; } else { - return 'brown'; + return "brown"; } } }; @@ -443,13 +445,11 @@ window.isImpregnatedBy = function(mother, father) { return impregnatedBy(mother).includes(father.ID); }; -window.jsAlert = function(obj) -{ +window.jsAlert = function(obj) { alert(obj); }; -window.jsConsoleInfo = function(obj) -{ +window.jsConsoleInfo = function(obj) { console.info(obj); }; @@ -636,8 +636,9 @@ window.printTrinkets = function printTrinkets() { } } - if (State.variables.trinkets.length === 0) - return ''; + if (State.variables.trinkets.length === 0) { + return ""; + } const trinkets = weightedArray2HashMap(State.variables.trinkets); let trinketString = []; @@ -662,7 +663,7 @@ window.printTrinkets = function printTrinkets() { } else if (trinketString.length === 2 && plurals === false) { trinketString = `a couple of items: ${trinketString[0]}, and ${trinketString[1]}`; } else { - trinketString[trinketString.length - 1] = "and " + trinketString[trinketString.length - 1]; + trinketString[trinketString.length - 1] = `and ${trinketString[trinketString.length - 1]}`; trinketString = trinketString.join(", "); } return `There's a display case behind your desk, with ${trinketString}.`; diff --git a/src/uncategorized/longSlaveDescription.tw b/src/uncategorized/longSlaveDescription.tw index 9e6e99ab43084caba467c8fe271296c9dcfaba6d..e3e8bb107f4203e61a81d59d1df21a60b28eaeb7 100644 --- a/src/uncategorized/longSlaveDescription.tw +++ b/src/uncategorized/longSlaveDescription.tw @@ -362,7 +362,7 @@ is <</if>> <</if>> -<<ageAndHealthDescription>> +<<= App.Desc.AgeAndHealth($activeSlave)>> <<if $saleDescription != 1>> <<if $clinic != 0 && $clinicUpgradeScanner == 1>> diff --git a/src/utility/descriptionWidgetsFlesh.tw b/src/utility/descriptionWidgetsFlesh.tw index 2512161a0cc3ed8cdfc3cc897e34f0abd705174f..523f441cc9cb3976f1df406bf28df26ffb29684d 100644 --- a/src/utility/descriptionWidgetsFlesh.tw +++ b/src/utility/descriptionWidgetsFlesh.tw @@ -17684,260 +17684,6 @@ $He has <</widget>> -<<widget "ageAndHealthDescription">> - -<<if $activeSlave.fuckdoll == 0>> - <<if $activeSlave.health < -90>> - $He is nearly unresponsive. $He's obviously @@.red;dangerously sick,@@ - <<elseif $activeSlave.health < -50>> - $He seems @@.red;very sick,@@ - <<elseif $activeSlave.health < -20>> - $He seems @@.red;ill,@@ - <<elseif $activeSlave.health <= 20>> - $He seems reasonably @@.yellow;healthy,@@ - <<elseif $activeSlave.health <= 50>> - $He shines with @@.green;good health,@@ - <<else>> - $He almost gleams; $he's in the absolute @@.green;best of health,@@ - <</if>> - and - <<set _age = $activeSlave.actualAge + 1>> - $he's - <<if $activeSlave.birthWeek >= 52 && $seeAge == 1>> - going to turn _age this week, - <<elseif $activeSlave.actualAge < 3>> - an infant, - <<if $showAgeDetail == 1>> - <<if $activeSlave.actualAge == 0>> - <<print 0+$week-$activeSlave.weekAcquired>> weeks - <<elseif $activeSlave.actualAge == 1>> - <<= num($activeSlave.actualAge)>> year - <<else>> - <<= num($activeSlave.actualAge)>> years - <</if>> - old<<if ($seeAge != 0)>>; <<if $activeSlave.birthWeek == 51>>$his birthday is next week<<else>>$his birthday is in <<print 52-$activeSlave.birthWeek>> weeks<</if>><</if>>. - <<else>> - only - <<if $activeSlave.actualAge == 0>> - <<print 0+$week-$activeSlave.weekAcquired>> weeks - <<elseif $activeSlave.actualAge == 1>> - <<= num($activeSlave.actualAge)>> year - <<else>> - <<= num($activeSlave.actualAge)>> years - <</if>> - old. - <</if>> - <<elseif $activeSlave.actualAge < 5>> - a toddler, - <<if $showAgeDetail == 1>> - <<= num($activeSlave.actualAge)>> years old<<if ($seeAge != 0)>>; <<if $activeSlave.birthWeek == 51>>$his birthday is next week<<else>>$his birthday is in <<print 52-$activeSlave.birthWeek>> weeks<</if>><</if>>. - <<else>> - only <<= num($activeSlave.actualAge)>> years old. - <</if>> - <<elseif $activeSlave.actualAge < 13>> - a little $girl, - <<if $showAgeDetail == 1>> - <<= num($activeSlave.actualAge)>> years old<<if ($seeAge != 0)>>; <<if $activeSlave.birthWeek == 51>>$his birthday is next week<<else>>$his birthday is in <<print 52-$activeSlave.birthWeek>> weeks<</if>><</if>>. - <<else>> - only <<= num($activeSlave.actualAge)>> years old. - <</if>> - <<elseif $activeSlave.actualAge < 16>> - almost a child, - <<if $showAgeDetail == 1>> - <<= num($activeSlave.actualAge)>> years old<<if ($seeAge != 0)>>; <<if $activeSlave.birthWeek == 51>>$his birthday is next week<<else>>$his birthday is in <<print 52-$activeSlave.birthWeek>> weeks<</if>><</if>>. - <<else>> - less than 17 years old. - <</if>> - <<elseif $activeSlave.actualAge < 17>> - young and fresh at <<= num($activeSlave.actualAge)>><<if $showAgeDetail == 1 && ($seeAge != 0)>>; <<if $activeSlave.birthWeek == 51>>$his birthday is next week<<else>>$his birthday is in <<print 52-$activeSlave.birthWeek>> weeks<</if>><</if>>. - <<elseif $activeSlave.actualAge < 18>> - young, fresh, and nearly 18<<if $showAgeDetail == 1 && ($seeAge != 0)>>; <<if $activeSlave.birthWeek == 51>>$his birthday is next week<<if $seeAge == 1>> and people are already beginning to eye $him<</if>><<else>>$his birthday is in <<print 52-$activeSlave.birthWeek>> weeks<</if>><</if>>. - <<elseif $activeSlave.actualAge < 19>> - <<if $activeSlave.birthWeek == 0 && $seeAge == 1>> - just turned <<= num($activeSlave.actualAge)>> this week, which many citizens find especially appealing. - <<elseif $activeSlave.birthWeek < 4 && $seeAge == 1>> - only turned <<= num($activeSlave.actualAge)>> this month. - <<else>> - <<= num($activeSlave.actualAge)>> years old<<if $showAgeDetail == 1 && ($seeAge != 0)>>; <<if $activeSlave.birthWeek == 51>>$his birthday is next week<<else>>$his birthday is in <<print 52-$activeSlave.birthWeek>> weeks<</if>><</if>>. - <</if>> - <<elseif $activeSlave.actualAge < 20>> - in $his final year as a teenager at age 19<<if $showAgeDetail == 1 && ($seeAge != 0)>>; <<if $activeSlave.birthWeek == 51>>$his birthday is next week<<else>>$his birthday is in <<print 52-$activeSlave.birthWeek>> weeks<</if>><</if>>. - <<elseif $activeSlave.actualAge < 26>> - a young $woman, - <<if $showAgeDetail == 1>> - <<= num($activeSlave.actualAge)>> years old<<if ($seeAge != 0)>>; <<if $activeSlave.birthWeek == 51>>$his birthday is next week<<else>>$his birthday is in <<print 52-$activeSlave.birthWeek>> weeks<</if>><</if>>. - <<else>> - in $his early twenties. - <</if>> - <<elseif $activeSlave.actualAge < 30>> - a younger $woman, - <<if $showAgeDetail == 1>> - <<= num($activeSlave.actualAge)>> years old<<if ($seeAge != 0)>>; <<if $activeSlave.birthWeek == 51>>$his birthday is next week<<else>>$his birthday is in <<print 52-$activeSlave.birthWeek>> weeks<</if>><</if>>. - <<else>> - in $his late twenties. - <</if>> - <<elseif $activeSlave.actualAge < 36>> - <<if $showAgeDetail == 1>> - <<= num($activeSlave.actualAge)>> years old<<if ($seeAge != 0)>>; <<if $activeSlave.birthWeek == 51>>$his birthday is next week<<else>>$his birthday is in <<print 52-$activeSlave.birthWeek>> weeks<</if>><</if>>. - <<else>> - in $his early thirties. - <</if>> - <<elseif $activeSlave.actualAge < 40>> - middle-aged for a slave, - <<if $showAgeDetail == 1>> - at <<= num($activeSlave.actualAge)>> years old<<if ($seeAge != 0)>>; <<if $activeSlave.birthWeek == 51>>$his birthday is next week<<else>>$his birthday is in <<print 52-$activeSlave.birthWeek>> weeks<</if>><</if>>. - <<else>> - in $his late thirties. - <</if>> - <<else>> - old for a slave, - <<if $showAgeDetail == 1>> - at <<= num($activeSlave.actualAge)>> years old<<if ($seeAge != 0)>>; <<if $activeSlave.birthWeek == 51>>$his birthday is next week<<else>>$his birthday is in <<print 52-$activeSlave.birthWeek>> weeks<</if>><</if>>. - <<else>> - <<if $activeSlave.actualAge < 50>>in $his forties.<<elseif $activeSlave.actualAge < 60>>in $his fifties. <<elseif $activeSlave.actualAge < 70>>extremely old for a slave, in $his 60s.<<elseif $activeSlave.actualAge < 80>>extremely old for a slave, in $his <<= num(70)>>s. <<elseif $activeSlave.actualAge < 90>>extremely old for a slave, in $his <<= num(80)>>s.<<elseif $activeSlave.actualAge < 100>>extremely old for a slave, in $his <<= num(90)>>s.<<elseif $activeSlave.actualAge >= 100>>ancient by any measure, over a century old.<</if>> - <</if>> - <</if>> - <<if $activeSlave.actualAge != $activeSlave.physicalAge>> - However, $he has the body of a <<= num($activeSlave.physicalAge)>>-year old; - <<if $activeSlave.physicalAge < 18 && $activeSlave.actualAge >= 18>> - a stark contrast given $his maturity. - <<elseif $activeSlave.physicalAge < 18 && $activeSlave.actualAge < 18>> - a noticeable difference thanks to $his immaturity. - <<elseif $activeSlave.physicalAge <= $activeSlave.actualAge-20 || $activeSlave.physicalAge >= $activeSlave.actualAge+20>> - a shocking difference from $his actual age. - <<elseif $activeSlave.physicalAge <= $activeSlave.actualAge-10 || $activeSlave.physicalAge >= $activeSlave.actualAge+10>> - a noticeable difference from $his actual age. - <<elseif $activeSlave.physicalAge <= $activeSlave.actualAge-5 || $activeSlave.physicalAge >= $activeSlave.actualAge+5>> - a barely noticeable difference from $his actual age. - <<else>> - though it is hard to tell the difference from $his actual age. - <</if>> - <</if>> - /* - ** This section replaces the age/therapy texts, giving more details for the NCS condition. - */ - <<if $activeSlave.geneMods.NCS == 1>> - <<if ($activeSlave.vagina < 0) && ($activeSlave.dick <= 0)>><<set _bodyNCS = 'childlike'>> - <<elseif ($activeSlave.vagina < 0) && ($activeSlave.dick > 0)>><<set _bodyNCS = 'shota'>> - <<elseif ($activeSlave.vagina > 0) && ($activeSlave.dick <= 0)>><<set _bodyNCS = 'loli'>> - <<else>><<set _bodyNCS = 'loli/shota'>> - <</if>> - - $He appears to be $activeSlave.visualAge years old - <<if $activeSlave.visualAge <= 8>> - and $he has induced @@.orange;NCS@@ and will always have a <<= _bodyNCS>> body, no matter how long $he lives. - <<elseif ($activeSlave.visualAge < 13)>> - and $he has induced @@.orange;NCS@@ and will have a <<= _bodyNCS>> body for the rest of $his life. - <<elseif ($activeSlave.visualAge < 20)>> - and $he still has a teen body for now, but with $his @@.orange;NCS,@@ $he will eventually regress in age to look like a little $girl again. - <<else>> - and $he still has the body of an adult, but $his @@.orange;NCS@@ has - <<if ($activeSlave.physicalAge - $activeSlave.visualAge <= 5)>> - not really begun to youthen $his appearance yet. - <<elseif ($activeSlave.physicalAge - $activeSlave.visualAge <= 10)>> - clearly been at work on $him, making $him appear younger. - <<elseif ($activeSlave.physicalAge -$activeSlave.visualAge <= 20)>> - obviously helped take more than a decade off of $his age. - <<else>> - intensely youthened $him. - <</if>> - <</if>> - <<elseif $activeSlave.physicalAge != $activeSlave.visualAge>> - <<if $activeSlave.visualAge <= $activeSlave.physicalAge-20 || $activeSlave.visualAge >= $activeSlave.physicalAge+20>> - $He has undergone radical age therapy that makes $him look - <<elseif $activeSlave.visualAge <= $activeSlave.physicalAge-10 || $activeSlave.visualAge >= $activeSlave.physicalAge+10>> - $He has undergone drastic age therapy that makes $him look - <<elseif $activeSlave.visualAge <= $activeSlave.physicalAge-5 || $activeSlave.visualAge >= $activeSlave.physicalAge+5>> - $He has undergone noticeable age therapy that makes $him look - <<else>> - For various reasons, $he looks - <</if>> - <<if $activeSlave.physicalAge > $activeSlave.visualAge>> - <<if $activeSlave.physicalAge < $activeSlave.visualAge+5>> - a slightly younger <<print $activeSlave.visualAge>>. - <<elseif $activeSlave.visualAge < 20>> - like $he's barely an adult. - <<elseif $activeSlave.visualAge < 25>> - barely into $his early twenties. - <<elseif $activeSlave.visualAge < 30>> - like $he's still in $his twenties. - <<elseif $activeSlave.visualAge < 35>> - barely thirty. - <<elseif $activeSlave.visualAge < 40>> - still in $his thirties. - <<elseif $activeSlave.visualAge < 45>> - barely forty. - <<elseif $activeSlave.visualAge < 50>> - still in $his forties. - <<elseif $activeSlave.visualAge < 55>> - barely fifty. - <<elseif $activeSlave.visualAge < 60>> - still in $his fifties. - <<elseif $activeSlave.visualAge < 65>> - barely sixty. - <<elseif $activeSlave.visualAge < 70>> - still in $his sixties. - <<elseif $activeSlave.visualAge < 75>> - barely seventy. - <<elseif $activeSlave.visualAge < 80>> - still in $his seventies. - <<else>> - a younger <<print $activeSlave.visualAge>>. - <</if>> - <<else>> - <<if $activeSlave.physicalAge > $activeSlave.visualAge-5>> - a slightly older <<print $activeSlave.visualAge>>. - <<elseif $activeSlave.visualAge < 20>> - like a fresh adult. - <<elseif $activeSlave.visualAge < 25>> - just over twenty. - <<elseif $activeSlave.visualAge < 30>> - nearly thirty. - <<elseif $activeSlave.visualAge < 35>> - just over thirty. - <<elseif $activeSlave.visualAge < 40>> - nearly forty. - <<elseif $activeSlave.visualAge < 45>> - just over forty. - <<elseif $activeSlave.visualAge < 50>> - nearly fifty. - <<elseif $activeSlave.visualAge < 55>> - just over fifty. - <<elseif $activeSlave.visualAge < 60>> - nearly sixty. - <<elseif $activeSlave.visualAge < 65>> - just over sixty. - <<elseif $activeSlave.visualAge < 70>> - nearly seventy. - <<elseif $activeSlave.visualAge < 75>> - just over seventy. - <<elseif $activeSlave.visualAge < 80>> - nearly eighty. - <<else>> - an ancient <<print $activeSlave.visualAge>>. - <</if>> - <</if>> - <</if>> -<<else>> - The Fuckdoll gives no external indication of $his health or age, but upon query $his systems reports that $he is - <<if $activeSlave.health < -90>> - @@.red;dangerously sick@@ - <<elseif $activeSlave.health < -50>> - @@.red;very sick@@ - <<elseif $activeSlave.health < -20>> - @@.red;ill@@ - <<elseif $activeSlave.health <= 20>> - @@.yellow;healthy@@ - <<elseif $activeSlave.health <= 50>> - @@.green;very health@@ - <<else>> - @@.green;extremely healthy@@ - <</if>> - and $activeSlave.physicalAge years old. -<</if>> - -<</widget>> - <<widget "accentDescription">> <<if $activeSlave.accent != 0>>