diff --git a/src/js/useSlave.JS b/src/js/useSlave.JS index d712fdfd83325b44a43bba5198d586772079a21b..7437203397e76bd06f43a76fe7a50fa5434bc45c 100644 --- a/src/js/useSlave.JS +++ b/src/js/useSlave.JS @@ -380,7 +380,7 @@ window.useSlaveDisplay = function(slave) { link = document.createTextNode("error, scene not found"); } } else { - let passage = []; + let passage = ""; if (sexArray[i].goto) { passage = sexArray[i].goto; } @@ -389,6 +389,7 @@ window.useSlaveDisplay = function(slave) { link = App.UI.DOM.link( sexArray[i].text, () => { click(sexArray[i]); }, + [], passage ); @@ -423,6 +424,7 @@ window.useSlaveDisplay = function(slave) { // Refresh spans as needed: SlaveInteractImpreg(slave); + SlaveInteractFertility(slave); if (sexOption.scene) { return App.UI.replace('#miniscene', `<<include "${sexOption.scene}">>`); @@ -442,27 +444,26 @@ window.SlaveInteractImpreg = function(slave) { // eslint-disable-next-line no-unused-vars he, him, his, hers, himself, boy, He, His } = getPronouns(slave); - + const separator = document.createTextNode(` | `); let bloating = document.createElement('span'); if (slave.inflation > 0) { - let intro = document.createTextNode("Required Bloating"); - intro.textDecoration = "underline"; + let intro = document.createElement('span'); + intro.textContent = "Required Bloating"; + intro.style.textDecoration = "underline"; bloating.append(intro); - bloating.append(":"); + bloating.append(": "); - let requirement; + let requirement = document.createElement('span'); + requirement.style.fontWeight = "bold"; + requirement.id = "inflate"; if (slave.inflation === 3) { - requirment = `${He} is required to keep 2 gallons of ${slave.inflationType} in ${him} at all times`; + requirement.textContent = `${He} is required to keep 2 gallons of ${slave.inflationType} in ${him} at all times`; } else if (slave.inflation === 2) { - requirment = `${He} is required to keep 4 liters of ${slave.inflationType} in ${him} at all times`; + requirement.textContent = `${He} is required to keep 4 liters of ${slave.inflationType} in ${him} at all times`; } else if (slave.inflation === 1) { - requirment = `${He} is required to keep 2 liters of ${slave.inflationType} in ${him} at all times`; + requirement.textContent = `${He} is required to keep 2 liters of ${slave.inflationType} in ${him} at all times`; } - - requirement = document.createTextNode(requirement); - requirement.fontWeight = bold; - requirement.id = "inflate"; bloating.append(requirement); bloating.append("."); @@ -499,9 +500,10 @@ window.SlaveInteractImpreg = function(slave) { ); bloating.append(link); } + return jQuery('#bloating').empty().append(bloating); } // make sure it updates itself after run - return jQuery('#bloating').empty().append(bloating); + return; }; @@ -511,7 +513,7 @@ window.SlaveInteractFertility = function(slave) { // eslint-disable-next-line no-unused-vars he, him, his, hers, himself, boy, He, His } = getPronouns(slave); - + const separator = document.createTextNode(` | `); let fertilityblock = document.createElement('span'); if (slave.ovaries === 1 || slave.mpreg === 1 || slave.preg > 0) { let note = document.createTextNode(``); @@ -540,15 +542,16 @@ window.SlaveInteractFertility = function(slave) { slave.broodmotherOnHold = 0, slave.broodmotherCountDown = 0; }, + [], "Slave Interact" ); fertilityblock.append(link); } } else if (slave.preg >= -1) { - Contraception; + fertilityblock.append("Contraception: "); let fertility = document.createElement('span'); fertility.id = "fertility"; - fertility.fontWeight = "bold"; + fertility.style.fontWeight = "bold"; if (slave.preg === -1) { fertility.textContent = "using contraceptives"; } else if (slave.pregWeek < 0) { @@ -565,11 +568,13 @@ window.SlaveInteractFertility = function(slave) { let link = App.UI.DOM.link( `Inspect pregnancy`, () => { - + SlaveInteractImpreg(slave); }, + [], "Analyze Pregnancy" ); fertilityblock.append(link); + fertilityblock.append(` | `); } if (slave.preg === 0) { let link = App.UI.DOM.link( @@ -605,15 +610,17 @@ window.SlaveInteractFertility = function(slave) { SlaveInteractImpreg(slave), SlaveInteractFertility(slave); }, + "", "Slave Interact" ); fertilityblock.append(link); - fertilityblock.append(seperator); + fertilityblock.appendChild(separator); link = App.UI.DOM.link( - `"Give ${him} a cesarean section"`, + `Give ${him} a cesarean section`, () => { - + SlaveInteractImpreg(slave); }, + [], "csec" ); fertilityblock.append(link); @@ -630,15 +637,16 @@ window.SlaveInteractFertility = function(slave) { fertilityblock.append(link); } if ((slave.broodmotherOnHold !== 1) && (slave.preg >= 36)) { - fertilityblock.append(seperator); + fertilityblock.appendChild(separator); } - fertilityblock.append(seperator); + fertilityblock.appendChild(separator); if (slave.preg > 37) { let link = App.UI.DOM.link( `Induce mass childbirth`, () => { }, + [], "BirthStorm" ); fertilityblock.append(link); @@ -650,6 +658,7 @@ window.SlaveInteractFertility = function(slave) { slave.broodmotherOnHold = 0, slave.broodmotherCountDown = 0; }, + [], "csec" ); fertilityblock.append(link); @@ -662,6 +671,7 @@ window.SlaveInteractFertility = function(slave) { slave.broodmotherOnHold = 0, slave.broodmotherCountDown = 0; }, + [], "Abort" ); fertilityblock.append(link); @@ -684,22 +694,25 @@ window.SlaveInteractFertility = function(slave) { ) { // div? let control = document.createElement('div'); - control.textDecoration = "underline"; - control.textContent = "Pregnancy control"; - fertilityblock.append(control); - fertilityblock.append("."); + let underline = document.createElement('span'); + + underline.style.textDecoration = "underline"; // TODO: doesn't seem to work + underline.textContent = "Pregnancy control"; + control.append(underline); + control.append(": "); if (slave.pregControl === "labor suppressors") { - fertilityblock.append("Labor is suppressed."); + control.append("Labor is suppressed."); } else if (slave.pregControl === "slow gestation") { - fertilityblock.append("Slowed gestation speed."); + control.append("Slowed gestation speed."); } else if (slave.pregControl === "speed up") { - fertilityblock.append("Faster gestation speed, staffed clinic recommended."); + control.append("Faster gestation speed, staffed clinic recommended."); } else { - fertilityblock.append("Normal gestation and birth."); + control.append("Normal gestation and birth."); } + fertilityblock.append(control); + control = document.createElement('div'); if (slave.preg >= slave.pregData.minLiveBirth) { - // div if (slave.pregControl === "labor suppressors") { let link = App.UI.DOM.link( `Normal Birth`, @@ -709,7 +722,7 @@ window.SlaveInteractFertility = function(slave) { }, [] ); - fertilityblock.append(link); + control.append(link); } else { let link = App.UI.DOM.link( `Suppress Labor`, @@ -719,10 +732,9 @@ window.SlaveInteractFertility = function(slave) { }, [] ); - fertilityblock.append(link); + control.append(link); } } else if (slave.preg < slave.pregData.normalBirth) { - // div if (slave.pregControl !== "none") { let link = App.UI.DOM.link( `Normal Gestation`, @@ -732,7 +744,7 @@ window.SlaveInteractFertility = function(slave) { }, [] ); - fertilityblock.append(link); + control.append(link); } if (slave.pregControl !== "slow Gestation") { let link = App.UI.DOM.link( @@ -743,7 +755,7 @@ window.SlaveInteractFertility = function(slave) { }, [] ); - fertilityblock.append(link); + control.append(link); } if (slave.pregControl !== "speed up") { let link = App.UI.DOM.link( @@ -754,9 +766,10 @@ window.SlaveInteractFertility = function(slave) { }, [] ); - fertilityblock.append(link); + control.append(link); } } + fertilityblock.append(control); } return jQuery('#fertilityblock').empty().append(fertilityblock); }; diff --git a/src/uncategorized/slaveInteract.tw b/src/uncategorized/slaveInteract.tw index c98a9ec76304119eb438db5929b289626dfa7265..37be88ef217ac256bde60397dbe84187303ac727 100644 --- a/src/uncategorized/slaveInteract.tw +++ b/src/uncategorized/slaveInteract.tw @@ -909,6 +909,7 @@ Aphrodisiacs: <span id="aphrodisiacs"><strong><<if $activeSlave.aphrodisiacs > 1 | <<link "Anaphrodisiacs">><<set $activeSlave.aphrodisiacs = -1>><<replace "#aphrodisiacs">><strong>anaphrodisiacs</strong><</replace>><</link>> <br> <span id="fertilityblock"></span> +<script>SlaveInteractFertility(V.activeSlave)</script> <<set $reservedChildren = FetusGlobalReserveCount("incubator")>> <<set $reservedChildrenNursery = FetusGlobalReserveCount("nursery")>> <<set _reservedIncubator = WombReserveCount($activeSlave, "incubator")>> @@ -1025,23 +1026,9 @@ Aphrodisiacs: <span id="aphrodisiacs"><strong><<if $activeSlave.aphrodisiacs > 1 <</if>> <</if>> -<span id="bloating"> -<<if $activeSlave.inflation > 0>> - <br> - __Required Bloating__: <strong><span id="inflate"><<if $activeSlave.inflation == 3>><<print "$He is required to keep 2 gallons of $activeSlave.inflationType in $him at all times">><<elseif $activeSlave.inflation == 2>><<print "$He is required to keep 4 liters of $activeSlave.inflationType in $him at all times">><<elseif $activeSlave.inflation == 1>><<print "$He is required to keep 2 liters of $activeSlave.inflationType in $him at all times">><</if>></span></strong>. - <<if $activeSlave.inflationMethod == 3>> - <<link "Let $him deflate">><<set $activeSlave.inflation = 0,$activeSlave.inflationType = "none",$activeSlave.inflationMethod = 0,$activeSlave.cumSource = 0,$activeSlave.milkSource = 0, SetBellySize($activeSlave)>><<SlaveInteractImpreg>><<SlaveInteractFertility>><</link>> - <<elseif $activeSlave.inflationType == "milk">> - <<link "Let $him deflate">><<set $activeSlave.inflation = 0,$activeSlave.inflationType = "none",$activeSlave.inflationMethod = 0, SetBellySize($activeSlave)>><<SlaveInteractImpreg>><<SlaveInteractFertility>><</link>> - <<elseif $activeSlave.inflationType == "cum">> - <<link "Let $him deflate">><<set $activeSlave.inflation = 0,$activeSlave.inflationType = "none",$activeSlave.inflationMethod = 0, SetBellySize($activeSlave)>><<SlaveInteractImpreg>><<SlaveInteractFertility>><</link>> - <<else>> - <<link "Let $him deflate">><<set $activeSlave.inflation = 0,$activeSlave.inflationType = "none",$activeSlave.inflationMethod = 0, SetBellySize($activeSlave)>><<SlaveInteractImpreg>><<SlaveInteractFertility>><</link>> - <</if>> -<</if>> -</span> +<span id="bloating"></span> +<script>SlaveInteractImpreg(V.activeSlave)</script> -<br> Hormones: <strong><span id="hormones"> <<if $activeSlave.hormones == -2>>intensive male<<elseif $activeSlave.hormones == -1>>male<<elseif $activeSlave.hormones == 2>>intensive female<<elseif $activeSlave.hormones == 1>>female<<else>>none<</if>></span></strong>. <<if $activeSlave.indentureRestrictions < 2>>