diff --git a/src/interaction/siCustom.js b/src/interaction/siCustom.js index 66754c49fbbd36f3442515492c7268b7e2a63002..58e24f5c841a2772c509e77557282944e7e872b9 100644 --- a/src/interaction/siCustom.js +++ b/src/interaction/siCustom.js @@ -1,763 +1,757 @@ App.UI.SlaveInteract.custom = function(slave) { - const el = document.createElement("p"); - el.id = "si-custom"; - el.append(custom()); - return el; - - function custom() { - const { - He, His, - he, his, him, - } = getPronouns(slave); + const { + He, His, + he, his, him, + } = getPronouns(slave); - const el = document.createElement('div'); + const el = document.createElement('div'); - el.appendChild(intro()); + el.appendChild(intro()); - App.UI.DOM.appendNewElement("h3", el, `Art`); - el.appendChild(customSlaveImage()); - el.appendChild(customHairImage()); + App.UI.DOM.appendNewElement("h3", el, `Art`); + el.appendChild(customSlaveImage()); + el.appendChild(customHairImage()); - App.UI.DOM.appendNewElement("h3", el, `Names`); - el.appendChild(playerTitle()); - el.appendChild(slaveFullName()); + App.UI.DOM.appendNewElement("h3", el, `Names`); + el.appendChild(playerTitle()); + el.appendChild(slaveFullName()); - App.UI.DOM.appendNewElement("h3", el, `Description`); - el.appendChild(hair()); - el.appendChild(eyeColor()); - el.appendChild(customTattoo()); - el.appendChild(customOriginStory()); - el.appendChild(customDescription()); - el.appendChild(customLabel()); + App.UI.DOM.appendNewElement("h3", el, `Description`); + el.appendChild(hair()); + el.appendChild(eyeColor()); + el.appendChild(customTattoo()); + el.appendChild(customOriginStory()); + el.appendChild(customDescription()); + el.appendChild(customLabel()); - return el; + return el; - function intro() { - const frag = new DocumentFragment(); - let p; - p = document.createElement('p'); - p.id = "rename"; - frag.append(p); - - p = document.createElement('p'); - p.className = "scene-p"; - p.append(`You may enter custom descriptors for your slave's hair color, hair style, tattoos, or anything else here. After typing, press `); - p.appendChild(App.UI.DOM.makeElement("kbd", "enter")); - p.append(` to commit your change. These custom descriptors will appear in descriptions of your slave, but will have no gameplay effect. Changing them is free.`); - frag.append(p); - return frag; - } + function intro() { + const frag = new DocumentFragment(); + let p; + p = document.createElement('p'); + p.id = "rename"; + frag.append(p); + + p = document.createElement('p'); + p.className = "scene-p"; + p.append(`You may enter custom descriptors for your slave's hair color, hair style, tattoos, or anything else here. After typing, press `); + p.appendChild(App.UI.DOM.makeElement("kbd", "enter")); + p.append(` to commit your change. These custom descriptors will appear in descriptions of your slave, but will have no gameplay effect. Changing them is free.`); + frag.append(p); + return frag; + } - function playerTitle() { - let playerTitle = document.createElement('p'); - const label = document.createElement('div'); - let result; - if (slave.devotion >= -50) { - if (slave.custom.title !== "") { - label.textContent = `You have instructed ${him} to always refer to you as ${slave.custom.title}, which, should ${he} lisp, comes out as ${slave.custom.titleLisp}.`; - } else { - label.textContent = `You expect ${him} to refer to you as all your other slaves do.`; - } - result = document.createElement('div'); - result.id = "result"; - result.className = "choices"; - - let hiddenTextBox = document.createElement('span'); - let shownTextBox = document.createElement('span'); - if (slave.custom.title === "") { - hiddenTextBox.appendChild( - App.UI.DOM.link( - `Set a custom title for ${him} to address you as`, - () => { - jQuery('#result').empty().append(shownTextBox); - } - ) - ); - result.appendChild(hiddenTextBox); - shownTextBox.textContent = `Custom title: `; - shownTextBox.append( - App.UI.DOM.makeTextBox( - "", - v => { - slave.custom.title = v; - jQuery('#result').empty().append( - document.createTextNode(`${He}'ll try ${his} best to call you ${slave.custom.title}.`) - ); - slave.custom.titleLisp = lispReplace(slave.custom.title); - } - ) - ); - } else { - result.append(`${He}'s trying ${his} best to call you `); - result.append( - App.UI.DOM.makeTextBox( - slave.custom.title, - v => { - slave.custom.title = v; - jQuery('#result').empty().append( - document.createTextNode(`${He}'ll try ${his} best to call you ${slave.custom.title}.`) - ); - slave.custom.titleLisp = lispReplace(slave.custom.title); - } - ) - ); - result.appendChild( - App.UI.DOM.link( - ` Stop using a custom title`, - () => { - jQuery('#result').empty().append( - document.createTextNode(`${He} will no longer refer to you with a special title.`) - ); - slave.custom.title = ""; - slave.custom.titleLisp = ""; - } - ) - ); + function playerTitle() { + let playerTitle = document.createElement('p'); + const label = document.createElement('div'); + let result; + if (slave.devotion >= -50) { + if (slave.custom.title !== "") { + label.textContent = `You have instructed ${him} to always refer to you as ${slave.custom.title}, which, should ${he} lisp, comes out as ${slave.custom.titleLisp}.`; + } else { + label.textContent = `You expect ${him} to refer to you as all your other slaves do.`; + } + result = document.createElement('div'); + result.id = "result"; + result.className = "choices"; + + let hiddenTextBox = document.createElement('span'); + let shownTextBox = document.createElement('span'); + if (slave.custom.title === "") { + hiddenTextBox.appendChild( + App.UI.DOM.link( + `Set a custom title for ${him} to address you as`, + () => { + jQuery('#result').empty().append(shownTextBox); + } + ) + ); + result.appendChild(hiddenTextBox); + shownTextBox.textContent = `Custom title: `; + shownTextBox.append( + App.UI.DOM.makeTextBox( + "", + v => { + slave.custom.title = v; + jQuery('#result').empty().append( + document.createTextNode(`${He}'ll try ${his} best to call you ${slave.custom.title}.`) + ); + slave.custom.titleLisp = lispReplace(slave.custom.title); + } + ) + ); + } else { + result.append(`${He}'s trying ${his} best to call you `); + result.append( + App.UI.DOM.makeTextBox( + slave.custom.title, + v => { + slave.custom.title = v; + jQuery('#result').empty().append( + document.createTextNode(`${He}'ll try ${his} best to call you ${slave.custom.title}.`) + ); + slave.custom.titleLisp = lispReplace(slave.custom.title); + } + ) + ); + result.appendChild( + App.UI.DOM.link( + ` Stop using a custom title`, + () => { + jQuery('#result').empty().append( + document.createTextNode(`${He} will no longer refer to you with a special title.`) + ); + slave.custom.title = ""; + slave.custom.titleLisp = ""; + } + ) + ); + } + label.appendChild(result); + } else { + label.textContent = `You must break ${his} will further before ${he} will refer to you by a new title. `; + if (SlaveStatsChecker.checkForLisp(slave)) { + if (slave.custom.titleLisp && slave.custom.titleLisp !== "") { + label.textContent += `For now, ${he} intends to keep calling you "${slave.custom.titleLisp}."`; } - label.appendChild(result); } else { - label.textContent = `You must break ${his} will further before ${he} will refer to you by a new title. `; - if (SlaveStatsChecker.checkForLisp(slave)) { - if (slave.custom.titleLisp && slave.custom.titleLisp !== "") { - label.textContent += `For now, ${he} intends to keep calling you "${slave.custom.titleLisp}."`; - } - } else { - if (slave.custom.title && slave.custom.title !== "") { - label.textContent += `For now, ${he} intends to keep calling you "${slave.custom.title}."`; - } + if (slave.custom.title && slave.custom.title !== "") { + label.textContent += `For now, ${he} intends to keep calling you "${slave.custom.title}."`; } } - playerTitle.appendChild(label); - return playerTitle; } + playerTitle.appendChild(label); + return playerTitle; + } - function slaveFullName() { - let slaveFullNameNode = document.createElement('span'); - if ( - ((slave.devotion >= -50 || slave.trust < -20) && (slave.birthName !== slave.slaveName)) || + function slaveFullName() { + let slaveFullNameNode = document.createElement('span'); + if ( + ((slave.devotion >= -50 || slave.trust < -20) && (slave.birthName !== slave.slaveName)) || (slave.devotion > 20 || slave.trust < -20) - ) { - slaveFullNameNode.appendChild(slaveName()); - slaveFullNameNode.appendChild(slaveSurname()); - } else { - slaveFullNameNode.textContent = `You must break ${his} will further before you can successfully force a new name on ${him}.`; - slaveFullNameNode.className = "note"; - } + ) { + slaveFullNameNode.appendChild(slaveName()); + slaveFullNameNode.appendChild(slaveSurname()); + } else { + slaveFullNameNode.textContent = `You must break ${his} will further before you can successfully force a new name on ${him}.`; + slaveFullNameNode.className = "note"; + } - return slaveFullNameNode; - - function slaveName() { - const oldName = slave.slaveName; - const oldSurname = slave.slaveSurname; - // Slave Name - let slaveNameNode = document.createElement('p'); - let label = document.createElement('div'); - let result = document.createElement('div'); - result.id = "result"; - result.className = "choices"; - const linkArray = []; - - label.append(`Change ${his} given name`); - if (slave.birthName !== slave.slaveName) { - label.append(` (${his} birth name was ${slave.birthName})`); - } - label.append(`: `); + return slaveFullNameNode; - label.append( - App.UI.DOM.makeTextBox( - slave.slaveName, - v => { - slave.slaveName = v; - updateName(slave, {oldName: oldName, oldSurname: oldSurname}); - }, - false, - ) - ); + function slaveName() { + const oldName = slave.slaveName; + const oldSurname = slave.slaveSurname; + // Slave Name + let slaveNameNode = document.createElement('p'); + let label = document.createElement('div'); + let result = document.createElement('div'); + result.id = "result"; + result.className = "choices"; + const linkArray = []; + + label.append(`Change ${his} given name`); + if (slave.birthName !== slave.slaveName) { + label.append(` (${his} birth name was ${slave.birthName})`); + } + label.append(`: `); - slaveNameNode.appendChild(label); + label.append( + App.UI.DOM.makeTextBox( + slave.slaveName, + v => { + slave.slaveName = v; + updateName(slave, {oldName: oldName, oldSurname: oldSurname}); + }, + false, + ) + ); - if (slave.slaveName === slave.birthName) { - linkArray.push(App.UI.DOM.disabledLink(`${He} has ${his} birth name`, [`Nothing to reset`])); - } else { - linkArray.push(App.UI.DOM.link( - `Restore ${his} birth name`, - () => { - slave.slaveName = slave.birthName; - updateName(slave, {oldName: oldName, oldSurname: oldSurname}); - }, - false, - )); - } + slaveNameNode.appendChild(label); - if (V.arcologies[0].FSPastoralist !== "unset") { - if (slave.lactation > 0) { - linkArray.push(chooseThreeNames(`Choose a random cow name for ${him}`, setup.cowSlaveNames, "cow-names")); - } - } - if (V.arcologies[0].FSIntellectualDependency !== "unset") { - if (slave.intelligence + slave.intelligenceImplant < -10) { - linkArray.push(chooseThreeNames(`Give ${him} a random stripper given name`, setup.bimboSlaveNames, "bimbo-names")); - } + if (slave.slaveName === slave.birthName) { + linkArray.push(App.UI.DOM.disabledLink(`${He} has ${his} birth name`, [`Nothing to reset`])); + } else { + linkArray.push(App.UI.DOM.link( + `Restore ${his} birth name`, + () => { + slave.slaveName = slave.birthName; + updateName(slave, {oldName: oldName, oldSurname: oldSurname}); + }, + false, + )); + } + + if (V.arcologies[0].FSPastoralist !== "unset") { + if (slave.lactation > 0) { + linkArray.push(chooseThreeNames(`Choose a random cow name for ${him}`, setup.cowSlaveNames, "cow-names")); } - if (V.arcologies[0].FSChattelReligionist !== "unset") { - linkArray.push(chooseThreeNames(`Give ${him} a random devotional given name`, setup.chattelReligionistSlaveNames, "devotional-names")); + } + if (V.arcologies[0].FSIntellectualDependency !== "unset") { + if (slave.intelligence + slave.intelligenceImplant < -10) { + linkArray.push(chooseThreeNames(`Give ${him} a random stripper given name`, setup.bimboSlaveNames, "bimbo-names")); } - result.append(App.UI.DOM.generateLinksStrip(linkArray)); - slaveNameNode.appendChild(result); - return slaveNameNode; - - function chooseThreeNames(title, array, id) { - const el = document.createElement("span"); - el.id = id; - el.append( - App.UI.DOM.link( - title, - () => { - linkGuts(); - } - ) - ); - return el; - function linkGuts() { - // Randomize the array - const shuffled = array.sort(() => 0.5 - Math.random()); - - // Get the first three new names - const names = []; - for (let i = 0; names.length < 3; i++) { - if (i > shuffled.length) { - break; - } - if (shuffled[i] !== slave.slaveName) { - names.push(shuffled[i]); - } + } + if (V.arcologies[0].FSChattelReligionist !== "unset") { + linkArray.push(chooseThreeNames(`Give ${him} a random devotional given name`, setup.chattelReligionistSlaveNames, "devotional-names")); + } + result.append(App.UI.DOM.generateLinksStrip(linkArray)); + slaveNameNode.appendChild(result); + return slaveNameNode; + + function chooseThreeNames(title, array, id) { + const el = document.createElement("span"); + el.id = id; + el.append( + App.UI.DOM.link( + title, + () => { + linkGuts(); } - - // return the three names as links - const nameLinks = []; - for (const name of names) { - nameLinks.push( - App.UI.DOM.link( - name, - () => { - slave.slaveName = name; - updateName(slave, {oldName: oldName, oldSurname: oldSurname}); - } - ) - ); + ) + ); + return el; + function linkGuts() { + // Randomize the array + const shuffled = array.sort(() => 0.5 - Math.random()); + + // Get the first three new names + const names = []; + for (let i = 0; names.length < 3; i++) { + if (i > shuffled.length) { + break; + } + if (shuffled[i] !== slave.slaveName) { + names.push(shuffled[i]); } + } + + // return the three names as links + const nameLinks = []; + for (const name of names) { nameLinks.push( App.UI.DOM.link( - "...", + name, () => { - linkGuts(); + slave.slaveName = name; + updateName(slave, {oldName: oldName, oldSurname: oldSurname}); } ) ); - jQuery(`#${id}`).empty().append(App.UI.DOM.generateLinksStrip(nameLinks)); } + nameLinks.push( + App.UI.DOM.link( + "...", + () => { + linkGuts(); + } + ) + ); + jQuery(`#${id}`).empty().append(App.UI.DOM.generateLinksStrip(nameLinks)); } } + } - function slaveSurname() { - // Slave Surname - const oldName = slave.slaveName; - const oldSurname = slave.slaveSurname; - const linkArray = []; - let slaveSurnameNode = document.createElement('p'); - let label = document.createElement('div'); - let result = document.createElement('div'); - result.id = "result"; - result.className = "choices"; - - label.append(`Change ${his} surname`); - if (slave.birthSurname !== slave.slaveSurname) { - label.append(` (${his} birth surname was ${slave.birthSurname})`); - } - label.append(`: `); + function slaveSurname() { + // Slave Surname + const oldName = slave.slaveName; + const oldSurname = slave.slaveSurname; + const linkArray = []; + let slaveSurnameNode = document.createElement('p'); + let label = document.createElement('div'); + let result = document.createElement('div'); + result.id = "result"; + result.className = "choices"; - label.append( - App.UI.DOM.makeTextBox( - slave.slaveSurname, - v => { - slave.slaveSurname = v; - updateName(slave, {oldName: oldName, oldSurname: oldSurname}); - }, - false, - ) - ); + label.append(`Change ${his} surname`); + if (slave.birthSurname !== slave.slaveSurname) { + label.append(` (${his} birth surname was ${slave.birthSurname})`); + } + label.append(`: `); - slaveSurnameNode.appendChild(label); + label.append( + App.UI.DOM.makeTextBox( + slave.slaveSurname, + v => { + slave.slaveSurname = v; + updateName(slave, {oldName: oldName, oldSurname: oldSurname}); + }, + false, + ) + ); - if (slave.slaveSurname === slave.birthSurname) { - linkArray.push( - App.UI.DOM.disabledLink( - `Restore ${his} birth surname`, - [`${He} has ${his} birth surname`] - ) - ); - } else { - linkArray.push(App.UI.DOM.link( - ` Restore ${his} birth surname`, - () => { - slave.slaveSurname = slave.birthSurname; - updateName(slave, {oldName: oldName, oldSurname: oldSurname}); - }, - false, - )); - } + slaveSurnameNode.appendChild(label); - if (slave.slaveSurname) { - linkArray.push(App.UI.DOM.link( - `Take ${his} surname away`, - () => { - slave.slaveSurname = 0; - updateName(slave, {oldName: oldName, oldSurname: oldSurname}); - }, - false, - )); - } - if (slave.relationship >= 5) { - const spouse = getSlave(slave.relationshipTarget); - if (spouse.slaveSurname && slave.slaveSurname !== spouse.slaveSurname) { - const wifePronouns = getPronouns(spouse); - linkArray.push( - App.UI.DOM.link( - `Give ${him} ${his} ${wifePronouns.wife}'s surname`, - () => { - slave.slaveSurname = spouse.slaveSurname; - updateName(slave, {oldName: oldName, oldSurname: oldSurname}); - }, - false, - ) - ); - } - } - if (slave.relationship === -3) { - if (V.PC.slaveSurname && slave.slaveSurname !== V.PC.slaveSurname) { - linkArray.push( - App.UI.DOM.link( - `Give ${him} your surname`, - () => { - slave.slaveSurname = V.PC.slaveSurname; - updateName(slave, {oldName: oldName, oldSurname: oldSurname}); - }, - false, - ) - ); - } - } - if (V.arcologies[0].FSRomanRevivalist !== "unset") { - linkArray.push( - App.UI.DOM.link( - `Give ${him} a random full Roman name`, - () => { - slave.slaveName = setup.romanSlaveNames.random(); - slave.slaveSurname = setup.romanSlaveSurnames.random(); - updateName(slave, {oldName: oldName, oldSurname: oldSurname}); - }, - false, - ) - ); - } else if (V.arcologies[0].FSAztecRevivalist !== "unset") { - linkArray.push( - App.UI.DOM.link( - `Give ${him} a random full Aztec name`, - () => { - slave.slaveName = setup.aztecSlaveNames.random(); - slave.slaveSurname = 0; - updateName(slave, {oldName: oldName, oldSurname: oldSurname}); - }, - false, - ) - ); - } else if (V.arcologies[0].FSEgyptianRevivalist !== "unset") { - linkArray.push( - App.UI.DOM.link( - `Give ${him} a random full ancient Egyptian name`, - () => { - slave.slaveName = setup.ancientEgyptianSlaveNames.random(); - slave.slaveSurname = 0; - updateName(slave, {oldName: oldName, oldSurname: oldSurname}); - }, - false, - ) - ); - } else if (V.arcologies[0].FSEdoRevivalist !== "unset") { + if (slave.slaveSurname === slave.birthSurname) { + linkArray.push( + App.UI.DOM.disabledLink( + `Restore ${his} birth surname`, + [`${He} has ${his} birth surname`] + ) + ); + } else { + linkArray.push(App.UI.DOM.link( + ` Restore ${his} birth surname`, + () => { + slave.slaveSurname = slave.birthSurname; + updateName(slave, {oldName: oldName, oldSurname: oldSurname}); + }, + false, + )); + } + + if (slave.slaveSurname) { + linkArray.push(App.UI.DOM.link( + `Take ${his} surname away`, + () => { + slave.slaveSurname = 0; + updateName(slave, {oldName: oldName, oldSurname: oldSurname}); + }, + false, + )); + } + if (slave.relationship >= 5) { + const spouse = getSlave(slave.relationshipTarget); + if (spouse.slaveSurname && slave.slaveSurname !== spouse.slaveSurname) { + const wifePronouns = getPronouns(spouse); linkArray.push( App.UI.DOM.link( - `Give ${him} a random full feudal Japanese name`, + `Give ${him} ${his} ${wifePronouns.wife}'s surname`, () => { - slave.slaveName = setup.edoSlaveNames.random(); - slave.slaveSurname = setup.edoSlaveSurnames.random(); + slave.slaveSurname = spouse.slaveSurname; updateName(slave, {oldName: oldName, oldSurname: oldSurname}); }, false, ) ); } - if (V.arcologies[0].FSDegradationist > -1) { + } + if (slave.relationship === -3) { + if (V.PC.slaveSurname && slave.slaveSurname !== V.PC.slaveSurname) { linkArray.push( App.UI.DOM.link( - `Give ${him} a degrading full name`, + `Give ${him} your surname`, () => { - DegradingName(slave); + slave.slaveSurname = V.PC.slaveSurname; updateName(slave, {oldName: oldName, oldSurname: oldSurname}); }, false, ) ); } - result.append(App.UI.DOM.generateLinksStrip(linkArray)); - slaveSurnameNode.appendChild(result); - return slaveSurnameNode; } - function updateName(slave, {oldName: oldName, oldSurname: oldSurname}) { - App.UI.SlaveInteract.rename(slave, {oldName: oldName, oldSurname: oldSurname}); - refresh(); - } - } - - function hair() { - let hairNode = new DocumentFragment(); - hairNode.appendChild(hairStyle()); - hairNode.appendChild(hairColor()); - return hairNode; - - function hairStyle() { - let hairStyleNode = document.createElement('p'); - let label = document.createElement('div'); - label.append(`Custom hair description: `); - - label.append( - App.UI.DOM.makeTextBox( - slave.hStyle, - v => { - slave.hStyle = v; - refresh(); - } + if (V.arcologies[0].FSRomanRevivalist !== "unset") { + linkArray.push( + App.UI.DOM.link( + `Give ${him} a random full Roman name`, + () => { + slave.slaveName = setup.romanSlaveNames.random(); + slave.slaveSurname = setup.romanSlaveSurnames.random(); + updateName(slave, {oldName: oldName, oldSurname: oldSurname}); + }, + false, ) ); - - switch (slave.hStyle) { - case "tails": - case "dreadlocks": - case "cornrows": - label.append(` "${His} hair is in ${slave.hStyle}."`); - break; - case "ponytail": - label.append(` "${His} hair is in a ${slave.hStyle}."`); - break; - default: - label.append(` "${His} hair is ${slave.hStyle}."`); - break; - } - hairStyleNode.appendChild(label); - - let choices = document.createElement('div'); - choices.className = "choices"; - choices.appendChild(App.UI.DOM.makeElement('span', ` For best results, use a short, uncapitalized and unpunctuated description; for example: 'back in a ponytail'`, 'note')); - hairStyleNode.appendChild(choices); - return hairStyleNode; - } - - function hairColor() { - let hairStyleNode = document.createElement('p'); - let label = document.createElement('div'); - label.append(`Custom hair color: `); - label.append( - App.UI.DOM.makeTextBox( - slave.hColor, - v => { - slave.hColor = v; - refresh(); - } + } else if (V.arcologies[0].FSAztecRevivalist !== "unset") { + linkArray.push( + App.UI.DOM.link( + `Give ${him} a random full Aztec name`, + () => { + slave.slaveName = setup.aztecSlaveNames.random(); + slave.slaveSurname = 0; + updateName(slave, {oldName: oldName, oldSurname: oldSurname}); + }, + false, ) ); - label.append(` "${His} hair is ${slave.hColor}."`); - hairStyleNode.appendChild(label); - - let choices = document.createElement('div'); - choices.className = "choices"; - choices.appendChild(App.UI.DOM.makeElement('span', ` For best results, use a short, uncapitalized and unpunctuated description; for example: 'black with purple highlights'`, 'note')); - hairStyleNode.appendChild(choices); - return hairStyleNode; - } - } - - function eyeColor() { - let eyeColorNode = document.createElement('p'); - let label = document.createElement('div'); - if (getLenseCount(slave) > 0) { - label.textContent = `${He} is wearing ${App.Desc.eyesColor(slave, "", "lense", "lenses")}.`; - } else { - label.textContent = `${He} has ${App.Desc.eyesColor(slave)}.`; - } - eyeColorNode.appendChild(label); - - let choices = document.createElement('div'); - choices.className = "choices"; - - let eye; - - if (hasLeftEye(slave)) { - eye = document.createElement('div'); - eye.append(`Custom left eye color: `); - eye.append( - App.UI.DOM.makeTextBox( - slave.eye.left.iris, - v => { - slave.eye.left.iris = v; - refresh(); - } + } else if (V.arcologies[0].FSEgyptianRevivalist !== "unset") { + linkArray.push( + App.UI.DOM.link( + `Give ${him} a random full ancient Egyptian name`, + () => { + slave.slaveName = setup.ancientEgyptianSlaveNames.random(); + slave.slaveSurname = 0; + updateName(slave, {oldName: oldName, oldSurname: oldSurname}); + }, + false, + ) + ); + } else if (V.arcologies[0].FSEdoRevivalist !== "unset") { + linkArray.push( + App.UI.DOM.link( + `Give ${him} a random full feudal Japanese name`, + () => { + slave.slaveName = setup.edoSlaveNames.random(); + slave.slaveSurname = setup.edoSlaveSurnames.random(); + updateName(slave, {oldName: oldName, oldSurname: oldSurname}); + }, + false, ) ); - choices.appendChild(eye); } - if (hasRightEye(slave)) { - eye = document.createElement('div'); - eye.append(`Custom right eye color: `); - eye.append( - App.UI.DOM.makeTextBox( - slave.eye.right.iris, - v => { - slave.eye.right.iris = v; - refresh(); - } + if (V.arcologies[0].FSDegradationist > -1) { + linkArray.push( + App.UI.DOM.link( + `Give ${him} a degrading full name`, + () => { + DegradingName(slave); + updateName(slave, {oldName: oldName, oldSurname: oldSurname}); + }, + false, ) ); - choices.appendChild(eye); } - choices.appendChild(App.UI.DOM.makeElement('span', `For best results, use a short, uncapitalized and unpunctuated description; for example: 'blue'`, 'note')); - eyeColorNode.appendChild(choices); - return eyeColorNode; + result.append(App.UI.DOM.generateLinksStrip(linkArray)); + slaveSurnameNode.appendChild(result); + return slaveSurnameNode; + } + function updateName(slave, {oldName: oldName, oldSurname: oldSurname}) { + App.UI.SlaveInteract.rename(slave, {oldName: oldName, oldSurname: oldSurname}); + refresh(); } + } - function customTattoo() { - let el = document.createElement('p'); - el.append(`Change ${his} custom tattoo: `); - el.appendChild(App.UI.DOM.makeTextBox( - slave.custom.tattoo, - v => { - slave.custom.tattoo = v; - refresh(); - })); + function hair() { + let hairNode = new DocumentFragment(); + hairNode.appendChild(hairStyle()); + hairNode.appendChild(hairColor()); + return hairNode; - let choices = document.createElement('div'); - choices.className = "choices"; - choices.appendChild(App.UI.DOM.makeElement('span', `For best results, use complete sentences; for example: '${He} has blue stars tattooed along ${his} cheekbones.'`, 'note')); - el.appendChild(choices); + function hairStyle() { + let hairStyleNode = document.createElement('p'); + let label = document.createElement('div'); + label.append(`Custom hair description: `); - return el; - } + label.append( + App.UI.DOM.makeTextBox( + slave.hStyle, + v => { + slave.hStyle = v; + refresh(); + } + ) + ); - function customOriginStory() { - let el = document.createElement('p'); - el.append(`Change ${his} origin story: `); - el.appendChild(App.UI.DOM.makeTextBox( - slave.origin, - v => { - slave.origin = v; - refresh(); - })); + switch (slave.hStyle) { + case "tails": + case "dreadlocks": + case "cornrows": + label.append(` "${His} hair is in ${slave.hStyle}."`); + break; + case "ponytail": + label.append(` "${His} hair is in a ${slave.hStyle}."`); + break; + default: + label.append(` "${His} hair is ${slave.hStyle}."`); + break; + } + hairStyleNode.appendChild(label); let choices = document.createElement('div'); choices.className = "choices"; - choices.appendChild(App.UI.DOM.makeElement('span', ` For best results, use complete, capitalized and punctuated sentences; for example: '${He} followed you home from the pet store.'`, 'note')); - el.appendChild(choices); - - return el; + choices.appendChild(App.UI.DOM.makeElement('span', ` For best results, use a short, uncapitalized and unpunctuated description; for example: 'back in a ponytail'`, 'note')); + hairStyleNode.appendChild(choices); + return hairStyleNode; } - function customDescription() { - let el = document.createElement('p'); - el.append(`Change ${his} custom description: `); - el.appendChild( + function hairColor() { + let hairStyleNode = document.createElement('p'); + let label = document.createElement('div'); + label.append(`Custom hair color: `); + label.append( App.UI.DOM.makeTextBox( - pronounsForSlaveProp(slave, slave.custom.desc), + slave.hColor, v => { - slave.custom.desc = v; + slave.hColor = v; refresh(); } ) ); + label.append(` "${His} hair is ${slave.hColor}."`); + hairStyleNode.appendChild(label); let choices = document.createElement('div'); choices.className = "choices"; - choices.appendChild(App.UI.DOM.makeElement('span', ` For best results, use complete, capitalized and punctuated sentences; for example: '${He} has a beauty mark above ${his} left nipple.'`, 'note')); - el.appendChild(choices); + choices.appendChild(App.UI.DOM.makeElement('span', ` For best results, use a short, uncapitalized and unpunctuated description; for example: 'black with purple highlights'`, 'note')); + hairStyleNode.appendChild(choices); + return hairStyleNode; + } + } - return el; + function eyeColor() { + let eyeColorNode = document.createElement('p'); + let label = document.createElement('div'); + if (getLenseCount(slave) > 0) { + label.textContent = `${He} is wearing ${App.Desc.eyesColor(slave, "", "lense", "lenses")}.`; + } else { + label.textContent = `${He} has ${App.Desc.eyesColor(slave)}.`; } + eyeColorNode.appendChild(label); - function customLabel() { - let el = document.createElement('p'); - el.append(`Change ${his} custom label: `); - el.appendChild(App.UI.DOM.makeTextBox( - slave.custom.label, - v => { - slave.custom.label = v; - refresh(); - })); + let choices = document.createElement('div'); + choices.className = "choices"; - let choices = document.createElement('div'); - choices.className = "choices"; - choices.appendChild(App.UI.DOM.makeElement('span', ` For best results, use a short phrase; for example: 'Breeder.'`, 'note')); - el.appendChild(choices); + let eye; - return el; + if (hasLeftEye(slave)) { + eye = document.createElement('div'); + eye.append(`Custom left eye color: `); + eye.append( + App.UI.DOM.makeTextBox( + slave.eye.left.iris, + v => { + slave.eye.left.iris = v; + refresh(); + } + ) + ); + choices.appendChild(eye); } - - function customSlaveImage() { - let el = document.createElement('p'); - el.append(`Assign ${him} a custom image: `); - - const textbox = document.createElement("INPUT"); - textbox.id = "customImageValue"; - el.appendChild(textbox); - - - let kbd = document.createElement('kbd'); - let select = document.createElement('SELECT'); - select.id = "customImageFormatSelector"; - select.style.border = "none"; - - let filetypes = [ - "png", - "jpg", - "gif", - "webm", - "webp", - "mp4" - ]; - - filetypes.forEach((fileType) => { - let el = document.createElement('OPTION'); - el.value = fileType; - el.text = fileType.toUpperCase(); - select.add(el); - }); - kbd.append(`.`); - kbd.appendChild(select); - el.appendChild(kbd); - - el.appendChild( - App.UI.DOM.link( - ` Reset`, - () => { - slave.custom.image = null; + if (hasRightEye(slave)) { + eye = document.createElement('div'); + eye.append(`Custom right eye color: `); + eye.append( + App.UI.DOM.makeTextBox( + slave.eye.right.iris, + v => { + slave.eye.right.iris = v; refresh(); - App.Art.refreshSlaveArt(slave, 3, "art-frame"); - }, + } ) ); + choices.appendChild(eye); + } + choices.appendChild(App.UI.DOM.makeElement('span', `For best results, use a short, uncapitalized and unpunctuated description; for example: 'blue'`, 'note')); + eyeColorNode.appendChild(choices); + return eyeColorNode; + } - let choices = document.createElement('div'); - choices.className = "choices"; - let note = document.createElement('span'); - note.className = "note"; - note.append(`Place file in the `); + function customTattoo() { + let el = document.createElement('p'); + el.append(`Change ${his} custom tattoo: `); + el.appendChild(App.UI.DOM.makeTextBox( + slave.custom.tattoo, + v => { + slave.custom.tattoo = v; + refresh(); + })); - kbd = document.createElement('kbd'); - kbd.append(`resources`); - note.appendChild(kbd); + let choices = document.createElement('div'); + choices.className = "choices"; + choices.appendChild(App.UI.DOM.makeElement('span', `For best results, use complete sentences; for example: '${He} has blue stars tattooed along ${his} cheekbones.'`, 'note')); + el.appendChild(choices); - note.append(` folder. Choose the extension from the menu first, then enter the filename in the space and press enter. For example, for a file with the path `); + return el; + } - kbd = document.createElement('kbd'); - kbd.textContent = `\\bin\\resources\\headgirl.`; - let filetypeDesc = document.createElement('span'); - filetypeDesc.id = "customImageFormatValue"; - filetypeDesc.textContent = "png"; - kbd.appendChild(filetypeDesc); - note.appendChild(kbd); + function customOriginStory() { + let el = document.createElement('p'); + el.append(`Change ${his} origin story: `); + el.appendChild(App.UI.DOM.makeTextBox( + slave.origin, + v => { + slave.origin = v; + refresh(); + })); - note.append(`, choose `); + let choices = document.createElement('div'); + choices.className = "choices"; + choices.appendChild(App.UI.DOM.makeElement('span', ` For best results, use complete, capitalized and punctuated sentences; for example: '${He} followed you home from the pet store.'`, 'note')); + el.appendChild(choices); - kbd = document.createElement('kbd'); - kbd.textContent = `PNG`; - note.appendChild(kbd); + return el; + } - note.append(` then enter `); + function customDescription() { + let el = document.createElement('p'); + el.append(`Change ${his} custom description: `); + el.appendChild( + App.UI.DOM.makeTextBox( + pronounsForSlaveProp(slave, slave.custom.desc), + v => { + slave.custom.desc = v; + refresh(); + } + ) + ); - kbd = document.createElement('kbd'); - kbd.textContent = `headgirl`; - note.appendChild(kbd); + let choices = document.createElement('div'); + choices.className = "choices"; + choices.appendChild(App.UI.DOM.makeElement('span', ` For best results, use complete, capitalized and punctuated sentences; for example: '${He} has a beauty mark above ${his} left nipple.'`, 'note')); + el.appendChild(choices); - note.append(`.`); - choices.appendChild(note); - el.appendChild(choices); + return el; + } - jQuery(function() { - function activeSlave() { - return slave; - } + function customLabel() { + let el = document.createElement('p'); + el.append(`Change ${his} custom label: `); + el.appendChild(App.UI.DOM.makeTextBox( + slave.custom.label, + v => { + slave.custom.label = v; + refresh(); + })); - jQuery("#customImageFormatValue").text(activeSlave().custom.image === null ? "png" : activeSlave().custom.image.format); - jQuery("#customImageValue") - .val(activeSlave().custom.image === null ? - "" : activeSlave().custom.image.filename) - .on("change", function(e) { - const c = activeSlave().custom; - if (this.value.length === 0) { - c.image = null; - } else { - if (c.image === null) { - c.image = { - filename: this.value, - format: jQuery("#customImageFormatSelector").val() - }; - App.Art.refreshSlaveArt(slave, 3, "art-frame"); - } else { - c.image.filename = this.value; - App.Art.refreshSlaveArt(slave, 3, "art-frame"); - } - } - }); - jQuery("#customImageFormatSelector") - .val(activeSlave().custom.image ? activeSlave().custom.image.format : "png") - .on("change", function(e) { - if (activeSlave().custom.image !== null) { - activeSlave().custom.image.format = this.value; - } - jQuery("#customImageFormatValue").text(this.value); - }); - }); - return el; - } + let choices = document.createElement('div'); + choices.className = "choices"; + choices.appendChild(App.UI.DOM.makeElement('span', ` For best results, use a short phrase; for example: 'Breeder.'`, 'note')); + el.appendChild(choices); - function customHairImage() { - let el = document.createElement('p'); - if (V.seeImages === 1 && V.imageChoice === 1) { - if (!slave.custom.hairVector) { - slave.custom.hairVector = 0; - } - el.append(`Assign ${him} a custom hair SVG image: `); + return el; + } - el.appendChild(App.UI.DOM.makeTextBox( - slave.custom.hairVector, - v => { - slave.custom.hairVector = v; - refresh(); - })); + function customSlaveImage() { + let el = document.createElement('p'); + el.append(`Assign ${him} a custom image: `); + + const textbox = document.createElement("INPUT"); + textbox.id = "customImageValue"; + el.appendChild(textbox); + + + let kbd = document.createElement('kbd'); + let select = document.createElement('SELECT'); + select.id = "customImageFormatSelector"; + select.style.border = "none"; + + let filetypes = [ + "png", + "jpg", + "gif", + "webm", + "webp", + "mp4" + ]; + + filetypes.forEach((fileType) => { + let el = document.createElement('OPTION'); + el.value = fileType; + el.text = fileType.toUpperCase(); + select.add(el); + }); + kbd.append(`.`); + kbd.appendChild(select); + el.appendChild(kbd); + + el.appendChild( + App.UI.DOM.link( + ` Reset`, + () => { + slave.custom.image = null; + refresh(); + App.Art.refreshSlaveArt(slave, 3, "art-frame"); + }, + ) + ); + + let choices = document.createElement('div'); + choices.className = "choices"; + let note = document.createElement('span'); + note.className = "note"; + note.append(`Place file in the `); + + kbd = document.createElement('kbd'); + kbd.append(`resources`); + note.appendChild(kbd); + + note.append(` folder. Choose the extension from the menu first, then enter the filename in the space and press enter. For example, for a file with the path `); + + kbd = document.createElement('kbd'); + kbd.textContent = `\\bin\\resources\\headgirl.`; + let filetypeDesc = document.createElement('span'); + filetypeDesc.id = "customImageFormatValue"; + filetypeDesc.textContent = "png"; + kbd.appendChild(filetypeDesc); + note.appendChild(kbd); + + note.append(`, choose `); + + kbd = document.createElement('kbd'); + kbd.textContent = `PNG`; + note.appendChild(kbd); + + note.append(` then enter `); + + kbd = document.createElement('kbd'); + kbd.textContent = `headgirl`; + note.appendChild(kbd); + + note.append(`.`); + choices.appendChild(note); + el.appendChild(choices); + + jQuery(function() { + function activeSlave() { + return slave; + } - el.appendChild( - App.UI.DOM.link( - ` Reset`, - () => { - slave.custom.hairVector = 0; - refresh(); + jQuery("#customImageFormatValue").text(activeSlave().custom.image === null ? "png" : activeSlave().custom.image.format); + jQuery("#customImageValue") + .val(activeSlave().custom.image === null ? + "" : activeSlave().custom.image.filename) + .on("change", function(e) { + const c = activeSlave().custom; + if (this.value.length === 0) { + c.image = null; + } else { + if (c.image === null) { + c.image = { + filename: this.value, + format: jQuery("#customImageFormatSelector").val() + }; App.Art.refreshSlaveArt(slave, 3, "art-frame"); - }, - ) - ); + } else { + c.image.filename = this.value; + App.Art.refreshSlaveArt(slave, 3, "art-frame"); + } + } + }); + jQuery("#customImageFormatSelector") + .val(activeSlave().custom.image ? activeSlave().custom.image.format : "png") + .on("change", function(e) { + if (activeSlave().custom.image !== null) { + activeSlave().custom.image.format = this.value; + } + jQuery("#customImageFormatValue").text(this.value); + }); + }); + return el; + } + + function customHairImage() { + let el = document.createElement('p'); + if (V.seeImages === 1 && V.imageChoice === 1) { + if (!slave.custom.hairVector) { + slave.custom.hairVector = 0; } + el.append(`Assign ${him} a custom hair SVG image: `); - return el; + el.appendChild(App.UI.DOM.makeTextBox( + slave.custom.hairVector, + v => { + slave.custom.hairVector = v; + refresh(); + })); + + el.appendChild( + App.UI.DOM.link( + ` Reset`, + () => { + slave.custom.hairVector = 0; + refresh(); + App.Art.refreshSlaveArt(slave, 3, "art-frame"); + }, + ) + ); } + + return el; } + function refresh() { - jQuery("#si-custom").empty().append(custom()); + jQuery("#content-custom").empty().append(App.UI.SlaveInteract.custom(slave)); } }; diff --git a/src/interaction/siDescription.js b/src/interaction/siDescription.js index d1c113c1cf4659358f77dff8312af42b1d90be2a..daeceffb745707c99d9a8ba818a6e2c1175b9f6d 100644 --- a/src/interaction/siDescription.js +++ b/src/interaction/siDescription.js @@ -1,10 +1,3 @@ -App.UI.SlaveInteract.descriptionWrapper = function(slave) { - const el = document.createElement("p"); - el.id = "si-description"; - el.append(App.UI.SlaveInteract.description(slave)); - return el; -}; - App.UI.SlaveInteract.description = function(slave) { const el = new DocumentFragment(); const descriptionLink = document.createElement("div"); @@ -55,4 +48,4 @@ App.UI.SlaveInteract.description = function(slave) { } ); } -} +}; diff --git a/src/interaction/siFinancial.js b/src/interaction/siFinancial.js index 1d16d3c40efad580439a9d2bc775af5f7d2f56d6..716ff9a69fe1e7cc25e25b9cc6fd8ca795d7c7f9 100644 --- a/src/interaction/siFinancial.js +++ b/src/interaction/siFinancial.js @@ -1,251 +1,245 @@ App.UI.SlaveInteract.financial = function(slave) { - const el = document.createElement("div"); - el.id = "si-financial"; - el.append(financialContent()); - return el; - - function financialContent() { - const el = new DocumentFragment(); - let r = []; - let linkArray; - const { - He, His, - his, him - } = getPronouns(slave); - if (V.studio === 1) { - App.UI.DOM.appendNewElement("h3", el, "Media"); - slave.porn.spending = Math.clamp(Math.ceil(slave.porn.spending / 1000) * 1000, 0, 5000); - if (slave.porn.prestige === 3) { - r.push( - App.UI.DOM.makeElement("div", `${He} is so prestigious in the realm of ${slave.porn.fameType} porn that ${his} fame is self-sustaining.`, "note") + const el = new DocumentFragment(); + let r = []; + let linkArray; + const { + He, His, + his, him + } = getPronouns(slave); + if (V.studio === 1) { + App.UI.DOM.appendNewElement("h3", el, "Media"); + slave.porn.spending = Math.clamp(Math.ceil(slave.porn.spending / 1000) * 1000, 0, 5000); + if (slave.porn.prestige === 3) { + r.push( + App.UI.DOM.makeElement("div", `${He} is so prestigious in the realm of ${slave.porn.fameType} porn that ${his} fame is self-sustaining.`, "note") + ); + } else if (slave.porn.feed === 0) { + r.push(`The media hub is not releasing highlights of ${his} sex life.`); + r.push( + App.UI.DOM.link( + "Release", + () => { + slave.porn.feed = 1; + refresh(); + } + ) + ); + } else { + r.push(`The media hub is releasing highlights of ${his} sex life`); + if (slave.porn.spending < 500) { + r.push(`to those who can find it.`); + } else if (slave.porn.spending < 2500) { + r.push(`on several websites.`); + } else if (slave.porn.spending > 5000) { + r.push(`through your old distributor.`); + } else { + r.push(`on many websites.`); + } + if (slave.porn.spending === 0) { + linkArray = []; + linkArray.push( + App.UI.DOM.link( + "Halt", + () => { + slave.porn.feed = 0; + slave.porn.focus = "none"; + refresh(); + } + ) ); - } else if (slave.porn.feed === 0) { - r.push(`The media hub is not releasing highlights of ${his} sex life.`); + linkArray.push( + App.UI.DOM.link( + "Publicize", + () => { + slave.porn.spending += 1000; + refresh(); + }, + [], + "", + `Will cost ${cashFormat(1000)} weekly.` + ) + ); + r.push(App.UI.DOM.generateLinksStrip(linkArray)); + } else { r.push( + App.UI.DOM.makeTextBox( + slave.porn.spending, + v => { + slave.porn.spending = v; + }, + true + ) + ); + r.push(`weekly is spent to publicize them.`); + + linkArray = []; + linkArray.push( App.UI.DOM.link( - "Release", + "Halt", () => { - slave.porn.feed = 1; + slave.porn.spending = 0; + slave.porn.feed = 0; + slave.porn.focus = "none"; + V.PCSlutContacts = 1; refresh(); } ) ); - } else { - r.push(`The media hub is releasing highlights of ${his} sex life`); - if (slave.porn.spending < 500) { - r.push(`to those who can find it.`); - } else if (slave.porn.spending < 2500) { - r.push(`on several websites.`); - } else if (slave.porn.spending > 5000) { - r.push(`through your old distributor.`); - } else { - r.push(`on many websites.`); - } - if (slave.porn.spending === 0) { - linkArray = []; + if (slave.porn.spending <= 4000) { linkArray.push( App.UI.DOM.link( - "Halt", - () => { - slave.porn.feed = 0; - slave.porn.focus = "none"; - refresh(); - } - ) - ); - linkArray.push( - App.UI.DOM.link( - "Publicize", + "Increase", () => { slave.porn.spending += 1000; refresh(); }, [], "", - `Will cost ${cashFormat(1000)} weekly.` - ) - ); - r.push(App.UI.DOM.generateLinksStrip(linkArray)); - } else { - r.push( - App.UI.DOM.makeTextBox( - slave.porn.spending, - v => { - slave.porn.spending = v; - }, - true + `Spending more than ${cashFormat(5000)} weekly will have no effect.` ) ); - r.push(`weekly is spent to publicize them.`); + } + linkArray.push( + App.UI.DOM.link( + "Decrease", + () => { + slave.porn.spending -= 1000; + refresh(); + }, + [], + "", + `Will cost ${cashFormat(1000)} weekly.` + ) + ); + r.push(App.UI.DOM.generateLinksStrip(linkArray)); + App.Events.addNode(el, r, "div"); - linkArray = []; - linkArray.push( - App.UI.DOM.link( - "Halt", - () => { - slave.porn.spending = 0; - slave.porn.feed = 0; - slave.porn.focus = "none"; - V.PCSlutContacts = 1; - refresh(); - } - ) - ); - if (slave.porn.spending <= 4000) { - linkArray.push( + if (V.PC.career === "escort") { + App.Events.addNode(el, r, "div"); + r = []; + r.push(`You retain some contacts from your past life in the industry that may be willing to cut you some discounts should you return to it.`); + if (V.PCSlutContacts !== 2) { + r.push(`You are not baring your body for all to see.`); + r.push( App.UI.DOM.link( - "Increase", + `Star in porn for a discount`, () => { - slave.porn.spending += 1000; + V.PCSlutContacts = 2; refresh(); - }, - [], - "", - `Spending more than ${cashFormat(5000)} weekly will have no effect.` + } + ) + ); + } else { + r.push(`You are starring in hardcore porn once more.`); + r.push( + App.UI.DOM.link( + `Stop doing porn for a discount`, + () => { + V.PCSlutContacts = 1; + refresh(); + } ) ); - } - linkArray.push( - App.UI.DOM.link( - "Decrease", - () => { - slave.porn.spending -= 1000; - refresh(); - }, - [], - "", - `Will cost ${cashFormat(1000)} weekly.` - ) - ); - r.push(App.UI.DOM.generateLinksStrip(linkArray)); - App.Events.addNode(el, r, "div"); - - if (V.PC.career === "escort") { - App.Events.addNode(el, r, "div"); - r = []; - r.push(`You retain some contacts from your past life in the industry that may be willing to cut you some discounts should you return to it.`); - if (V.PCSlutContacts !== 2) { - r.push(`You are not baring your body for all to see.`); - r.push( - App.UI.DOM.link( - `Star in porn for a discount`, - () => { - V.PCSlutContacts = 2; - refresh(); - } - ) - ); - } else { - r.push(`You are starring in hardcore porn once more.`); - r.push( - App.UI.DOM.link( - `Stop doing porn for a discount`, - () => { - V.PCSlutContacts = 1; - refresh(); - } - ) - ); - } } } - if (V.studioFeed === 1) { - App.Events.addNode(el, r, "div"); - r = []; - if (slave.porn.viewerCount < 100) { - r.push(`${He} lacks the fame in porn needed to discern what ${his} feed is getting tagged as.`); + } + if (V.studioFeed === 1) { + App.Events.addNode(el, r, "div"); + r = []; + if (slave.porn.viewerCount < 100) { + r.push(`${He} lacks the fame in porn needed to discern what ${his} feed is getting tagged as.`); + } else { + if (slave.porn.prestige > 0) { + r.push(`${He} is known for ${slave.porn.fameType}${(slave.porn.prestige > 1) ? ` and viewers have grown to expect it from ${him}` : ``}.`); + } + if (slave.porn.focus === "none") { + r.push(`You are allowing ${his} viewers to guide the direction of ${his} content.`); } else { - if (slave.porn.prestige > 0) { - r.push(`${He} is known for ${slave.porn.fameType}${(slave.porn.prestige > 1) ? ` and viewers have grown to expect it from ${him}` : ``}.`); - } - if (slave.porn.focus === "none") { - r.push(`You are allowing ${his} viewers to guide the direction of ${his} content.`); - } else { - r.push(`You are focusing attention on the ${slave.porn.focus} aspect of ${his} content.`); - } - r.push(App.Porn.genreChoiceLinks("Slave Interact", slave)); + r.push(`You are focusing attention on the ${slave.porn.focus} aspect of ${his} content.`); } + r.push(App.Porn.genreChoiceLinks("Slave Interact", slave)); } } - App.Events.addNode(el, r, "div"); } - App.UI.DOM.appendNewElement("h3", el, "Financial"); - App.UI.DOM.appendNewElement("p", el, slaveExpenses(slave)); + App.Events.addNode(el, r, "div"); + } + App.UI.DOM.appendNewElement("h3", el, "Financial"); + App.UI.DOM.appendNewElement("p", el, slaveExpenses(slave)); - r = []; - linkArray = []; - if (V.slaveCostFactor > 1) { - r.push(App.UI.DOM.makeElement("span", `The slave market is bullish; the price of slaves is high.`, "yellow")); - } else if ((V.slaveCostFactor < 1)) { - r.push(App.UI.DOM.makeElement("span", `The slave market is bearish; the price of slaves is low.`, "yellow")); - } + r = []; + linkArray = []; + if (V.slaveCostFactor > 1) { + r.push(App.UI.DOM.makeElement("span", `The slave market is bullish; the price of slaves is high.`, "yellow")); + } else if ((V.slaveCostFactor < 1)) { + r.push(App.UI.DOM.makeElement("span", `The slave market is bearish; the price of slaves is low.`, "yellow")); + } - if (V.slaves.length < 2) { - r.push("You cannot sell your last save"); - } else if (slave.origin === "You bought ${him} from a body dump, completely broken." && (V.week - slave.weekAcquired <= 8)) { - r.push(`A discarded slave must be kept for at least two months to ensure health before being sold.`); - } else if (slave.accent > 3) { - r.push(`${His} lack of language and basic life skills is a red sign to most slave appraisers. ${He} must not act like a child to be sold without raising suspicion.`); - } else { + if (V.slaves.length < 2) { + r.push("You cannot sell your last save"); + } else if (slave.origin === "You bought ${him} from a body dump, completely broken." && (V.week - slave.weekAcquired <= 8)) { + r.push(`A discarded slave must be kept for at least two months to ensure health before being sold.`); + } else if (slave.accent > 3) { + r.push(`${His} lack of language and basic life skills is a red sign to most slave appraisers. ${He} must not act like a child to be sold without raising suspicion.`); + } else { + linkArray.push( + App.UI.DOM.link( + `Sell ${him}`, + () => { + cashX(-500, "personalBusiness", slave); + }, + [], + "Sell Slave", + `Listing ${him} for sale will cost ${cashFormat(500)}` + ) + ); + if ((V.seeAge !== 0) && (slave.indenture < 1)) { linkArray.push( App.UI.DOM.link( - `Sell ${him}`, + `Retire ${him}`, () => { - cashX(-500, "personalBusiness", slave); + V.retiree = slave.ID; + V.retired = 1; }, [], - "Sell Slave", - `Listing ${him} for sale will cost ${cashFormat(500)}` + "SE retirement", ) ); - if ((V.seeAge !== 0) && (slave.indenture < 1)) { - linkArray.push( - App.UI.DOM.link( - `Retire ${him}`, - () => { - V.retiree = slave.ID; - V.retired = 1; - }, - [], - "SE retirement", - ) - ); - } - linkArray.push( - App.UI.DOM.passageLink( - `Discard ${him}`, - "Discard Confirm", - ) - ); - if (V.seeExtreme === 1 && V.arcologies[0].FSPaternalist === "unset" && V.cheatMode === 1) { - linkArray.push( - App.UI.DOM.passageLink( - `Threaten ${his} life`, - "KillSlave", - ) - ); - } } linkArray.push( App.UI.DOM.passageLink( - `Export this slave`, - "Export Slave", + `Discard ${him}`, + "Discard Confirm", ) ); - if (V.cheatMode) { + if (V.seeExtreme === 1 && V.arcologies[0].FSPaternalist === "unset" && V.cheatMode === 1) { linkArray.push( App.UI.DOM.passageLink( - `Import a slave`, - "Import Slave", + `Threaten ${his} life`, + "KillSlave", ) ); } - r.push(App.UI.DOM.generateLinksStrip(linkArray)); - App.Events.addNode(el, r, "p"); - return el; } + linkArray.push( + App.UI.DOM.passageLink( + `Export this slave`, + "Export Slave", + ) + ); + if (V.cheatMode) { + linkArray.push( + App.UI.DOM.passageLink( + `Import a slave`, + "Import Slave", + ) + ); + } + r.push(App.UI.DOM.generateLinksStrip(linkArray)); + App.Events.addNode(el, r, "p"); + return el; + function refresh() { - jQuery("#si-financial").empty().append(financialContent()); + jQuery("#content-financial").empty().append(App.UI.SlaveInteract.financialContent(slave)); } }; diff --git a/src/interaction/siPhysicalRegimen.js b/src/interaction/siPhysicalRegimen.js index 3bae0cd02bcc1769038285deec79d7e97f0d6f9d..c9be27122eb1c20dfcc73095484db371c9711ae2 100644 --- a/src/interaction/siPhysicalRegimen.js +++ b/src/interaction/siPhysicalRegimen.js @@ -1,474 +1,468 @@ App.UI.SlaveInteract.physicalRegimen = function(slave) { - const el = document.createElement("p"); - el.id = "si-physical-regimen"; - el.append(physicalRegimenContent()); + const { + // eslint-disable-next-line no-unused-vars + he, + him, + his, + himself, + He, + His + } = getPronouns(slave); + const el = new DocumentFragment(); + el.append(drugs()); + el.append(curatives()); + el.append(aphrodisiacs()); + el.append(fertility()); + el.append(incubator()); + el.append(nursery()); + el.append(breederEligibility()); + el.append(bloating()); + el.append(hormones()); + el.append(diet()); + el.append(dietBase()); + el.append(snacks()); return el; - function physicalRegimenContent() { - const { - // eslint-disable-next-line no-unused-vars - he, - him, - his, - himself, - He, - His - } = getPronouns(slave); - const el = new DocumentFragment(); - el.append(drugs()); - el.append(curatives()); - el.append(aphrodisiacs()); - el.append(fertility()); - el.append(incubator()); - el.append(nursery()); - el.append(breederEligibility()); - el.append(bloating()); - el.append(hormones()); - el.append(diet()); - el.append(dietBase()); - el.append(snacks()); - return el; - - function drugs() { - let el = document.createElement('div'); - - const drugLevelOptions = []; - const lips = []; - const breasts = []; - const nipples = []; - const butt = []; - const dick = []; - const balls = []; - const fertility = []; - const hormones = []; - const psych = []; - const misc = []; - - if (slave.drugs !== "no drugs") { - drugLevelOptions.push({text: `None`, updateSlave: {drugs: `no drugs`}}); + function drugs() { + let el = document.createElement('div'); + + const drugLevelOptions = []; + const lips = []; + const breasts = []; + const nipples = []; + const butt = []; + const dick = []; + const balls = []; + const fertility = []; + const hormones = []; + const psych = []; + const misc = []; + + if (slave.drugs !== "no drugs") { + drugLevelOptions.push({text: `None`, updateSlave: {drugs: `no drugs`}}); + } + if (slave.indentureRestrictions < 2) { + // Psych + if (slave.intelligence > -100 && slave.indentureRestrictions < 1) { + psych.push({text: `Psychosuppressants`, updateSlave: {drugs: `psychosuppressants`}}); + } else if (slave.intelligence > -100) { + psych.push({text: `Psychosuppressants`, disabled: `Cannot suppress indentured slave`}); + } else if (slave.indentureRestrictions < 1) { + psych.push({text: `Psychosuppressants`, disabled: `Too stupid to suppress`}); + } else { + psych.push({text: `Psychosuppressants`, disabled: `Too stupid and indentured to suppress`}); } - if (slave.indentureRestrictions < 2) { - // Psych - if (slave.intelligence > -100 && slave.indentureRestrictions < 1) { - psych.push({text: `Psychosuppressants`, updateSlave: {drugs: `psychosuppressants`}}); - } else if (slave.intelligence > -100) { - psych.push({text: `Psychosuppressants`, disabled: `Cannot suppress indentured slave`}); - } else if (slave.indentureRestrictions < 1) { - psych.push({text: `Psychosuppressants`, disabled: `Too stupid to suppress`}); + if (V.arcologies[0].FSSlaveProfessionalismResearch === 1) { + if (canImproveIntelligence(slave)) { + psych.push({text: `Psychostimulants`, updateSlave: {drugs: `psychostimulants`}}); } else { - psych.push({text: `Psychosuppressants`, disabled: `Too stupid and indentured to suppress`}); - } - if (V.arcologies[0].FSSlaveProfessionalismResearch === 1) { - if (canImproveIntelligence(slave)) { - psych.push({text: `Psychostimulants`, updateSlave: {drugs: `psychostimulants`}}); - } else { - psych.push({text: `Psychostimulants`, disabled: `Cannot improve intelligence`}); - } + psych.push({text: `Psychostimulants`, disabled: `Cannot improve intelligence`}); } + } - // Breasts - if (V.arcologies[0].FSSlimnessEnthusiastResearch === 1) { - if ((slave.boobs - slave.boobsImplant - slave.boobsMilk) > 100) { - breasts.push({text: `Reducers`, updateSlave: {drugs: `breast redistributors`}}); - } else { - breasts.push({text: `Reducers`, disabled: `Boobs are too small`}); - } + // Breasts + if (V.arcologies[0].FSSlimnessEnthusiastResearch === 1) { + if ((slave.boobs - slave.boobsImplant - slave.boobsMilk) > 100) { + breasts.push({text: `Reducers`, updateSlave: {drugs: `breast redistributors`}}); + } else { + breasts.push({text: `Reducers`, disabled: `Boobs are too small`}); } + } + if (slave.boobs < 50000) { + breasts.push({text: `Enhancement`, updateSlave: {drugs: `breast injections`}}); + breasts.push({text: `Intensive enhancement`, updateSlave: {drugs: `intensive breast injections`}}); + } else { + breasts.push({text: `Enhancement`, disabled: `Boobs are too large`}); + } + if (V.arcologies[0].FSAssetExpansionistResearch === 1) { if (slave.boobs < 50000) { - breasts.push({text: `Enhancement`, updateSlave: {drugs: `breast injections`}}); - breasts.push({text: `Intensive enhancement`, updateSlave: {drugs: `intensive breast injections`}}); + breasts.push({text: `Hyper enhancement`, updateSlave: {drugs: `hyper breast injections`}}); } else { - breasts.push({text: `Enhancement`, disabled: `Boobs are too large`}); - } - if (V.arcologies[0].FSAssetExpansionistResearch === 1) { - if (slave.boobs < 50000) { - breasts.push({text: `Hyper enhancement`, updateSlave: {drugs: `hyper breast injections`}}); - } else { - breasts.push({text: `Hyper enhancement`, disabled: `Boobs are too large`}); - } + breasts.push({text: `Hyper enhancement`, disabled: `Boobs are too large`}); } + } - // Nipples - if (V.arcologies[0].FSSlimnessEnthusiastResearch === 1) { - if (slave.nipples === "huge" || slave.nipples === "puffy" || slave.nipples === "cute") { - nipples.push({text: `Reducers`, updateSlave: {drugs: `nipple atrophiers`}}); - } else { - nipples.push({text: `Reducers`, disabled: `Nipples are ${slave.nipples}`}); - } + // Nipples + if (V.arcologies[0].FSSlimnessEnthusiastResearch === 1) { + if (slave.nipples === "huge" || slave.nipples === "puffy" || slave.nipples === "cute") { + nipples.push({text: `Reducers`, updateSlave: {drugs: `nipple atrophiers`}}); + } else { + nipples.push({text: `Reducers`, disabled: `Nipples are ${slave.nipples}`}); } - if (V.dispensary) { - if (["inverted", "partially inverted", "cute", "tiny", "puffy"].includes(slave.nipples)) { - nipples.push({text: `Enhancement`, updateSlave: {drugs: `nipple enhancers`}}); - } else if (slave.nipples === "huge") { - nipples.push({text: `Enhancement`, disabled: `Nipples are already huge`}); - } else { - nipples.push({text: `Enhancement`, disabled: `Has no effect on ${slave.nipples} nipples`}); - } + } + if (V.dispensary) { + if (["inverted", "partially inverted", "cute", "tiny", "puffy"].includes(slave.nipples)) { + nipples.push({text: `Enhancement`, updateSlave: {drugs: `nipple enhancers`}}); + } else if (slave.nipples === "huge") { + nipples.push({text: `Enhancement`, disabled: `Nipples are already huge`}); + } else { + nipples.push({text: `Enhancement`, disabled: `Has no effect on ${slave.nipples} nipples`}); } + } - // Butt - if (V.arcologies[0].FSSlimnessEnthusiastResearch === 1) { - if (slave.butt - slave.buttImplant > 0) { - butt.push({text: `Reducers`, updateSlave: {drugs: `butt redistributors`}}); - } else { - butt.push({text: `Reducers`, disabled: `Butt is too small`}); - } - } - if (slave.butt < 9) { - butt.push({text: `Enhancement`, updateSlave: {drugs: `butt injections`}}); - butt.push({text: `Intensive enhancement`, updateSlave: {drugs: `intensive butt injections`}}); + // Butt + if (V.arcologies[0].FSSlimnessEnthusiastResearch === 1) { + if (slave.butt - slave.buttImplant > 0) { + butt.push({text: `Reducers`, updateSlave: {drugs: `butt redistributors`}}); } else { - butt.push({text: `Enhancement`, disabled: `Butt is too large`}); + butt.push({text: `Reducers`, disabled: `Butt is too small`}); } - if (V.arcologies[0].FSAssetExpansionistResearch === 1) { - if (slave.butt < 20) { - butt.push({text: `Hyper enhancement`, updateSlave: {drugs: `hyper butt injections`}}); - } else { - butt.push({text: `Hyper enhancement`, disabled: `Butt is too large`}); - } + } + if (slave.butt < 9) { + butt.push({text: `Enhancement`, updateSlave: {drugs: `butt injections`}}); + butt.push({text: `Intensive enhancement`, updateSlave: {drugs: `intensive butt injections`}}); + } else { + butt.push({text: `Enhancement`, disabled: `Butt is too large`}); + } + if (V.arcologies[0].FSAssetExpansionistResearch === 1) { + if (slave.butt < 20) { + butt.push({text: `Hyper enhancement`, updateSlave: {drugs: `hyper butt injections`}}); + } else { + butt.push({text: `Hyper enhancement`, disabled: `Butt is too large`}); } + } - // Lips - if (V.arcologies[0].FSSlimnessEnthusiastResearch === 1) { - if (slave.lips - slave.lipsImplant > 0) { - lips.push({text: `Reducers`, updateSlave: {drugs: `lip atrophiers`}}); - } else { - lips.push({text: `Reducers`, disabled: `Lips are too small`}); - } - } - if (slave.lips <= 95 || (slave.lips <= 85 && V.seeExtreme !== 1)) { - lips.push({text: `Enhancement`, updateSlave: {drugs: `lip injections`}}); + // Lips + if (V.arcologies[0].FSSlimnessEnthusiastResearch === 1) { + if (slave.lips - slave.lipsImplant > 0) { + lips.push({text: `Reducers`, updateSlave: {drugs: `lip atrophiers`}}); } else { - lips.push({text: `Enhancement`, disabled: `Lips are too large`}); + lips.push({text: `Reducers`, disabled: `Lips are too small`}); } + } + if (slave.lips <= 95 || (slave.lips <= 85 && V.seeExtreme !== 1)) { + lips.push({text: `Enhancement`, updateSlave: {drugs: `lip injections`}}); + } else { + lips.push({text: `Enhancement`, disabled: `Lips are too large`}); + } - // Fertility - fertility.push({text: `Fertility`, updateSlave: {drugs: `fertility drugs`}}); - if (V.seeHyperPreg === 1 && slave.indentureRestrictions < 1 && V.superFertilityDrugs === 1 && (slave.breedingMark !== 1 || V.propOutcome === 0 || V.eugenicsFullControl === 1 || V.arcologies[0].FSRestart === "unset")) { - fertility.push({text: `Fertility+`, updateSlave: {drugs: `super fertility drugs`}}); - } + // Fertility + fertility.push({text: `Fertility`, updateSlave: {drugs: `fertility drugs`}}); + if (V.seeHyperPreg === 1 && slave.indentureRestrictions < 1 && V.superFertilityDrugs === 1 && (slave.breedingMark !== 1 || V.propOutcome === 0 || V.eugenicsFullControl === 1 || V.arcologies[0].FSRestart === "unset")) { + fertility.push({text: `Fertility+`, updateSlave: {drugs: `super fertility drugs`}}); + } - // Dick/clit - if (V.arcologies[0].FSSlimnessEnthusiastResearch === 1) { - if (slave.dick > 1) { - dick.push({text: `Reducers`, updateSlave: {drugs: `penis atrophiers`}}); - } else if (slave.dick === 1) { - dick.push({text: `Reducers`, disabled: `Dick is already at minimum size`}); - } - if (slave.clit > 0) { - dick.push({text: `Reducers`, updateSlave: {drugs: `clitoris atrophiers`}}); - } + // Dick/clit + if (V.arcologies[0].FSSlimnessEnthusiastResearch === 1) { + if (slave.dick > 1) { + dick.push({text: `Reducers`, updateSlave: {drugs: `penis atrophiers`}}); + } else if (slave.dick === 1) { + dick.push({text: `Reducers`, disabled: `Dick is already at minimum size`}); + } + if (slave.clit > 0) { + dick.push({text: `Reducers`, updateSlave: {drugs: `clitoris atrophiers`}}); + } + } + if (slave.dick > 0) { + if (slave.dick < 10) { + dick.push({text: `Enhancement`, updateSlave: {drugs: `penis enhancement`}}); + dick.push({text: `Intensive enhancement`, updateSlave: {drugs: `intensive penis enhancement`}}); + } else { + dick.push({text: `Enhancement`, disabled: `Dick is too large`}); } + } else { + if (slave.clit < 5) { + dick.push({text: `Enhancement`, updateSlave: {drugs: `penis enhancement`}}); + dick.push({text: `Intensive enhancement`, updateSlave: {drugs: `intensive penis enhancement`}}); + } else { + dick.push({text: `Enhancement`, disabled: `Clit is too large`}); + } + } + if (V.arcologies[0].FSAssetExpansionistResearch === 1) { if (slave.dick > 0) { - if (slave.dick < 10) { - dick.push({text: `Enhancement`, updateSlave: {drugs: `penis enhancement`}}); - dick.push({text: `Intensive enhancement`, updateSlave: {drugs: `intensive penis enhancement`}}); + if (slave.dick < 31) { + dick.push({text: `Hyper enhancement`, updateSlave: {drugs: `hyper penis enhancement`}}); } else { - dick.push({text: `Enhancement`, disabled: `Dick is too large`}); + dick.push({text: `Hyper enhancement`, disabled: `Dick is too large`}); } } else { if (slave.clit < 5) { - dick.push({text: `Enhancement`, updateSlave: {drugs: `penis enhancement`}}); - dick.push({text: `Intensive enhancement`, updateSlave: {drugs: `intensive penis enhancement`}}); + dick.push({text: `Hyper enhancement`, updateSlave: {drugs: `penis enhancement`}}); } else { - dick.push({text: `Enhancement`, disabled: `Clit is too large`}); + dick.push({text: `Hyper enhancement`, disabled: `Clit is too large`}); } } - if (V.arcologies[0].FSAssetExpansionistResearch === 1) { - if (slave.dick > 0) { - if (slave.dick < 31) { - dick.push({text: `Hyper enhancement`, updateSlave: {drugs: `hyper penis enhancement`}}); - } else { - dick.push({text: `Hyper enhancement`, disabled: `Dick is too large`}); - } - } else { - if (slave.clit < 5) { - dick.push({text: `Hyper enhancement`, updateSlave: {drugs: `penis enhancement`}}); - } else { - dick.push({text: `Hyper enhancement`, disabled: `Clit is too large`}); - } - } - } - if (slave.dick > 0 && slave.dick < 11 && !canAchieveErection(slave) && slave.chastityPenis !== 1) { - dick.push({text: `Erectile dysfunction circumvention`, updateSlave: {drugs: `priapism agents`}}); - } + } + if (slave.dick > 0 && slave.dick < 11 && !canAchieveErection(slave) && slave.chastityPenis !== 1) { + dick.push({text: `Erectile dysfunction circumvention`, updateSlave: {drugs: `priapism agents`}}); + } - // Balls - if (V.arcologies[0].FSSlimnessEnthusiastResearch === 1) { - if (slave.balls > 1) { - balls.push({text: `Reducers`, updateSlave: {drugs: `testicle atrophiers`}}); - } else if (slave.balls === 1) { - balls.push({text: `Reducers`, disabled: `Balls are already at minimum size`}); - } + // Balls + if (V.arcologies[0].FSSlimnessEnthusiastResearch === 1) { + if (slave.balls > 1) { + balls.push({text: `Reducers`, updateSlave: {drugs: `testicle atrophiers`}}); + } else if (slave.balls === 1) { + balls.push({text: `Reducers`, disabled: `Balls are already at minimum size`}); } - if (slave.balls > 0) { - balls.push({text: `Enhancement`, updateSlave: {drugs: `testicle enhancement`}}); - balls.push({text: `Intensive enhancement`, updateSlave: {drugs: `intensive testicle enhancement`}}); - if (V.arcologies[0].FSAssetExpansionistResearch === 1) { - balls.push({text: `Hyper enhancement`, updateSlave: {drugs: `hyper testicle enhancement`}}); - } + } + if (slave.balls > 0) { + balls.push({text: `Enhancement`, updateSlave: {drugs: `testicle enhancement`}}); + balls.push({text: `Intensive enhancement`, updateSlave: {drugs: `intensive testicle enhancement`}}); + if (V.arcologies[0].FSAssetExpansionistResearch === 1) { + balls.push({text: `Hyper enhancement`, updateSlave: {drugs: `hyper testicle enhancement`}}); } + } - // Hormones - if (V.precociousPuberty === 1 && V.pubertyHormones === 1 && (slave.breedingMark !== 1 || V.propOutcome === 0 || V.eugenicsFullControl === 1 || V.arcologies[0].FSRestart === "unset")) { - if ((slave.ovaries === 1 || slave.mpreg === 1) && slave.pubertyXX === 0) { - hormones.push({text: `Female injections`, updateSlave: {drugs: `female hormone injections`}}); - } - if (slave.balls > 0 && slave.pubertyXY === 0) { - hormones.push({text: `Male injections`, updateSlave: {drugs: `male hormone injections`}}); - } + // Hormones + if (V.precociousPuberty === 1 && V.pubertyHormones === 1 && (slave.breedingMark !== 1 || V.propOutcome === 0 || V.eugenicsFullControl === 1 || V.arcologies[0].FSRestart === "unset")) { + if ((slave.ovaries === 1 || slave.mpreg === 1) && slave.pubertyXX === 0) { + hormones.push({text: `Female injections`, updateSlave: {drugs: `female hormone injections`}}); } - hormones.push({text: `Blockers`, updateSlave: {drugs: `hormone blockers`}}); - hormones.push({text: `Enhancement`, updateSlave: {drugs: `hormone enhancers`}}); - - // Misc - if (V.arcologies[0].FSSlimnessEnthusiastResearch === 1) { - if (slave.labia > 0) { - misc.push({text: `Labia reducers`, updateSlave: {drugs: `labia atrophiers`}}); - } + if (slave.balls > 0 && slave.pubertyXY === 0) { + hormones.push({text: `Male injections`, updateSlave: {drugs: `male hormone injections`}}); } - if (V.growthStim === 1) { - if (canImproveHeight(slave)) { - misc.push({text: `Growth Stimulants`, updateSlave: {drugs: `growth stimulants`}}); - } else { - misc.push({text: `Growth Stimulants`, disabled: `Cannot increase height further`}); - } + } + hormones.push({text: `Blockers`, updateSlave: {drugs: `hormone blockers`}}); + hormones.push({text: `Enhancement`, updateSlave: {drugs: `hormone enhancers`}}); + + // Misc + if (V.arcologies[0].FSSlimnessEnthusiastResearch === 1) { + if (slave.labia > 0) { + misc.push({text: `Labia reducers`, updateSlave: {drugs: `labia atrophiers`}}); } - if (V.arcologies[0].FSSlimnessEnthusiastResearch === 1) { - if (slave.weight > -95) { - misc.push({text: `Weight loss pills`, updateSlave: {drugs: `appetite suppressors`}}); - } else { - misc.push({text: `Weight loss pills`, disabled: `Slave is already at low weight`}); - } + } + if (V.growthStim === 1) { + if (canImproveHeight(slave)) { + misc.push({text: `Growth Stimulants`, updateSlave: {drugs: `growth stimulants`}}); + } else { + misc.push({text: `Growth Stimulants`, disabled: `Cannot increase height further`}); } - misc.push({text: `Steroids`, updateSlave: {drugs: `steroids`}}); - if (slave.boobs > 250 && slave.boobShape !== "saggy" && V.purchasedSagBGone === 1) { - misc.push({text: `Sag-B-Gone breast lifting cream`, updateSlave: {drugs: `sag-B-gone`}}); + } + if (V.arcologies[0].FSSlimnessEnthusiastResearch === 1) { + if (slave.weight > -95) { + misc.push({text: `Weight loss pills`, updateSlave: {drugs: `appetite suppressors`}}); + } else { + misc.push({text: `Weight loss pills`, disabled: `Slave is already at low weight`}); } - if (V.arcologies[0].FSYouthPreferentialistResearch === 1) { - if (slave.visualAge > 18) { - misc.push({text: `Anti-aging cream`, updateSlave: {drugs: `anti-aging cream`}}); - } else { - misc.push({text: `Anti-aging cream`, disabled: `Slave already looks young enough`}); - } + } + misc.push({text: `Steroids`, updateSlave: {drugs: `steroids`}}); + if (slave.boobs > 250 && slave.boobShape !== "saggy" && V.purchasedSagBGone === 1) { + misc.push({text: `Sag-B-Gone breast lifting cream`, updateSlave: {drugs: `sag-B-gone`}}); + } + if (V.arcologies[0].FSYouthPreferentialistResearch === 1) { + if (slave.visualAge > 18) { + misc.push({text: `Anti-aging cream`, updateSlave: {drugs: `anti-aging cream`}}); + } else { + misc.push({text: `Anti-aging cream`, disabled: `Slave already looks young enough`}); } } - - let title = document.createElement('div'); - title.textContent = `Drugs: `; - let chosenDrug = document.createElement('span'); - chosenDrug.textContent = `${capFirstChar(slave.drugs)}. `; - chosenDrug.style.fontWeight = "bold"; - title.append(chosenDrug); - title.appendChild(App.UI.SlaveInteract.generateRows(drugLevelOptions, slave, "", false, refresh)); - el.append(title); - - appendLabeledChoiceRow("Lips", lips, el); - appendLabeledChoiceRow("Breasts", breasts, el); - appendLabeledChoiceRow("Nipples", nipples, el); - appendLabeledChoiceRow("Butt", butt, el); - appendLabeledChoiceRow(slave.dick > 0 ? "Dick" : "Clit", dick, el); - appendLabeledChoiceRow("Balls", balls, el); - appendLabeledChoiceRow("Fertility", fertility, el); - appendLabeledChoiceRow("Hormones", hormones, el); - appendLabeledChoiceRow("Psych", psych, el); - appendLabeledChoiceRow("Misc", misc, el); - - return el; } - function curatives() { - const curativeOptions = []; + let title = document.createElement('div'); + title.textContent = `Drugs: `; + let chosenDrug = document.createElement('span'); + chosenDrug.textContent = `${capFirstChar(slave.drugs)}. `; + chosenDrug.style.fontWeight = "bold"; + title.append(chosenDrug); + title.appendChild(App.UI.SlaveInteract.generateRows(drugLevelOptions, slave, "", false, refresh)); + el.append(title); + + appendLabeledChoiceRow("Lips", lips, el); + appendLabeledChoiceRow("Breasts", breasts, el); + appendLabeledChoiceRow("Nipples", nipples, el); + appendLabeledChoiceRow("Butt", butt, el); + appendLabeledChoiceRow(slave.dick > 0 ? "Dick" : "Clit", dick, el); + appendLabeledChoiceRow("Balls", balls, el); + appendLabeledChoiceRow("Fertility", fertility, el); + appendLabeledChoiceRow("Hormones", hormones, el); + appendLabeledChoiceRow("Psych", psych, el); + appendLabeledChoiceRow("Misc", misc, el); - curativeOptions.push({text: `None`, updateSlave: {curatives: 0}}); - curativeOptions.push({text: `Preventatives`, updateSlave: {curatives: 1}}); - curativeOptions.push({text: `Curatives`, updateSlave: {curatives: 2}}); + return el; + } - let el = document.createElement('div'); - let title = document.createElement('div'); - title.append(`Health: `); - let chosenOption = document.createElement('span'); - chosenOption.style.fontWeight = "bold"; - if (slave.curatives > 1) { - chosenOption.textContent = `curatives`; - } else if (slave.curatives > 0) { - chosenOption.textContent = `preventatives`; - } else { - chosenOption.textContent = `none`; - } - title.appendChild(chosenOption); - title.append(`.`); - let link = document.createElement('div'); - link.className = "choices"; - link.appendChild(App.UI.SlaveInteract.generateRows(curativeOptions, slave, "", false, refresh)); - el.append(title); - el.append(link); - return el; + function curatives() { + const curativeOptions = []; + + curativeOptions.push({text: `None`, updateSlave: {curatives: 0}}); + curativeOptions.push({text: `Preventatives`, updateSlave: {curatives: 1}}); + curativeOptions.push({text: `Curatives`, updateSlave: {curatives: 2}}); + + let el = document.createElement('div'); + let title = document.createElement('div'); + title.append(`Health: `); + let chosenOption = document.createElement('span'); + chosenOption.style.fontWeight = "bold"; + if (slave.curatives > 1) { + chosenOption.textContent = `curatives`; + } else if (slave.curatives > 0) { + chosenOption.textContent = `preventatives`; + } else { + chosenOption.textContent = `none`; } + title.appendChild(chosenOption); + title.append(`.`); + let link = document.createElement('div'); + link.className = "choices"; + link.appendChild(App.UI.SlaveInteract.generateRows(curativeOptions, slave, "", false, refresh)); + el.append(title); + el.append(link); + return el; + } - function aphrodisiacs() { - const aphrodisiacOptions = []; - - aphrodisiacOptions.push({text: `None`, updateSlave: {aphrodisiacs: 0}}); - aphrodisiacOptions.push({text: `Aphrodisiacs`, updateSlave: {aphrodisiacs: 1}}); - aphrodisiacOptions.push({text: `Extreme aphrodisiacs`, updateSlave: {aphrodisiacs: 2}}); - aphrodisiacOptions.push({text: `Anaphrodisiacs`, updateSlave: {aphrodisiacs: -1}, note: `Suppresses libido`}); - - - let el = document.createElement('div'); - let title = document.createElement('div'); - title.append(`Aphrodisiacs: `); - let chosenOption = document.createElement('span'); - chosenOption.style.fontWeight = "bold"; - if (slave.aphrodisiacs > 1) { - chosenOption.textContent = `extreme`; - } else if (slave.aphrodisiacs > 0) { - chosenOption.textContent = `applied`; - } else if (slave.aphrodisiacs === -1) { - chosenOption.textContent = `anaphrodisiacs`; - } else { - chosenOption.textContent = `none`; - } - title.appendChild(chosenOption); - title.append(`.`); - let link = document.createElement('div'); - link.className = "choices"; - link.appendChild(App.UI.SlaveInteract.generateRows(aphrodisiacOptions, slave, "", false, refresh)); - el.append(title); - el.append(link); - return el; + function aphrodisiacs() { + const aphrodisiacOptions = []; + + aphrodisiacOptions.push({text: `None`, updateSlave: {aphrodisiacs: 0}}); + aphrodisiacOptions.push({text: `Aphrodisiacs`, updateSlave: {aphrodisiacs: 1}}); + aphrodisiacOptions.push({text: `Extreme aphrodisiacs`, updateSlave: {aphrodisiacs: 2}}); + aphrodisiacOptions.push({text: `Anaphrodisiacs`, updateSlave: {aphrodisiacs: -1}, note: `Suppresses libido`}); + + + let el = document.createElement('div'); + let title = document.createElement('div'); + title.append(`Aphrodisiacs: `); + let chosenOption = document.createElement('span'); + chosenOption.style.fontWeight = "bold"; + if (slave.aphrodisiacs > 1) { + chosenOption.textContent = `extreme`; + } else if (slave.aphrodisiacs > 0) { + chosenOption.textContent = `applied`; + } else if (slave.aphrodisiacs === -1) { + chosenOption.textContent = `anaphrodisiacs`; + } else { + chosenOption.textContent = `none`; } + title.appendChild(chosenOption); + title.append(`.`); + let link = document.createElement('div'); + link.className = "choices"; + link.appendChild(App.UI.SlaveInteract.generateRows(aphrodisiacOptions, slave, "", false, refresh)); + el.append(title); + el.append(link); + return el; + } - function fertility() { - let fertilityBlock = document.createElement('span'); - let linkArray = []; - if (slave.ovaries === 1 || slave.mpreg === 1 || slave.preg > 0) { - let note = ""; - if (slave.preg < -1) { - note += `${He} is sterile`; - } else if (slave.pubertyXX === 0 && slave.preg < 1) { - note += `${He} is not yet fertile`; - } else if (slave.ovaryAge >= 47 && slave.preg < 1) { - note += `${He} is too old to become pregnant`; - if (slave.preg === -1) { - slave.preg = 0; - SetBellySize(slave); - } - } else if (slave.broodmotherOnHold === 1) { - note += `${His} pregnancy implant is turned off`; - if (slave.broodmotherCountDown > 0) { - note += `${he} is expected to be completely emptied of ${his} remaining brood in ${slave.broodmotherCountDown} week`; - if (slave.broodmotherCountDown > 1) { - note += `s`; - } - note += `.`; - linkArray.push(App.UI.DOM.link( - `Turn on implant`, - () => { - slave.broodmotherOnHold = 0; - slave.broodmotherCountDown = 0; - refresh(); - }, - )); + function fertility() { + let fertilityBlock = document.createElement('span'); + let linkArray = []; + if (slave.ovaries === 1 || slave.mpreg === 1 || slave.preg > 0) { + let note = ""; + if (slave.preg < -1) { + note += `${He} is sterile`; + } else if (slave.pubertyXX === 0 && slave.preg < 1) { + note += `${He} is not yet fertile`; + } else if (slave.ovaryAge >= 47 && slave.preg < 1) { + note += `${He} is too old to become pregnant`; + if (slave.preg === -1) { + slave.preg = 0; + SetBellySize(slave); + } + } else if (slave.broodmotherOnHold === 1) { + note += `${His} pregnancy implant is turned off`; + if (slave.broodmotherCountDown > 0) { + note += `${he} is expected to be completely emptied of ${his} remaining brood in ${slave.broodmotherCountDown} week`; + if (slave.broodmotherCountDown > 1) { + note += `s`; } - } else if (slave.preg >= -1) { - fertilityBlock.append("Contraception and fertility: "); - let fertility = ""; - // fertility.id = "fertility"; - if (slave.preg === -1) { - fertility = "using contraceptives"; - } else if (slave.pregWeek < 0) { - fertility = "postpartum"; - } else if (slave.preg === 0) { - fertility = "fertile"; - } else if (slave.preg < 4 && (slave.broodmother === 0 || slave.broodmotherOnHold === 1)) { - fertility = "may be pregnant"; - } else if (slave.preg < 2) { - fertility = "1 week pregnant"; - } else { - fertility = `${Math.trunc(slave.preg * 1000) / 1000} weeks pregnant`; // * and / needed to avoid seeing something like 20.1000000008 in some cases. - if (slave.broodmother > 0) { - fertility += " broodmother"; - } + note += `.`; + linkArray.push(App.UI.DOM.link( + `Turn on implant`, + () => { + slave.broodmotherOnHold = 0; + slave.broodmotherCountDown = 0; + refresh(); + }, + )); + } + } else if (slave.preg >= -1) { + fertilityBlock.append("Contraception and fertility: "); + let fertility = ""; + // fertility.id = "fertility"; + if (slave.preg === -1) { + fertility = "using contraceptives"; + } else if (slave.pregWeek < 0) { + fertility = "postpartum"; + } else if (slave.preg === 0) { + fertility = "fertile"; + } else if (slave.preg < 4 && (slave.broodmother === 0 || slave.broodmotherOnHold === 1)) { + fertility = "may be pregnant"; + } else if (slave.preg < 2) { + fertility = "1 week pregnant"; + } else { + fertility = `${Math.trunc(slave.preg * 1000) / 1000} weeks pregnant`; // * and / needed to avoid seeing something like 20.1000000008 in some cases. + if (slave.broodmother > 0) { + fertility += " broodmother"; } - fertility += ". "; - App.UI.DOM.appendNewElement("span", fertilityBlock, fertility, "bold"); + } + fertility += ". "; + App.UI.DOM.appendNewElement("span", fertilityBlock, fertility, "bold"); - if (slave.preg === 0) { - linkArray.push(App.UI.DOM.link( - `Use contraceptives`, - () => { - slave.preg = -1; - refresh(); - }, - )); - } else if (slave.preg === -1) { - linkArray.push(App.UI.DOM.link( - `Let ${him} get pregnant`, - () => { - slave.preg = 0; - refresh(); - }, - )); - } else if (isInduced(slave)) { - note += `Hormones are being slipped into ${his} food; ${he} will give birth suddenly and rapidly this week`; - } else if ( - slave.preg > slave.pregData.normalBirth - 2 && + if (slave.preg === 0) { + linkArray.push(App.UI.DOM.link( + `Use contraceptives`, + () => { + slave.preg = -1; + refresh(); + }, + )); + } else if (slave.preg === -1) { + linkArray.push(App.UI.DOM.link( + `Let ${him} get pregnant`, + () => { + slave.preg = 0; + refresh(); + }, + )); + } else if (isInduced(slave)) { + note += `Hormones are being slipped into ${his} food; ${he} will give birth suddenly and rapidly this week`; + } else if ( + slave.preg > slave.pregData.normalBirth - 2 && slave.preg > slave.pregData.minLiveBirth && slave.broodmother === 0 && !isInLabor(slave) - ) { + ) { + linkArray.push(App.UI.DOM.link( + `Induce labor`, + () => { + induce(slave); + refresh(); + }, + )); + linkArray.push(App.UI.DOM.passageLink(`Give ${him} a cesarean section`, "csec")); + } else if (slave.broodmother > 0) { + if (slave.broodmotherOnHold !== 1) { linkArray.push(App.UI.DOM.link( - `Induce labor`, + `Turn off implant`, () => { - induce(slave); + slave.broodmotherOnHold = 1; + slave.broodmotherCountDown = 38 - WombMinPreg(slave); refresh(); }, )); - linkArray.push(App.UI.DOM.passageLink(`Give ${him} a cesarean section`, "csec")); - } else if (slave.broodmother > 0) { - if (slave.broodmotherOnHold !== 1) { - linkArray.push(App.UI.DOM.link( - `Turn off implant`, - () => { - slave.broodmotherOnHold = 1; - slave.broodmotherCountDown = 38 - WombMinPreg(slave); - refresh(); - }, - )); - } - if (slave.preg > 37) { - linkArray.push(App.UI.DOM.passageLink(`Induce mass childbirth`, "BirthStorm")); - } - } else if (slave.preg > slave.pregData.minLiveBirth) { - linkArray.push(App.UI.DOM.link( - `Give ${him} a cesarean section`, - () => { - slave.broodmotherOnHold = 0; - slave.broodmotherCountDown = 0; - }, - [], - "csec" - )); - } else if (slave.preg > 0 && slave.breedingMark === 1 && V.propOutcome === 1 && V.arcologies[0].FSRestart !== "unset" && V.eugenicsFullControl !== 1 && (slave.pregSource === -1 || slave.pregSource === -6)) { - note += "You are forbidden from aborting an Elite child"; - } else if (slave.preg > 0) { - linkArray.push(App.UI.DOM.link( - `Abort ${his} pregnancy`, - () => { - slave.broodmotherOnHold = 0; - slave.broodmotherCountDown = 0; - }, - [], - "Abort" - )); } + if (slave.preg > 37) { + linkArray.push(App.UI.DOM.passageLink(`Induce mass childbirth`, "BirthStorm")); + } + } else if (slave.preg > slave.pregData.minLiveBirth) { + linkArray.push(App.UI.DOM.link( + `Give ${him} a cesarean section`, + () => { + slave.broodmotherOnHold = 0; + slave.broodmotherCountDown = 0; + }, + [], + "csec" + )); + } else if (slave.preg > 0 && slave.breedingMark === 1 && V.propOutcome === 1 && V.arcologies[0].FSRestart !== "unset" && V.eugenicsFullControl !== 1 && (slave.pregSource === -1 || slave.pregSource === -6)) { + note += "You are forbidden from aborting an Elite child"; + } else if (slave.preg > 0) { + linkArray.push(App.UI.DOM.link( + `Abort ${his} pregnancy`, + () => { + slave.broodmotherOnHold = 0; + slave.broodmotherCountDown = 0; + }, + [], + "Abort" + )); } - App.UI.DOM.appendNewElement("span", fertilityBlock, note, "note"); - App.UI.DOM.appendNewElement("div", fertilityBlock, App.UI.DOM.generateLinksStrip(linkArray), "choices"); } - if ( - (slave.pregKnown === 1) && + App.UI.DOM.appendNewElement("span", fertilityBlock, note, "note"); + App.UI.DOM.appendNewElement("div", fertilityBlock, App.UI.DOM.generateLinksStrip(linkArray), "choices"); + } + if ( + (slave.pregKnown === 1) && (V.pregSpeedControl === 1) && ( slave.breedingMark !== 1 || @@ -479,563 +473,563 @@ App.UI.SlaveInteract.physicalRegimen = function(slave) { (slave.indentureRestrictions < 1) && (slave.broodmother === 0) && V.seePreg !== 0 - ) { - let title = document.createElement('div'); - let underline = document.createElement('span'); - underline.style.textDecoration = "underline"; - underline.textContent = "Pregnancy control"; - title.appendChild(underline); - title.append(": "); - - if (slave.pregControl === "labor suppressors") { - title.append("Labor is suppressed. "); - } else if (slave.pregControl === "slow gestation") { - title.append("Slowed gestation speed. "); - } else if (slave.pregControl === "speed up") { - title.append("Faster gestation speed, staffed clinic recommended. "); - } else { - title.append("Normal gestation and birth. "); - } - fertilityBlock.appendChild(title); + ) { + let title = document.createElement('div'); + let underline = document.createElement('span'); + underline.style.textDecoration = "underline"; + underline.textContent = "Pregnancy control"; + title.appendChild(underline); + title.append(": "); + + if (slave.pregControl === "labor suppressors") { + title.append("Labor is suppressed. "); + } else if (slave.pregControl === "slow gestation") { + title.append("Slowed gestation speed. "); + } else if (slave.pregControl === "speed up") { + title.append("Faster gestation speed, staffed clinic recommended. "); + } else { + title.append("Normal gestation and birth. "); + } + fertilityBlock.appendChild(title); - linkArray = []; - if (slave.pregControl !== "none") { + linkArray = []; + if (slave.pregControl !== "none") { + linkArray.push(App.UI.DOM.link( + `Normal ${slave.preg < slave.pregData.normalBirth ? "Gestation" : "Birth"}`, + () => { + slave.pregControl = "none"; + refresh(); + }, + )); + } + if (slave.preg < slave.pregData.normalBirth) { + if (slave.pregControl !== "slow gestation") { linkArray.push(App.UI.DOM.link( - `Normal ${slave.preg < slave.pregData.normalBirth ? "Gestation" : "Birth"}`, + `Slow Gestation`, () => { - slave.pregControl = "none"; + slave.pregControl = "slow gestation"; refresh(); }, )); } - if (slave.preg < slave.pregData.normalBirth) { - if (slave.pregControl !== "slow gestation") { - linkArray.push(App.UI.DOM.link( - `Slow Gestation`, - () => { - slave.pregControl = "slow gestation"; - refresh(); - }, - )); - } - if (slave.pregControl !== "speed up") { - linkArray.push(App.UI.DOM.link( - `Fast Gestation`, - () => { - slave.pregControl = "speed up"; - refresh(); - }, - )); - } + if (slave.pregControl !== "speed up") { + linkArray.push(App.UI.DOM.link( + `Fast Gestation`, + () => { + slave.pregControl = "speed up"; + refresh(); + }, + )); } - if (slave.preg >= slave.pregData.minLiveBirth) { - if (slave.pregControl !== "labor suppressors") { - linkArray.push(App.UI.DOM.link( - `Suppress Labor`, - () => { - slave.pregControl = "labor suppressors"; - refresh(); - }, - )); - } + } + if (slave.preg >= slave.pregData.minLiveBirth) { + if (slave.pregControl !== "labor suppressors") { + linkArray.push(App.UI.DOM.link( + `Suppress Labor`, + () => { + slave.pregControl = "labor suppressors"; + refresh(); + }, + )); } - App.UI.DOM.appendNewElement("div", fertilityBlock, App.UI.DOM.generateLinksStrip(linkArray), "choices"); } - return fertilityBlock; + App.UI.DOM.appendNewElement("div", fertilityBlock, App.UI.DOM.generateLinksStrip(linkArray), "choices"); } + return fertilityBlock; + } - function incubator() { - V.reservedChildren = FetusGlobalReserveCount("incubator"); - let _reservedIncubator = WombReserveCount(slave, "incubator"); - let _reservedNursery = WombReserveCount(slave, "nursery"); - let _WL = slave.womb.length; - let el = document.createElement('div'); - const linkArray = []; - - if (V.incubator > 0) { - if (slave.preg > 0 && slave.broodmother === 0 && slave.pregKnown === 1 && slave.eggType === "human") { - if ((slave.assignment !== Job.DAIRY || V.dairyPregSetting === 0) && (slave.assignment !== Job.FARMYARD || V.farmyardBreeding === 0)) { - let title = document.createElement('div'); - if (_WL - _reservedNursery === 0) { - title.textContent = `${His} children are already reserved for ${V.nurseryName}`; - title.style.fontStyle = "italic"; - } else { - const freeTanks = (V.incubator - V.tanks.length); - if (_reservedIncubator > 0) { - if (_WL === 1) { - title.textContent = `${His} child will be placed in ${V.incubatorName}. `; - } else if (_reservedIncubator < _WL) { - title.textContent = `${_reservedIncubator} of ${his} children will be placed in ${V.incubatorName}.`; - } else if (_WL === 2) { - title.textContent = `Both of ${his} children will be placed in ${V.incubatorName}. `; - } else { - title.textContent = `All ${_reservedIncubator} of ${his} children will be placed in ${V.incubatorName}. `; - } - if ((_reservedIncubator + _reservedNursery < _WL) && (V.reservedChildren < freeTanks)) { - linkArray.push( - App.UI.DOM.link(`Keep another child`, () => wombUpdateIncubator(1, true)) - ); - if (_reservedIncubator > 0) { - linkArray.push( - App.UI.DOM.link(`Keep one less child`, () => wombUpdateIncubator(1, false)) - ); - } - if (_reservedIncubator > 1) { - linkArray.push( - App.UI.DOM.link(`Keep none of ${his} children`, () => wombUpdateIncubator(9999, false)) - ); - } - if ((V.reservedChildren + _WL - _reservedIncubator) <= freeTanks) { - linkArray.push( - App.UI.DOM.link(`Keep the rest of ${his} children`, () => wombUpdateIncubator(9999, true)) - ); - } - } else if ((_reservedIncubator === _WL) || (V.reservedChildren === freeTanks) || (_reservedIncubator - _reservedNursery >= 0)) { + function incubator() { + V.reservedChildren = FetusGlobalReserveCount("incubator"); + let _reservedIncubator = WombReserveCount(slave, "incubator"); + let _reservedNursery = WombReserveCount(slave, "nursery"); + let _WL = slave.womb.length; + let el = document.createElement('div'); + const linkArray = []; + + if (V.incubator > 0) { + if (slave.preg > 0 && slave.broodmother === 0 && slave.pregKnown === 1 && slave.eggType === "human") { + if ((slave.assignment !== Job.DAIRY || V.dairyPregSetting === 0) && (slave.assignment !== Job.FARMYARD || V.farmyardBreeding === 0)) { + let title = document.createElement('div'); + if (_WL - _reservedNursery === 0) { + title.textContent = `${His} children are already reserved for ${V.nurseryName}`; + title.style.fontStyle = "italic"; + } else { + const freeTanks = (V.incubator - V.tanks.length); + if (_reservedIncubator > 0) { + if (_WL === 1) { + title.textContent = `${His} child will be placed in ${V.incubatorName}. `; + } else if (_reservedIncubator < _WL) { + title.textContent = `${_reservedIncubator} of ${his} children will be placed in ${V.incubatorName}.`; + } else if (_WL === 2) { + title.textContent = `Both of ${his} children will be placed in ${V.incubatorName}. `; + } else { + title.textContent = `All ${_reservedIncubator} of ${his} children will be placed in ${V.incubatorName}. `; + } + if ((_reservedIncubator + _reservedNursery < _WL) && (V.reservedChildren < freeTanks)) { + linkArray.push( + App.UI.DOM.link(`Keep another child`, () => wombUpdateIncubator(1, true)) + ); + if (_reservedIncubator > 0) { linkArray.push( App.UI.DOM.link(`Keep one less child`, () => wombUpdateIncubator(1, false)) ); - if (_reservedIncubator > 1) { - linkArray.push( - App.UI.DOM.link(`Keep none of ${his} children`, () => wombUpdateIncubator(9999, false)) - ); - } } - } else if (V.reservedChildren < freeTanks) { - title.textContent = `${He} is pregnant and you have `; - if (freeTanks === 1) { - title.textContent += `an `; + if (_reservedIncubator > 1) { + linkArray.push( + App.UI.DOM.link(`Keep none of ${his} children`, () => wombUpdateIncubator(9999, false)) + ); } - let tank = document.createElement('span'); - tank.className = "lime"; - tank.textContent = `available aging tank`; - if (freeTanks > 1) { - tank.textContent += `s`; + if ((V.reservedChildren + _WL - _reservedIncubator) <= freeTanks) { + linkArray.push( + App.UI.DOM.link(`Keep the rest of ${his} children`, () => wombUpdateIncubator(9999, true)) + ); } - tank.textContent += `.`; - let _cCount = (_WL > 1 ? "a" : "the"); + } else if ((_reservedIncubator === _WL) || (V.reservedChildren === freeTanks) || (_reservedIncubator - _reservedNursery >= 0)) { linkArray.push( - App.UI.DOM.link(`Keep ${_cCount} child`, () => wombUpdateIncubator(1, true)) + App.UI.DOM.link(`Keep one less child`, () => wombUpdateIncubator(1, false)) ); - title.appendChild(tank); - if ((_WL > 1) && (V.reservedChildren + _WL) <= freeTanks) { + if (_reservedIncubator > 1) { linkArray.push( - App.UI.DOM.link(`Keep all of ${his} children`, () => wombUpdateIncubator(9999, true)) + App.UI.DOM.link(`Keep none of ${his} children`, () => wombUpdateIncubator(9999, false)) ); } - } else if (V.reservedChildren === freeTanks) { - title.textContent = `You have no available tanks for ${his} children. `; } + } else if (V.reservedChildren < freeTanks) { + title.textContent = `${He} is pregnant and you have `; + if (freeTanks === 1) { + title.textContent += `an `; + } + let tank = document.createElement('span'); + tank.className = "lime"; + tank.textContent = `available aging tank`; + if (freeTanks > 1) { + tank.textContent += `s`; + } + tank.textContent += `.`; + let _cCount = (_WL > 1 ? "a" : "the"); + linkArray.push( + App.UI.DOM.link(`Keep ${_cCount} child`, () => wombUpdateIncubator(1, true)) + ); + title.appendChild(tank); + if ((_WL > 1) && (V.reservedChildren + _WL) <= freeTanks) { + linkArray.push( + App.UI.DOM.link(`Keep all of ${his} children`, () => wombUpdateIncubator(9999, true)) + ); + } + } else if (V.reservedChildren === freeTanks) { + title.textContent = `You have no available tanks for ${his} children. `; } - el.append(title); - App.UI.DOM.appendNewElement("div", el, App.UI.DOM.generateLinksStrip(linkArray), "choices"); } + el.append(title); + App.UI.DOM.appendNewElement("div", el, App.UI.DOM.generateLinksStrip(linkArray), "choices"); } } + } - function wombUpdateIncubator(count, addToWomb) { - if (addToWomb) { - WombAddToGenericReserve(slave, "incubator", count); - } else { - WombCleanGenericReserve(slave, "incubator", count); - } - V.reservedChildren = FetusGlobalReserveCount("incubator"); - refresh(); + function wombUpdateIncubator(count, addToWomb) { + if (addToWomb) { + WombAddToGenericReserve(slave, "incubator", count); + } else { + WombCleanGenericReserve(slave, "incubator", count); } - - return el; + V.reservedChildren = FetusGlobalReserveCount("incubator"); + refresh(); } - function nursery() { - let el = document.createElement('div'); - if (V.nursery > 0) { - V.reservedChildrenNursery = FetusGlobalReserveCount("nursery"); - let reservedIncubator = WombReserveCount(slave, "incubator"); - let reservedNursery = WombReserveCount(slave, "nursery"); - let _WL = slave.womb.length; - if (slave.preg > 0 && slave.broodmother === 0 && slave.pregKnown === 1 && slave.eggType === "human") { - if ((slave.assignment !== Job.DAIRY || V.dairyPregSetting === 0) && (slave.assignment !== Job.FARMYARD || V.farmyardBreeding === 0)) { - let title = document.createElement('div'); - const linkArray = []; - if (_WL - reservedIncubator === 0) { - V.reservedChildren = 0; - title.textContent = `${His} children are already reserved for ${V.incubatorName}`; - title.style.fontStyle = "italic"; - } else { - const freeCribs = (V.nursery - V.cribs.length); - if (reservedNursery > 0) { - if (_WL === 1) { - title.textContent = `${His} child will be placed in ${V.nurseryName}. `; - } else if (reservedNursery < _WL) { - title.textContent = `_reservedNursery of ${his} children will be placed in ${V.nurseryName}.`; - } else if (_WL === 2) { - title.textContent = `Both of ${his} children will be placed in ${V.nurseryName}. `; - } else { - title.textContent = `All ${reservedNursery} of ${his} children will be placed in ${V.nurseryName}. `; - } - if ((reservedIncubator + reservedNursery < _WL) && (V.reservedChildrenNursery < freeCribs)) { - linkArray.push( - App.UI.DOM.link(`Keep another child`, () => wombUpdateNursery(1, true)) - ); + return el; + } - if (reservedNursery > 0) { - linkArray.push( - App.UI.DOM.link(`Keep one less child`, () => wombUpdateNursery(1, false)) - ); - } - if (reservedNursery > 1) { - linkArray.push( - App.UI.DOM.link(`Keep none of ${his} children`, () => wombUpdateNursery(9999, false)) - ); - } - if ((V.reservedChildrenNursery + _WL - reservedNursery) <= freeCribs) { - linkArray.push( - App.UI.DOM.link(`Keep the rest of ${his} children`, () => wombUpdateNursery(9999, true)) - ); - } - } else if ((reservedNursery === _WL) || (V.reservedChildrenNursery === freeCribs) || (reservedNursery - reservedIncubator >= 0)) { + function nursery() { + let el = document.createElement('div'); + if (V.nursery > 0) { + V.reservedChildrenNursery = FetusGlobalReserveCount("nursery"); + let reservedIncubator = WombReserveCount(slave, "incubator"); + let reservedNursery = WombReserveCount(slave, "nursery"); + let _WL = slave.womb.length; + if (slave.preg > 0 && slave.broodmother === 0 && slave.pregKnown === 1 && slave.eggType === "human") { + if ((slave.assignment !== Job.DAIRY || V.dairyPregSetting === 0) && (slave.assignment !== Job.FARMYARD || V.farmyardBreeding === 0)) { + let title = document.createElement('div'); + const linkArray = []; + if (_WL - reservedIncubator === 0) { + V.reservedChildren = 0; + title.textContent = `${His} children are already reserved for ${V.incubatorName}`; + title.style.fontStyle = "italic"; + } else { + const freeCribs = (V.nursery - V.cribs.length); + if (reservedNursery > 0) { + if (_WL === 1) { + title.textContent = `${His} child will be placed in ${V.nurseryName}. `; + } else if (reservedNursery < _WL) { + title.textContent = `_reservedNursery of ${his} children will be placed in ${V.nurseryName}.`; + } else if (_WL === 2) { + title.textContent = `Both of ${his} children will be placed in ${V.nurseryName}. `; + } else { + title.textContent = `All ${reservedNursery} of ${his} children will be placed in ${V.nurseryName}. `; + } + if ((reservedIncubator + reservedNursery < _WL) && (V.reservedChildrenNursery < freeCribs)) { + linkArray.push( + App.UI.DOM.link(`Keep another child`, () => wombUpdateNursery(1, true)) + ); + + if (reservedNursery > 0) { linkArray.push( App.UI.DOM.link(`Keep one less child`, () => wombUpdateNursery(1, false)) ); - - if (reservedNursery > 1) { - linkArray.push( - App.UI.DOM.link(`Keep none of ${his} children`, () => wombUpdateNursery(9999, false)) - ); - } } - } else if (V.reservedChildrenNursery < freeCribs) { - title.textContent = `${He} is pregnant and you have `; - if (freeCribs === 1) { - title.textContent += `an `; + if (reservedNursery > 1) { + linkArray.push( + App.UI.DOM.link(`Keep none of ${his} children`, () => wombUpdateNursery(9999, false)) + ); } - let crib = document.createElement('span'); - crib.className = "lime"; - crib.textContent = `available room`; - if (freeCribs > 1) { - crib.textContent += `s`; + if ((V.reservedChildrenNursery + _WL - reservedNursery) <= freeCribs) { + linkArray.push( + App.UI.DOM.link(`Keep the rest of ${his} children`, () => wombUpdateNursery(9999, true)) + ); } - crib.textContent += `.`; - let _cCount = (_WL > 1 ? "a" : "the"); + } else if ((reservedNursery === _WL) || (V.reservedChildrenNursery === freeCribs) || (reservedNursery - reservedIncubator >= 0)) { linkArray.push( - App.UI.DOM.link(`Keep ${_cCount} child`, () => wombUpdateNursery(1, true)) + App.UI.DOM.link(`Keep one less child`, () => wombUpdateNursery(1, false)) ); - title.appendChild(crib); - if ((_WL > 1) && (V.reservedChildrenNursery + _WL) <= freeCribs) { + + if (reservedNursery > 1) { linkArray.push( - App.UI.DOM.link(`Keep all of ${his} children`, () => wombUpdateNursery(9999, true)) + App.UI.DOM.link(`Keep none of ${his} children`, () => wombUpdateNursery(9999, false)) ); } - } else if (V.reservedChildrenNursery === freeCribs) { - title.textContent = `You have no available rooms for ${his} children. `; } + } else if (V.reservedChildrenNursery < freeCribs) { + title.textContent = `${He} is pregnant and you have `; + if (freeCribs === 1) { + title.textContent += `an `; + } + let crib = document.createElement('span'); + crib.className = "lime"; + crib.textContent = `available room`; + if (freeCribs > 1) { + crib.textContent += `s`; + } + crib.textContent += `.`; + let _cCount = (_WL > 1 ? "a" : "the"); + linkArray.push( + App.UI.DOM.link(`Keep ${_cCount} child`, () => wombUpdateNursery(1, true)) + ); + title.appendChild(crib); + if ((_WL > 1) && (V.reservedChildrenNursery + _WL) <= freeCribs) { + linkArray.push( + App.UI.DOM.link(`Keep all of ${his} children`, () => wombUpdateNursery(9999, true)) + ); + } + } else if (V.reservedChildrenNursery === freeCribs) { + title.textContent = `You have no available rooms for ${his} children. `; } - el.append(title); - App.UI.DOM.appendNewElement("div", el, App.UI.DOM.generateLinksStrip(linkArray), "choices"); } + el.append(title); + App.UI.DOM.appendNewElement("div", el, App.UI.DOM.generateLinksStrip(linkArray), "choices"); } } + } - function wombUpdateNursery(count, addToWomb) { - if (addToWomb) { - WombAddToGenericReserve(slave, "nursery", count); - } else { - WombCleanGenericReserve(slave, "nursery", count); - } V.reservedChildren = FetusGlobalReserveCount("nursery"); - refresh(); - } + function wombUpdateNursery(count, addToWomb) { + if (addToWomb) { + WombAddToGenericReserve(slave, "nursery", count); + } else { + WombCleanGenericReserve(slave, "nursery", count); + } V.reservedChildren = FetusGlobalReserveCount("nursery"); + refresh(); + } - return el; + return el; + } + + function breederEligibility() { + const el = document.createElement("div"); + if (V.propOutcome === 1 && V.arcologies[0].FSRestart !== "unset") { + if (slave.breedingMark === 0 && slave.fuckdoll === 0 && slave.eggType === "human" && isFertile(slave) && slave.preg === 0) { + el.classList.add("choices"); + el.append( + App.UI.DOM.passageLink( + `Breeder Eligibility Exam`, + `BreedingTest` + ) + ); + } } + return el; + } - function breederEligibility() { - const el = document.createElement("div"); - if (V.propOutcome === 1 && V.arcologies[0].FSRestart !== "unset") { - if (slave.breedingMark === 0 && slave.fuckdoll === 0 && slave.eggType === "human" && isFertile(slave) && slave.preg === 0) { - el.classList.add("choices"); - el.append( - App.UI.DOM.passageLink( - `Breeder Eligibility Exam`, - `BreedingTest` - ) - ); - } + function bloating() { + let bloating = document.createElement('div'); + if (slave.inflation > 0) { + let intro = document.createElement('span'); + intro.textContent = "Required Bloating"; + intro.style.textDecoration = "underline"; + bloating.append(intro); + + bloating.append(": "); + + let requirement = document.createElement('span'); + requirement.style.fontWeight = "bold"; + requirement.id = "inflate"; + if (slave.inflation === 3) { + requirement.textContent = `${He} is required to keep 2 gallons of ${slave.inflationType} in ${him} at all times`; + } else if (slave.inflation === 2) { + requirement.textContent = `${He} is required to keep 4 liters of ${slave.inflationType} in ${him} at all times`; + } else if (slave.inflation === 1) { + requirement.textContent = `${He} is required to keep 2 liters of ${slave.inflationType} in ${him} at all times`; } - return el; + bloating.append(requirement); + bloating.append(". "); + + let link = App.UI.DOM.link( + `Let ${him} deflate`, + () => { + deflate(slave); + refresh(); + }, + ); + bloating.append(link); } + // make sure it updates itself after run + return bloating; + } - function bloating() { - let bloating = document.createElement('div'); - if (slave.inflation > 0) { - let intro = document.createElement('span'); - intro.textContent = "Required Bloating"; - intro.style.textDecoration = "underline"; - bloating.append(intro); - - bloating.append(": "); - - let requirement = document.createElement('span'); - requirement.style.fontWeight = "bold"; - requirement.id = "inflate"; - if (slave.inflation === 3) { - requirement.textContent = `${He} is required to keep 2 gallons of ${slave.inflationType} in ${him} at all times`; - } else if (slave.inflation === 2) { - requirement.textContent = `${He} is required to keep 4 liters of ${slave.inflationType} in ${him} at all times`; - } else if (slave.inflation === 1) { - requirement.textContent = `${He} is required to keep 2 liters of ${slave.inflationType} in ${him} at all times`; - } - bloating.append(requirement); - bloating.append(". "); + function hormones() { + let el = document.createElement('div'); + const options = []; + const level = []; - let link = App.UI.DOM.link( - `Let ${him} deflate`, - () => { - deflate(slave); - refresh(); - }, - ); - bloating.append(link); - } - // make sure it updates itself after run - return bloating; + if (slave.hormones !== 0) { + level.push({text: `None`, updateSlave: {hormones: 0}}); } - function hormones() { - let el = document.createElement('div'); - const options = []; - const level = []; + if (slave.indentureRestrictions < 2) { + options.push({text: `Intensive Female`, updateSlave: {hormones: 2}}); + } else { + options.push({text: `Intensive Female`, disabled: `Cannot use intensive hormones on indentured slaves`}); + } + options.push({text: `Female`, updateSlave: {hormones: 1}}); + options.push({text: `Male`, updateSlave: {hormones: -1}}); + if (slave.indentureRestrictions < 2) { + options.push({text: `Intensive Male`, updateSlave: {hormones: -2}}); + } else { + options.push({text: `Intensive Male`, disabled: `Cannot use intensive hormones on indentured slaves`}); + } - if (slave.hormones !== 0) { - level.push({text: `None`, updateSlave: {hormones: 0}}); + let title = document.createElement('div'); + title.textContent = `Hormones: `; + let choice = document.createElement('span'); + choice.style.fontWeight = "bold"; + switch (slave.hormones) { + case 2: { + choice.textContent = `intensive female. `; + break; } - - if (slave.indentureRestrictions < 2) { - options.push({text: `Intensive Female`, updateSlave: {hormones: 2}}); - } else { - options.push({text: `Intensive Female`, disabled: `Cannot use intensive hormones on indentured slaves`}); + case 1: { + choice.textContent = `female. `; + break; } - options.push({text: `Female`, updateSlave: {hormones: 1}}); - options.push({text: `Male`, updateSlave: {hormones: -1}}); - if (slave.indentureRestrictions < 2) { - options.push({text: `Intensive Male`, updateSlave: {hormones: -2}}); - } else { - options.push({text: `Intensive Male`, disabled: `Cannot use intensive hormones on indentured slaves`}); + case 0: { + choice.textContent = `none. `; + break; } - - let title = document.createElement('div'); - title.textContent = `Hormones: `; - let choice = document.createElement('span'); - choice.style.fontWeight = "bold"; - switch (slave.hormones) { - case 2: { - choice.textContent = `intensive female. `; - break; - } - case 1: { - choice.textContent = `female. `; - break; - } - case 0: { - choice.textContent = `none. `; - break; - } - case -1: { - choice.textContent = `male. `; - break; - } - case -2: { - choice.textContent = `intensive male. `; - break; - } - default: { - choice.textContent = `Not set. `; - } + case -1: { + choice.textContent = `male. `; + break; } + case -2: { + choice.textContent = `intensive male. `; + break; + } + default: { + choice.textContent = `Not set. `; + } + } - title.append(choice); - title.appendChild(App.UI.SlaveInteract.generateRows(level, slave, "", false, refresh)); - el.append(title); - - let links = document.createElement('div'); - links.appendChild(App.UI.SlaveInteract.generateRows(options, slave, "", false, refresh)); - links.className = "choices"; - el.append(links); + title.append(choice); + title.appendChild(App.UI.SlaveInteract.generateRows(level, slave, "", false, refresh)); + el.append(title); - return el; - } + let links = document.createElement('div'); + links.appendChild(App.UI.SlaveInteract.generateRows(options, slave, "", false, refresh)); + links.className = "choices"; + el.append(links); - function diet() { - let el = document.createElement('div'); + return el; + } - let title = document.createElement('div'); - title.textContent = `Diet: `; - let choice = document.createElement('span'); - choice.style.fontWeight = "bold"; - choice.textContent = `${capFirstChar(slave.diet)}. `; + function diet() { + let el = document.createElement('div'); - title.append(choice); - el.append(title); + let title = document.createElement('div'); + title.textContent = `Diet: `; + let choice = document.createElement('span'); + choice.style.fontWeight = "bold"; + choice.textContent = `${capFirstChar(slave.diet)}. `; - const health = []; - health.push({text: `Healthy`, updateSlave: {diet: "healthy"}}); - if (V.dietCleanse === 1) { - if (slave.health.condition < 90 || slave.chem >= 10) { - health.push({text: `Cleanse`, updateSlave: {diet: "cleansing"}}); - } else { - health.push({text: `Cleanse`, disabled: `${He} is already healthy`}); - } - } + title.append(choice); + el.append(title); - const weight = []; - if (slave.weight >= -95) { - weight.push({text: `Lose weight`, updateSlave: {diet: "restricted"}}); + const health = []; + health.push({text: `Healthy`, updateSlave: {diet: "healthy"}}); + if (V.dietCleanse === 1) { + if (slave.health.condition < 90 || slave.chem >= 10) { + health.push({text: `Cleanse`, updateSlave: {diet: "cleansing"}}); } else { - weight.push({text: `Lose weight`, disabled: `${He} is already underweight`}); - } - if (slave.fuckdoll === 0 && slave.fetish !== "mindbroken" && V.feeder === 1) { - if (slave.weight > 10 || slave.weight < -10) { - weight.push({text: `Correct weight`, updateSlave: {diet: "corrective"}}); - } else { - weight.push({text: `Correct weight`, disabled: `${He} is already a healthy weight`}); - } - } - if (slave.weight <= 200) { - weight.push({text: `Fatten`, updateSlave: {diet: "fattening"}}); - } else { - weight.push({text: `Fatten`, disabled: `${He} is already overweight`}); + health.push({text: `Cleanse`, disabled: `${He} is already healthy`}); } + } - const muscle = []; - if (slave.muscles < 100 && !isAmputee(slave)) { - muscle.push({text: `Build muscle`, updateSlave: {diet: "muscle building"}}); - } else if (!isAmputee(slave)) { - muscle.push({text: `Build muscle`, disabled: `${He} is maintaining ${his} enormous musculature`}); + const weight = []; + if (slave.weight >= -95) { + weight.push({text: `Lose weight`, updateSlave: {diet: "restricted"}}); + } else { + weight.push({text: `Lose weight`, disabled: `${He} is already underweight`}); + } + if (slave.fuckdoll === 0 && slave.fetish !== "mindbroken" && V.feeder === 1) { + if (slave.weight > 10 || slave.weight < -10) { + weight.push({text: `Correct weight`, updateSlave: {diet: "corrective"}}); } else { - muscle.push({text: `Build muscle`, disabled: `${He} has no limbs and thus can't effectively build muscle`}); + weight.push({text: `Correct weight`, disabled: `${He} is already a healthy weight`}); } + } + if (slave.weight <= 200) { + weight.push({text: `Fatten`, updateSlave: {diet: "fattening"}}); + } else { + weight.push({text: `Fatten`, disabled: `${He} is already overweight`}); + } - if ((slave.muscles > 0 || slave.fuckdoll === 0) && canWalk(slave)) { - muscle.push({text: `Slim down`, updateSlave: {diet: "slimming"}}); - } else if (!canWalk(slave)) { - muscle.push({text: `Slim down`, disabled: `${He} can't walk and thus can't trim down`}); - } else if (slave.fuckdoll > 0) { - muscle.push({text: `Slim down`, disabled: `${He} has no muscles left to lose`}); - } + const muscle = []; + if (slave.muscles < 100 && !isAmputee(slave)) { + muscle.push({text: `Build muscle`, updateSlave: {diet: "muscle building"}}); + } else if (!isAmputee(slave)) { + muscle.push({text: `Build muscle`, disabled: `${He} is maintaining ${his} enormous musculature`}); + } else { + muscle.push({text: `Build muscle`, disabled: `${He} has no limbs and thus can't effectively build muscle`}); + } - const production = []; - if (slave.balls > 0 && V.cumProDiet === 1) { - production.push({text: `Cum production`, updateSlave: {diet: "cum production"}}); - } - if (((isFertile(slave) && slave.preg === 0) || (slave.geneticQuirks.superfetation === 2 && canGetPregnant(slave) && V.geneticMappingUpgrade !== 0)) && V.dietFertility === 1) { - production.push({text: `Fertility`, updateSlave: {diet: "fertility"}}); - } + if ((slave.muscles > 0 || slave.fuckdoll === 0) && canWalk(slave)) { + muscle.push({text: `Slim down`, updateSlave: {diet: "slimming"}}); + } else if (!canWalk(slave)) { + muscle.push({text: `Slim down`, disabled: `${He} can't walk and thus can't trim down`}); + } else if (slave.fuckdoll > 0) { + muscle.push({text: `Slim down`, disabled: `${He} has no muscles left to lose`}); + } - const hormone = []; - if (V.feeder === 1) { - hormone.push({text: `Estrogen enriched`, updateSlave: {diet: "XX"}}); - hormone.push({text: `Testosterone enriched`, updateSlave: {diet: "XY"}}); - if (V.dietXXY === 1 && slave.balls > 0 && (slave.ovaries === 1 || slave.mpreg === 1)) { - hormone.push({text: `Herm hormone blend`, updateSlave: {diet: "XXY"}}); - } + const production = []; + if (slave.balls > 0 && V.cumProDiet === 1) { + production.push({text: `Cum production`, updateSlave: {diet: "cum production"}}); + } + if (((isFertile(slave) && slave.preg === 0) || (slave.geneticQuirks.superfetation === 2 && canGetPregnant(slave) && V.geneticMappingUpgrade !== 0)) && V.dietFertility === 1) { + production.push({text: `Fertility`, updateSlave: {diet: "fertility"}}); + } + + const hormone = []; + if (V.feeder === 1) { + hormone.push({text: `Estrogen enriched`, updateSlave: {diet: "XX"}}); + hormone.push({text: `Testosterone enriched`, updateSlave: {diet: "XY"}}); + if (V.dietXXY === 1 && slave.balls > 0 && (slave.ovaries === 1 || slave.mpreg === 1)) { + hormone.push({text: `Herm hormone blend`, updateSlave: {diet: "XXY"}}); } + } - appendLabeledChoiceRow("Health", health, el); - appendLabeledChoiceRow("Weight", weight, el); - appendLabeledChoiceRow("Muscle", muscle, el); - appendLabeledChoiceRow("Production", production, el); - appendLabeledChoiceRow("Hormone", hormone, el); + appendLabeledChoiceRow("Health", health, el); + appendLabeledChoiceRow("Weight", weight, el); + appendLabeledChoiceRow("Muscle", muscle, el); + appendLabeledChoiceRow("Production", production, el); + appendLabeledChoiceRow("Hormone", hormone, el); - return el; - } + return el; + } - function dietBase() { - let el = document.createElement('div'); - const milk = []; - const cum = []; + function dietBase() { + let el = document.createElement('div'); + const milk = []; + const cum = []; - // Milk + // Milk + if (slave.dietCum < 2) { + milk.push({text: `Milk added`, updateSlave: {dietMilk: 1}}); if (slave.dietCum < 2) { - milk.push({text: `Milk added`, updateSlave: {dietMilk: 1}}); - if (slave.dietCum < 2) { - milk.push({text: `Milk based`, updateSlave: {dietMilk: 2, dietCum: 0}}); - } - if (slave.dietMilk) { - milk.push({text: `Remove milk`, updateSlave: {dietMilk: 0}}); - } - } else { - milk.push({text: `Milk`, disabled: `Diet is based entirely on cum`}); + milk.push({text: `Milk based`, updateSlave: {dietMilk: 2, dietCum: 0}}); } + if (slave.dietMilk) { + milk.push({text: `Remove milk`, updateSlave: {dietMilk: 0}}); + } + } else { + milk.push({text: `Milk`, disabled: `Diet is based entirely on cum`}); + } - // Cum - if (slave.dietMilk < 2) { - cum.push({text: `Cum added`, updateSlave: {dietCum: 1}}); - cum.push({text: `Cum based`, updateSlave: {dietCum: 2, dietMilk: 0}}); - if (slave.dietCum) { - cum.push({text: `Remove cum`, updateSlave: {dietCum: 0}}); - } - } else { - cum.push({text: `Cum`, disabled: `Diet is based entirely on milk`}); + // Cum + if (slave.dietMilk < 2) { + cum.push({text: `Cum added`, updateSlave: {dietCum: 1}}); + cum.push({text: `Cum based`, updateSlave: {dietCum: 2, dietMilk: 0}}); + if (slave.dietCum) { + cum.push({text: `Remove cum`, updateSlave: {dietCum: 0}}); } + } else { + cum.push({text: `Cum`, disabled: `Diet is based entirely on milk`}); + } + let title = document.createElement('div'); + title.textContent = `Diet base: `; + let choice = document.createElement('span'); + choice.style.fontWeight = "bold"; + if (slave.dietCum === 2) { + choice.textContent = `cum based. `; + } else if (slave.dietCum === 1 && slave.dietMilk === 0) { + choice.textContent = `cum added. `; + } else if (slave.dietCum === 1 && slave.dietMilk === 1) { + choice.textContent = `cum and milk added. `; + } else if (slave.dietMilk === 1 && slave.dietCum === 0) { + choice.textContent = `milk added. `; + } else if (slave.dietMilk === 2) { + choice.textContent = `milk based. `; + } else if (slave.dietCum === 0 && slave.dietMilk === 0) { + choice.textContent = `normal. `; + } else { + choice.textContent = `THERE HAS BEEN AN ERROR.`; + } + + title.append(choice); + el.append(title); + + appendLabeledChoiceRow("Milk", milk, el); + appendLabeledChoiceRow("Cum", cum, el); + + return el; + } + + function snacks() { + let el = document.createElement('div'); + let options = []; + + if (V.arcologies[0].FSHedonisticDecadenceResearch === 1) { let title = document.createElement('div'); - title.textContent = `Diet base: `; + title.textContent = `Solid Slave Food Access: `; let choice = document.createElement('span'); choice.style.fontWeight = "bold"; - if (slave.dietCum === 2) { - choice.textContent = `cum based. `; - } else if (slave.dietCum === 1 && slave.dietMilk === 0) { - choice.textContent = `cum added. `; - } else if (slave.dietCum === 1 && slave.dietMilk === 1) { - choice.textContent = `cum and milk added. `; - } else if (slave.dietMilk === 1 && slave.dietCum === 0) { - choice.textContent = `milk added. `; - } else if (slave.dietMilk === 2) { - choice.textContent = `milk based. `; - } else if (slave.dietCum === 0 && slave.dietMilk === 0) { - choice.textContent = `normal. `; + if (slave.onDiet === 0) { + choice.textContent = `Free to stuff ${himself}.`; } else { - choice.textContent = `THERE HAS BEEN AN ERROR.`; + choice.textContent = `On a strict diet.`; } - title.append(choice); el.append(title); - appendLabeledChoiceRow("Milk", milk, el); - appendLabeledChoiceRow("Cum", cum, el); + options.push({text: `No access`, updateSlave: {onDiet: 1}}); + options.push({text: `Full access`, updateSlave: {onDiet: 0}}); - return el; + let links = document.createElement('div'); + links.appendChild(App.UI.SlaveInteract.generateRows(options, slave, "", false, refresh)); + links.className = "choices"; + el.append(links); } - function snacks() { - let el = document.createElement('div'); - let options = []; - - if (V.arcologies[0].FSHedonisticDecadenceResearch === 1) { - let title = document.createElement('div'); - title.textContent = `Solid Slave Food Access: `; - let choice = document.createElement('span'); - choice.style.fontWeight = "bold"; - if (slave.onDiet === 0) { - choice.textContent = `Free to stuff ${himself}.`; - } else { - choice.textContent = `On a strict diet.`; - } - title.append(choice); - el.append(title); - - options.push({text: `No access`, updateSlave: {onDiet: 1}}); - options.push({text: `Full access`, updateSlave: {onDiet: 0}}); - - let links = document.createElement('div'); - links.appendChild(App.UI.SlaveInteract.generateRows(options, slave, "", false, refresh)); - links.className = "choices"; - el.append(links); - } - - return el; - } + return el; } + function refresh() { - jQuery("#si-physical-regimen").empty().append(physicalRegimenContent()); + jQuery("#content-physical-regimen").empty().append(App.UI.SlaveInteract.physicalRegimen(slave)); } /** Append a simple row of choices with a label to a container, if there are choices to be made. diff --git a/src/interaction/siRules.js b/src/interaction/siRules.js index c43959518f861d610e2027f163a8c3bda240b39d..01e7aca2e809be6bb26277b32ce298be083e2a0f 100644 --- a/src/interaction/siRules.js +++ b/src/interaction/siRules.js @@ -1,454 +1,447 @@ App.UI.SlaveInteract.rules = function(slave) { - const el = document.createElement("div"); - el.id = "si-rules"; - el.append(rulesContent()); - return el; - - function rulesContent() { - const frag = new DocumentFragment(); - let p; - let div; - let array; - let choices; - const { - He, His, - he, him, his, himself - } = getPronouns(slave); - - if (V.seePreg !== 0) { - if (V.universalRulesImpregnation === "PC") { - updateBreederLink("you", "PCExclude"); - } else if (V.universalRulesImpregnation === "HG") { - updateBreederLink("the Head Girl", "HGExclude"); - } else if (V.universalRulesImpregnation === "Stud") { - updateBreederLink("your Stud", "StudExclude"); - } - } - - function updateBreederLink(breeder, exclude) { - p = document.createElement('p'); - const exempt = slave[exclude] ? "Exempt" : "Include"; - - p.append(`Will be bred by ${breeder} when fertile. `); - p.append( - App.UI.DOM.link(`${exempt} ${him}`, () => { - slave[exclude] = slave[exclude] ^ 1; // switch 0 and 1 - refresh(); - }) - ); - frag.append(p); + const frag = new DocumentFragment(); + let p; + let div; + let array; + let choices; + const { + He, His, + he, him, his, himself + } = getPronouns(slave); + + if (V.seePreg !== 0) { + if (V.universalRulesImpregnation === "PC") { + updateBreederLink("you", "PCExclude"); + } else if (V.universalRulesImpregnation === "HG") { + updateBreederLink("the Head Girl", "HGExclude"); + } else if (V.universalRulesImpregnation === "Stud") { + updateBreederLink("your Stud", "StudExclude"); } + } + function updateBreederLink(breeder, exclude) { p = document.createElement('p'); + const exempt = slave[exclude] ? "Exempt" : "Include"; + + p.append(`Will be bred by ${breeder} when fertile. `); + p.append( + App.UI.DOM.link(`${exempt} ${him}`, () => { + slave[exclude] = slave[exclude] ^ 1; // switch 0 and 1 + refresh(); + }) + ); + frag.append(p); + } - array = []; - if (slave.useRulesAssistant === 0) { - App.UI.DOM.appendNewElement("span", p, `Not subject `, ["bold", "gray"]); - App.UI.DOM.appendNewElement("span", p, `to the Rules Assistant.`, "gray"); - array.push( - App.UI.DOM.link( - `Include ${him}`, - () => { - slave.useRulesAssistant = 1; - refresh(); - } - ) - ); - } else { - App.UI.DOM.appendNewElement("h3", p, `Rules Assistant`); - - if (slave.hasOwnProperty("currentRules") && slave.currentRules.length > 0) { - const ul = document.createElement("UL"); - ul.style.margin = "0"; - V.defaultRules.filter( - x => ruleApplied(slave, x) - ).map( - x => { - const li = document.createElement('li'); - li.append(x.name); - ul.append(li); - } - ); - - // set up rules display - if ($("ul").has("li").length) { - App.UI.DOM.appendNewElement("div", p, `Rules applied: `); - p.append(ul); - } else { - App.UI.DOM.appendNewElement("div", p, `There are no rules that would apply to ${him}.`, "gray"); + p = document.createElement('p'); + + array = []; + if (slave.useRulesAssistant === 0) { + App.UI.DOM.appendNewElement("span", p, `Not subject `, ["bold", "gray"]); + App.UI.DOM.appendNewElement("span", p, `to the Rules Assistant.`, "gray"); + array.push( + App.UI.DOM.link( + `Include ${him}`, + () => { + slave.useRulesAssistant = 1; + refresh(); + } + ) + ); + } else { + App.UI.DOM.appendNewElement("h3", p, `Rules Assistant`); + + if (slave.hasOwnProperty("currentRules") && slave.currentRules.length > 0) { + const ul = document.createElement("UL"); + ul.style.margin = "0"; + V.defaultRules.filter( + x => ruleApplied(slave, x) + ).map( + x => { + const li = document.createElement('li'); + li.append(x.name); + ul.append(li); } - } - array.push( - App.UI.DOM.link( - `Apply rules`, - () => { - DefaultRules(slave); - refresh(); - } - ) - ); - array.push( - App.UI.DOM.link( - `Exempt ${him}`, - () => { - slave.useRulesAssistant = 0; - refresh(); - } - ) ); - array.push(App.UI.DOM.passageLink("Rules Assistant Options", "Rules Assistant")); - } - p.append(App.UI.DOM.generateLinksStrip(array)); - frag.append(p); - - p = document.createElement('p'); - App.UI.DOM.appendNewElement("h3", p, `Other Rules`); - // Living - if (slave.fuckdoll > 0) { - App.UI.DOM.appendNewElement("span", p, "Rules have little meaning for living sex toys", "note"); - } else { - penthouseCensus(); - p.append("Living standard: "); - } - if (setup.facilityCareers.includes(slave.assignment)) { - App.UI.DOM.appendNewElement("span", p, ` ${His} living conditions are managed by ${his} assignment.`, "note"); - } else if ((slave.assignment === "be your Head Girl") && (V.HGSuite === 1)) { - App.UI.DOM.appendNewElement("span", p, ` ${He} has ${his} own little luxurious room in the penthouse with everything ${he} needs to be a proper Head Girl.`, "note"); - } else if ((slave.assignment === "guard you") && (V.dojo > 1)) { - App.UI.DOM.appendNewElement("span", p, ` ${He} has a comfortable room in the armory to call ${his} own.`, "note"); - } else { - choices = [ - {value: "spare"}, - {value: "normal"}, - ]; - if (canMoveToRoom(slave) || slave.rules.living === "luxurious") { - choices.push({value: "luxurious"}); + // set up rules display + if ($("ul").has("li").length) { + App.UI.DOM.appendNewElement("div", p, `Rules applied: `); + p.append(ul); } else { - choices.push({ - title: `Luxurious`, - disabled: ["No luxurious rooms available"] - }); + App.UI.DOM.appendNewElement("div", p, `There are no rules that would apply to ${him}.`, "gray"); } - - p.append(listChoices(choices, "living")); } - - // Rest - if (["be a servant", "be a subordinate slave", "get milked", "please you", "serve in the club", "serve the public", "whore", "work as a farmhand", "work in the brothel", "work a glory hole"].includes(slave.assignment) || (V.dairyRestraintsSetting < 2 && slave.assignment === "work in the dairy")) { - div = document.createElement("div"); - div.append("Sleep rules: "); - choices = [ - {value: "none"}, - {value: "cruel"}, - {value: "restrictive"}, - {value: "permissive"}, - {value: "mandatory"}, - ]; - div.append(listChoices(choices, "rest")); - p.append(div); + array.push( + App.UI.DOM.link( + `Apply rules`, + () => { + DefaultRules(slave); + refresh(); + } + ) + ); + array.push( + App.UI.DOM.link( + `Exempt ${him}`, + () => { + slave.useRulesAssistant = 0; + refresh(); + } + ) + ); + array.push(App.UI.DOM.passageLink("Rules Assistant Options", "Rules Assistant")); + } + p.append(App.UI.DOM.generateLinksStrip(array)); + frag.append(p); + + p = document.createElement('p'); + App.UI.DOM.appendNewElement("h3", p, `Other Rules`); + + // Living + if (slave.fuckdoll > 0) { + App.UI.DOM.appendNewElement("span", p, "Rules have little meaning for living sex toys", "note"); + } else { + penthouseCensus(); + p.append("Living standard: "); + } + if (setup.facilityCareers.includes(slave.assignment)) { + App.UI.DOM.appendNewElement("span", p, ` ${His} living conditions are managed by ${his} assignment.`, "note"); + } else if ((slave.assignment === "be your Head Girl") && (V.HGSuite === 1)) { + App.UI.DOM.appendNewElement("span", p, ` ${He} has ${his} own little luxurious room in the penthouse with everything ${he} needs to be a proper Head Girl.`, "note"); + } else if ((slave.assignment === "guard you") && (V.dojo > 1)) { + App.UI.DOM.appendNewElement("span", p, ` ${He} has a comfortable room in the armory to call ${his} own.`, "note"); + } else { + choices = [ + {value: "spare"}, + {value: "normal"}, + ]; + if (canMoveToRoom(slave) || slave.rules.living === "luxurious") { + choices.push({value: "luxurious"}); + } else { + choices.push({ + title: `Luxurious`, + disabled: ["No luxurious rooms available"] + }); } - // Mobility Aids - if (slave.fuckdoll > 0) { - // Sex toys don't move around on their own// - } else if (!canWalk(slave) && canMove(slave)) { - div = document.createElement("div"); - div.append("Use of mobility aids: "); - choices = [ - {value: "restrictive"}, - {value: "permissive"}, - ]; - div.append(listChoices(choices, "mobility")); - p.append(div); - } + p.append(listChoices(choices, "living")); + } - // Punishment + // Rest + if (["be a servant", "be a subordinate slave", "get milked", "please you", "serve in the club", "serve the public", "whore", "work as a farmhand", "work in the brothel", "work a glory hole"].includes(slave.assignment) || (V.dairyRestraintsSetting < 2 && slave.assignment === "work in the dairy")) { div = document.createElement("div"); - div.append("Typical punishment: "); + div.append("Sleep rules: "); choices = [ - {value: "confinement"}, - {value: "whipping"}, - {value: "chastity"}, - {value: "situational"}, + {value: "none"}, + {value: "cruel"}, + {value: "restrictive"}, + {value: "permissive"}, + {value: "mandatory"}, ]; - div.append(listChoices(choices, "punishment")); + div.append(listChoices(choices, "rest")); p.append(div); + } - // Reward + // Mobility Aids + if (slave.fuckdoll > 0) { + // Sex toys don't move around on their own// + } else if (!canWalk(slave) && canMove(slave)) { div = document.createElement("div"); - div.append("Typical reward: "); + div.append("Use of mobility aids: "); choices = [ - {value: "relaxation"}, - {value: "drugs"}, - {value: "orgasm"}, - {value: "situational"}, + {value: "restrictive"}, + {value: "permissive"}, ]; - div.append(listChoices(choices, "reward")); + div.append(listChoices(choices, "mobility")); p.append(div); + } - // Lactation - if (slave.lactation !== 2) { - div = document.createElement("div"); - div.append("Lactation maintenance: "); - choices = [ + // Punishment + div = document.createElement("div"); + div.append("Typical punishment: "); + choices = [ + {value: "confinement"}, + {value: "whipping"}, + {value: "chastity"}, + {value: "situational"}, + ]; + div.append(listChoices(choices, "punishment")); + p.append(div); + + // Reward + div = document.createElement("div"); + div.append("Typical reward: "); + choices = [ + {value: "relaxation"}, + {value: "drugs"}, + {value: "orgasm"}, + {value: "situational"}, + ]; + div.append(listChoices(choices, "reward")); + p.append(div); + + // Lactation + if (slave.lactation !== 2) { + div = document.createElement("div"); + div.append("Lactation maintenance: "); + choices = [ + { + title: "Left alone", + value: "none", + }, + ]; + + if (slave.lactation === 0) { + choices.push( { - title: "Left alone", - value: "none", - }, - ]; - - if (slave.lactation === 0) { - choices.push( - { - title: "Induce lactation", - value: "induce", - } - ); - } else { - choices.push( - { - title: "Maintain lactation", - value: "maintain", - } - ); - } - div.append(listChoices(choices, "lactation")); - p.append(div); + title: "Induce lactation", + value: "induce", + } + ); + } else { + choices.push( + { + title: "Maintain lactation", + value: "maintain", + } + ); } + div.append(listChoices(choices, "lactation")); + p.append(div); + } - p.append(orgasm(slave)); - - if (slave.voice !== 0) { - div = document.createElement("div"); - div.append("Speech rules: "); - choices = [ - {value: "restrictive"}, - {value: "permissive"}, - ]; - if (slave.accent > 0 && slave.accent < 4) { - choices.push( - {value: "accent elimination"}, - ); - } else if (slave.accent > 3) { - choices.push( - {value: "language lessons"}, - ); - } - div.append(listChoices(choices, "speech")); - p.append(div); - } + p.append(orgasm(slave)); + if (slave.voice !== 0) { div = document.createElement("div"); - div.append("Relationship rules: "); + div.append("Speech rules: "); choices = [ {value: "restrictive"}, - {value: "just friends"}, {value: "permissive"}, ]; - div.append(listChoices(choices, "relationship")); + if (slave.accent > 0 && slave.accent < 4) { + choices.push( + {value: "accent elimination"}, + ); + } else if (slave.accent > 3) { + choices.push( + {value: "language lessons"}, + ); + } + div.append(listChoices(choices, "speech")); p.append(div); + } - p.append(smartSettings(slave)); - frag.append(p); - return frag; - - function listChoices(choices, property) { - const links = []; - for (const c of choices) { - const title = c.title || capFirstChar(c.value); - if (c.disabled) { - links.push( - App.UI.DOM.disabledLink( - title, c.disabled - ) - ); - } else if (slave.rules[property] === c.value) { - links.push( - App.UI.DOM.disabledLink( - title, - ["Current Setting"] - ) - ); + div = document.createElement("div"); + div.append("Relationship rules: "); + choices = [ + {value: "restrictive"}, + {value: "just friends"}, + {value: "permissive"}, + ]; + div.append(listChoices(choices, "relationship")); + p.append(div); + + p.append(smartSettings(slave)); + frag.append(p); + return frag; + + function listChoices(choices, property) { + const links = []; + for (const c of choices) { + const title = c.title || capFirstChar(c.value); + if (c.disabled) { + links.push( + App.UI.DOM.disabledLink( + title, c.disabled + ) + ); + } else if (slave.rules[property] === c.value) { + links.push( + App.UI.DOM.disabledLink( + title, + ["Current Setting"] + ) + ); + } else { + links.push( + App.UI.DOM.link( + title, + () => { + slave.rules[property] = c.value; + refresh(); + } + ) + ); + } + } + return App.UI.DOM.generateLinksStrip(links); + } + function orgasm(slave) { + let el = document.createElement('div'); + + let title = document.createElement('div'); + title.textContent = `Non-assignment orgasm rules: `; + el.append(title); + + const choices = [ + { + title: "Masturbation", + value: "masturbation", + note: `Controls whether ${he} is allowed to pleasure ${himself}, should ${he} feel the need` + }, + { + title: "Partner", + value: "partner", + note: `Controls whether ${he} is allowed sexual contact with ${his} romantic partner, should you permit ${him} to have one` + }, + { + title: "Facility Leader", + value: "facilityLeader", + note: `Controls whether development facility leaders (Nurse, Attendant, etc) are allowed to satisfy ${his} sexual needs while ${he} is assigned to their facility; does not apply to production facilities` + }, + { + title: "Family", + value: "family", + note: `Controls whether ${he} is allowed sexual contact with close family members` + }, + { + title: "Other slaves", + value: "slaves", + note: `Controls whether ${he} is allowed sexual contact with your other slaves that do not fit any of the above categories` + }, + { + title: "Master", + value: "master", + note: `Controls whether you will fuck ${him} personally when ${he} needs it`, + master: true + }, + ]; + + for (const orgasmObj of choices) { + const row = document.createElement("div"); + row.classList.add("choices"); + row.append(`${orgasmObj.title}: `); + row.append(makeLinks(orgasmObj)); + App.UI.DOM.appendNewElement("span", row, ` ${orgasmObj.note}`, "note"); + el.append(row); + } + + return el; + + function makeLinks(orgasmObj) { + const linkArray = []; + makeALink(1); + makeALink(0); + + return App.UI.DOM.generateLinksStrip(linkArray); + + function makeALink(onOff) { + const allow = orgasmObj.master ? `Grant` : `Allow`; + const forbid = orgasmObj.master ? `Deny` : `Forbid`; + const title = onOff ? allow : forbid; + if (slave.rules.release[orgasmObj.value] === onOff) { + linkArray.push(App.UI.DOM.makeElement("span", title, "bold")); } else { - links.push( + linkArray.push( App.UI.DOM.link( title, () => { - slave.rules[property] = c.value; + slave.rules.release[orgasmObj.value] = onOff; refresh(); } ) ); } } - return App.UI.DOM.generateLinksStrip(links); } - function orgasm(slave) { - let el = document.createElement('div'); - - let title = document.createElement('div'); - title.textContent = `Non-assignment orgasm rules: `; - el.append(title); + } - const choices = [ - { - title: "Masturbation", - value: "masturbation", - note: `Controls whether ${he} is allowed to pleasure ${himself}, should ${he} feel the need` - }, - { - title: "Partner", - value: "partner", - note: `Controls whether ${he} is allowed sexual contact with ${his} romantic partner, should you permit ${him} to have one` - }, - { - title: "Facility Leader", - value: "facilityLeader", - note: `Controls whether development facility leaders (Nurse, Attendant, etc) are allowed to satisfy ${his} sexual needs while ${he} is assigned to their facility; does not apply to production facilities` - }, - { - title: "Family", - value: "family", - note: `Controls whether ${he} is allowed sexual contact with close family members` - }, - { - title: "Other slaves", - value: "slaves", - note: `Controls whether ${he} is allowed sexual contact with your other slaves that do not fit any of the above categories` - }, - { - title: "Master", - value: "master", - note: `Controls whether you will fuck ${him} personally when ${he} needs it`, - master: true - }, - ]; - - for (const orgasmObj of choices) { - const row = document.createElement("div"); - row.classList.add("choices"); - row.append(`${orgasmObj.title}: `); - row.append(makeLinks(orgasmObj)); - App.UI.DOM.appendNewElement("span", row, ` ${orgasmObj.note}`, "note"); - el.append(row); + function smartSettings(slave) { + let el = document.createElement('div'); + const usingBulletVibe = slave.vaginalAccessory === "smart bullet vibrator" || slave.dickAccessory === "smart bullet vibrator"; + + if (slave.clitPiercing === 3 || usingBulletVibe) { + const level = new Map(); + const bodyPart = new Map(); + const BDSM = new Map(); + const gender = new Map(); + + // Level + level.set(`No sex`, `none`); + level.set(`All sex`, `all`); + + // Body part + bodyPart.set(`Vanilla`, `vanilla`); + bodyPart.set(`Oral`, `oral`); + bodyPart.set(`Anal`, `anal`); + bodyPart.set(`Boobs`, `boobs`); + if (V.seePreg !== 0) { + bodyPart.set(`Preg`, `pregnancy`); } - - return el; - - function makeLinks(orgasmObj) { - const linkArray = []; - makeALink(1); - makeALink(0); - - return App.UI.DOM.generateLinksStrip(linkArray); - - function makeALink(onOff) { - const allow = orgasmObj.master ? `Grant` : `Allow`; - const forbid = orgasmObj.master ? `Deny` : `Forbid`; - const title = onOff ? allow : forbid; - if (slave.rules.release[orgasmObj.value] === onOff) { - linkArray.push(App.UI.DOM.makeElement("span", title, "bold")); - } else { - linkArray.push( - App.UI.DOM.link( - title, - () => { - slave.rules.release[orgasmObj.value] = onOff; - refresh(); - } - ) - ); - } - } + // BDSM + BDSM.set(`Sub`, `submissive`); + BDSM.set(`Dom`, `dom`); + BDSM.set(`Masochism`, `masochist`); + BDSM.set(`Sadism`, `sadist`); + BDSM.set(`Humiliation`, `humiliation`); + + // Gender + gender.set(`Men`, `men`); + gender.set(`Women`, `women`); + gender.set(`Anti-men`, `anti-men`); + gender.set(`Anti-women`, `anti-women`); + let label = null; + if (slave.clitPiercing === 3) { + label = `Smart ${slave.dick < 1 ? "clit" : "frenulum"} piercing `; + label += (usingBulletVibe) ? `and smart bullet vibrator setting: ` : `setting: `; + } else if (usingBulletVibe) { + label = `Smart bullet vibrator setting: `; } + let title = App.UI.DOM.appendNewElement('div', el, label); + let selected = App.UI.DOM.appendNewElement('span', title, `${slave.clitSetting}. `); + selected.style.fontWeight = "bold"; + + choices("Level", level); + choices("Body part", bodyPart); + choices("Body part", BDSM); + choices("Gender", gender); } - function smartSettings(slave) { - let el = document.createElement('div'); - const usingBulletVibe = slave.vaginalAccessory === "smart bullet vibrator" || slave.dickAccessory === "smart bullet vibrator"; - - if (slave.clitPiercing === 3 || usingBulletVibe) { - const level = new Map(); - const bodyPart = new Map(); - const BDSM = new Map(); - const gender = new Map(); - - // Level - level.set(`No sex`, `none`); - level.set(`All sex`, `all`); - - // Body part - bodyPart.set(`Vanilla`, `vanilla`); - bodyPart.set(`Oral`, `oral`); - bodyPart.set(`Anal`, `anal`); - bodyPart.set(`Boobs`, `boobs`); - if (V.seePreg !== 0) { - bodyPart.set(`Preg`, `pregnancy`); - } - // BDSM - BDSM.set(`Sub`, `submissive`); - BDSM.set(`Dom`, `dom`); - BDSM.set(`Masochism`, `masochist`); - BDSM.set(`Sadism`, `sadist`); - BDSM.set(`Humiliation`, `humiliation`); - - // Gender - gender.set(`Men`, `men`); - gender.set(`Women`, `women`); - gender.set(`Anti-men`, `anti-men`); - gender.set(`Anti-women`, `anti-women`); - let label = null; - if (slave.clitPiercing === 3) { - label = `Smart ${slave.dick < 1 ? "clit" : "frenulum"} piercing `; - label += (usingBulletVibe) ? `and smart bullet vibrator setting: ` : `setting: `; - } else if (usingBulletVibe) { - label = `Smart bullet vibrator setting: `; - } - let title = App.UI.DOM.appendNewElement('div', el, label); - let selected = App.UI.DOM.appendNewElement('span', title, `${slave.clitSetting}. `); - selected.style.fontWeight = "bold"; - - choices("Level", level); - choices("Body part", bodyPart); - choices("Body part", BDSM); - choices("Gender", gender); - } + return el; + + function choices(title, map) { + const row = document.createElement("div"); + row.classList.add("choices"); + row.append(`${title}: `); - return el; - - function choices(title, map) { - const row = document.createElement("div"); - row.classList.add("choices"); - row.append(`${title}: `); - - const linkArray = []; - for (const [text, value] of map) { - if (slave.clitSetting === value) { - linkArray.push( - App.UI.DOM.disabledLink( - text, - ["Currently selected"] - ) - ); - } else { - linkArray.push( - App.UI.DOM.link( - text, - () => { - slave.clitSetting = value; - refresh(); - } - ) - ); - } + const linkArray = []; + for (const [text, value] of map) { + if (slave.clitSetting === value) { + linkArray.push( + App.UI.DOM.disabledLink( + text, + ["Currently selected"] + ) + ); + } else { + linkArray.push( + App.UI.DOM.link( + text, + () => { + slave.clitSetting = value; + refresh(); + } + ) + ); } - row.append(App.UI.DOM.generateLinksStrip(linkArray)); - el.append(row); } + row.append(App.UI.DOM.generateLinksStrip(linkArray)); + el.append(row); } - function refresh() { - jQuery("#si-rules").empty().append(rulesContent()); - } + } + function refresh() { + jQuery("#content-rules").empty().append(App.UI.SlaveInteract.rulesContent(slave)); } }; diff --git a/src/interaction/siWardrobe.js b/src/interaction/siWardrobe.js index 074312444eb65be5967386d41a7420c8947d4c11..f91a4c7c3276dba9dc9bc044b9f16c5622235d9e 100644 --- a/src/interaction/siWardrobe.js +++ b/src/interaction/siWardrobe.js @@ -1,162 +1,77 @@ App.UI.SlaveInteract.wardrobe = function(slave) { - const el = document.createElement("p"); - el.id = "si-wardrobe"; - el.append(wardrobeContent()); - return el; - - function wardrobeContent() { - const { - // eslint-disable-next-line no-unused-vars - he, - him, - his, - } = getPronouns(slave); - const el = new DocumentFragment(); - el.append(clothes()); - el.append(collar()); - el.append(mask()); - el.append(mouth()); - el.append(armAccessory()); - el.append(shoes()); - el.append(legAccessory()); - el.append(bellyAccessory()); - el.append(buttplug()); - el.append(buttplugAttachment()); - el.append(vaginalAccessory()); - el.append(vaginalAttachment()); - el.append(dickAccessory()); - el.append(chastity()); - - App.UI.DOM.appendNewElement("h3", el, `Shopping`); - el.append(shopping()); - - return el; - - function clothes() { - let el = document.createElement('div'); - let links; - if (slave.fuckdoll === 0) { - // <<= App.Desc.clothing($activeSlave)>> - - let label = document.createElement('div'); - label.append(`Clothes: `); - - let choice = document.createElement('span'); - choice.style.fontWeight = "bold"; - choice.textContent = (`${slave.clothes} `); - label.appendChild(choice); - - // Choose her own - if (slave.clothes !== `choosing her own clothes`) { - let choiceOptionsArray = []; - choiceOptionsArray.push({text: `Let ${him} choose`, updateSlave: {clothes: `choosing her own clothes`, choosesOwnClothes: 1}}); - label.appendChild(App.UI.SlaveInteract.generateRows(choiceOptionsArray, slave, "clothes", false, refresh)); - } - el.appendChild(label); - - - let niceOptionsArray = []; - let harshOptionsArray = []; - - let clothingOption; - // Nice clothes - App.Data.slaveWear.niceClothes.forEach(item => { - clothingOption = { - text: item.name, - updateSlave: {clothes: item.value, choosesOwnClothes: 0}, - FS: item.fs - }; - niceOptionsArray.push(clothingOption); - }); - // Harsh clothes - App.Data.slaveWear.harshClothes.forEach(item => { - clothingOption = { - text: item.name, - updateSlave: {clothes: item.value, choosesOwnClothes: 0}, - FS: item.fs - }; - if (item.value !== "choosing her own clothes") { - harshOptionsArray.push(clothingOption); - } - }); - - // Sort - niceOptionsArray = niceOptionsArray.sort((a, b) => (a.text > b.text) ? 1 : -1); - harshOptionsArray = harshOptionsArray.sort((a, b) => (a.text > b.text) ? 1 : -1); - - // Nice options - links = document.createElement('div'); - links.className = "choices"; - links.append(`Nice: `); - links.appendChild(App.UI.SlaveInteract.generateRows(niceOptionsArray, slave, "clothes", true, refresh)); - el.appendChild(links); - - // Harsh options - links = document.createElement('div'); - links.className = "choices"; - links.append(`Harsh: `); - links.appendChild(App.UI.SlaveInteract.generateRows(harshOptionsArray, slave, "clothes", true, refresh)); - el.appendChild(links); - } - if (slave.fuckdoll !== 0 || slave.clothes === "restrictive latex" || slave.clothes === "a latex catsuit" || slave.clothes === "a cybersuit" || slave.clothes === "a comfortable bodysuit") { - if (V.seeImages === 1 && V.imageChoice === 1) { - // Color options - links = document.createElement('div'); - links.className = "choices"; - links.append(`Color: `); - links.appendChild(colorOptions("clothingBaseColor")); - el.appendChild(links); - } - } + const { + // eslint-disable-next-line no-unused-vars + he, + him, + his, + } = getPronouns(slave); + const el = new DocumentFragment(); + el.append(clothes()); + el.append(collar()); + el.append(mask()); + el.append(mouth()); + el.append(armAccessory()); + el.append(shoes()); + el.append(legAccessory()); + el.append(bellyAccessory()); + el.append(buttplug()); + el.append(buttplugAttachment()); + el.append(vaginalAccessory()); + el.append(vaginalAttachment()); + el.append(dickAccessory()); + el.append(chastity()); + + App.UI.DOM.appendNewElement("h3", el, `Shopping`); + el.append(shopping()); - return el; - } + return el; - function collar() { - if (slave.fuckdoll !== 0) { - return; - } - // <<= App.Desc.collar($activeSlave)>> - let el = document.createElement('div'); + function clothes() { + let el = document.createElement('div'); + let links; + if (slave.fuckdoll === 0) { + // <<= App.Desc.clothing($activeSlave)>> let label = document.createElement('div'); - label.append(`Collar: `); + label.append(`Clothes: `); let choice = document.createElement('span'); choice.style.fontWeight = "bold"; - choice.textContent = (`${slave.collar} `); + choice.textContent = (`${slave.clothes} `); label.appendChild(choice); // Choose her own - if (slave.collar !== `none`) { + if (slave.clothes !== `choosing her own clothes`) { let choiceOptionsArray = []; - choiceOptionsArray.push({text: `None`, updateSlave: {collar: `none`}}); - label.appendChild(App.UI.SlaveInteract.generateRows(choiceOptionsArray, slave, "collar", false, refresh)); + choiceOptionsArray.push({text: `Let ${him} choose`, updateSlave: {clothes: `choosing her own clothes`, choosesOwnClothes: 1}}); + label.appendChild(App.UI.SlaveInteract.generateRows(choiceOptionsArray, slave, "clothes", false, refresh)); } - el.appendChild(label); + let niceOptionsArray = []; let harshOptionsArray = []; let clothingOption; - // Nice collar - App.Data.slaveWear.niceCollars.forEach(item => { + // Nice clothes + App.Data.slaveWear.niceClothes.forEach(item => { clothingOption = { text: item.name, - updateSlave: {collar: item.value}, + updateSlave: {clothes: item.value, choosesOwnClothes: 0}, FS: item.fs }; niceOptionsArray.push(clothingOption); }); - // Harsh collar - App.Data.slaveWear.harshCollars.forEach(item => { + // Harsh clothes + App.Data.slaveWear.harshClothes.forEach(item => { clothingOption = { text: item.name, - updateSlave: {collar: item.value}, + updateSlave: {clothes: item.value, choosesOwnClothes: 0}, FS: item.fs }; - harshOptionsArray.push(clothingOption); + if (item.value !== "choosing her own clothes") { + harshOptionsArray.push(clothingOption); + } }); // Sort @@ -164,181 +79,260 @@ App.UI.SlaveInteract.wardrobe = function(slave) { harshOptionsArray = harshOptionsArray.sort((a, b) => (a.text > b.text) ? 1 : -1); // Nice options - let links = document.createElement('div'); + links = document.createElement('div'); links.className = "choices"; links.append(`Nice: `); - links.appendChild(App.UI.SlaveInteract.generateRows(niceOptionsArray, slave, "collar", true, refresh)); + links.appendChild(App.UI.SlaveInteract.generateRows(niceOptionsArray, slave, "clothes", true, refresh)); el.appendChild(links); // Harsh options links = document.createElement('div'); links.className = "choices"; links.append(`Harsh: `); - links.appendChild(App.UI.SlaveInteract.generateRows(harshOptionsArray, slave, "collar", true, refresh)); + links.appendChild(App.UI.SlaveInteract.generateRows(harshOptionsArray, slave, "clothes", true, refresh)); el.appendChild(links); + } + if (slave.fuckdoll !== 0 || slave.clothes === "restrictive latex" || slave.clothes === "a latex catsuit" || slave.clothes === "a cybersuit" || slave.clothes === "a comfortable bodysuit") { + if (V.seeImages === 1 && V.imageChoice === 1) { + // Color options + links = document.createElement('div'); + links.className = "choices"; + links.append(`Color: `); + links.appendChild(colorOptions("clothingBaseColor")); + el.appendChild(links); + } + } - return el; + return el; + } + + function collar() { + if (slave.fuckdoll !== 0) { + return; } + // <<= App.Desc.collar($activeSlave)>> + let el = document.createElement('div'); - function mask() { - if (slave.fuckdoll !== 0) { - return; - } - let el = document.createElement('div'); + let label = document.createElement('div'); + label.append(`Collar: `); - let label = document.createElement('div'); - label.append(`Mask: `); + let choice = document.createElement('span'); + choice.style.fontWeight = "bold"; + choice.textContent = (`${slave.collar} `); + label.appendChild(choice); - let choice = document.createElement('span'); - choice.style.fontWeight = "bold"; - choice.textContent = (`${slave.faceAccessory} `); - label.appendChild(choice); + // Choose her own + if (slave.collar !== `none`) { + let choiceOptionsArray = []; + choiceOptionsArray.push({text: `None`, updateSlave: {collar: `none`}}); + label.appendChild(App.UI.SlaveInteract.generateRows(choiceOptionsArray, slave, "collar", false, refresh)); + } - // Choose her own - if (slave.faceAccessory !== `none`) { - let choiceOptionsArray = []; - choiceOptionsArray.push({text: `None`, updateSlave: {faceAccessory: `none`}}); - label.appendChild(App.UI.SlaveInteract.generateRows(choiceOptionsArray, slave, "faceAccessory", false, refresh)); - } + el.appendChild(label); + + let niceOptionsArray = []; + let harshOptionsArray = []; + + let clothingOption; + // Nice collar + App.Data.slaveWear.niceCollars.forEach(item => { + clothingOption = { + text: item.name, + updateSlave: {collar: item.value}, + FS: item.fs + }; + niceOptionsArray.push(clothingOption); + }); + // Harsh collar + App.Data.slaveWear.harshCollars.forEach(item => { + clothingOption = { + text: item.name, + updateSlave: {collar: item.value}, + FS: item.fs + }; + harshOptionsArray.push(clothingOption); + }); + + // Sort + niceOptionsArray = niceOptionsArray.sort((a, b) => (a.text > b.text) ? 1 : -1); + harshOptionsArray = harshOptionsArray.sort((a, b) => (a.text > b.text) ? 1 : -1); + + // Nice options + let links = document.createElement('div'); + links.className = "choices"; + links.append(`Nice: `); + links.appendChild(App.UI.SlaveInteract.generateRows(niceOptionsArray, slave, "collar", true, refresh)); + el.appendChild(links); + + // Harsh options + links = document.createElement('div'); + links.className = "choices"; + links.append(`Harsh: `); + links.appendChild(App.UI.SlaveInteract.generateRows(harshOptionsArray, slave, "collar", true, refresh)); + el.appendChild(links); - el.appendChild(label); + return el; + } - let array = []; + function mask() { + if (slave.fuckdoll !== 0) { + return; + } + let el = document.createElement('div'); - let clothingOption; - App.Data.slaveWear.faceAccessory.forEach(item => { - clothingOption = { - text: item.name, - updateSlave: {faceAccessory: item.value}, - FS: item.fs - }; - array.push(clothingOption); - }); + let label = document.createElement('div'); + label.append(`Mask: `); - // Sort - array = array.sort((a, b) => (a.text > b.text) ? 1 : -1); + let choice = document.createElement('span'); + choice.style.fontWeight = "bold"; + choice.textContent = (`${slave.faceAccessory} `); + label.appendChild(choice); + + // Choose her own + if (slave.faceAccessory !== `none`) { + let choiceOptionsArray = []; + choiceOptionsArray.push({text: `None`, updateSlave: {faceAccessory: `none`}}); + label.appendChild(App.UI.SlaveInteract.generateRows(choiceOptionsArray, slave, "faceAccessory", false, refresh)); + } + + el.appendChild(label); - let links = document.createElement('div'); + let array = []; + + let clothingOption; + App.Data.slaveWear.faceAccessory.forEach(item => { + clothingOption = { + text: item.name, + updateSlave: {faceAccessory: item.value}, + FS: item.fs + }; + array.push(clothingOption); + }); + + // Sort + array = array.sort((a, b) => (a.text > b.text) ? 1 : -1); + + let links = document.createElement('div'); + links.className = "choices"; + links.appendChild(App.UI.SlaveInteract.generateRows(array, slave, "faceAccessory", true, refresh)); + el.appendChild(links); + + if (slave.eyewear === "corrective glasses" || slave.eyewear === "glasses" || slave.eyewear === "blurring glasses" || slave.faceAccessory === "porcelain mask") { + // Color options + links = document.createElement('div'); links.className = "choices"; - links.appendChild(App.UI.SlaveInteract.generateRows(array, slave, "faceAccessory", true, refresh)); + links.append(`Color: `); + links.appendChild(colorOptions("glassesColor")); + let note = document.createElement('span'); + note.className = "note"; + note.textContent = ` Only glasses and porcelain masks support a custom color. If both are worn, they will share the same color.`; + links.appendChild(note); el.appendChild(links); + } - if (slave.eyewear === "corrective glasses" || slave.eyewear === "glasses" || slave.eyewear === "blurring glasses" || slave.faceAccessory === "porcelain mask") { - // Color options - links = document.createElement('div'); - links.className = "choices"; - links.append(`Color: `); - links.appendChild(colorOptions("glassesColor")); - let note = document.createElement('span'); - note.className = "note"; - note.textContent = ` Only glasses and porcelain masks support a custom color. If both are worn, they will share the same color.`; - links.appendChild(note); - el.appendChild(links); - } + return el; + } - return el; + function mouth() { + if (slave.fuckdoll !== 0) { + return; } + let el = document.createElement('div'); - function mouth() { - if (slave.fuckdoll !== 0) { - return; - } - let el = document.createElement('div'); + let label = document.createElement('div'); + label.append(`Gag: `); - let label = document.createElement('div'); - label.append(`Gag: `); + let choice = document.createElement('span'); + choice.style.fontWeight = "bold"; + choice.textContent = (`${slave.mouthAccessory} `); + label.appendChild(choice); - let choice = document.createElement('span'); - choice.style.fontWeight = "bold"; - choice.textContent = (`${slave.mouthAccessory} `); - label.appendChild(choice); + // Choose her own + if (slave.mouthAccessory !== `none`) { + let choiceOptionsArray = []; + choiceOptionsArray.push({text: `None`, updateSlave: {mouthAccessory: `none`}}); + label.appendChild(App.UI.SlaveInteract.generateRows(choiceOptionsArray, slave, "mouthAccessory", false, refresh)); + } - // Choose her own - if (slave.mouthAccessory !== `none`) { - let choiceOptionsArray = []; - choiceOptionsArray.push({text: `None`, updateSlave: {mouthAccessory: `none`}}); - label.appendChild(App.UI.SlaveInteract.generateRows(choiceOptionsArray, slave, "mouthAccessory", false, refresh)); - } + el.appendChild(label); - el.appendChild(label); + let array = []; - let array = []; + let clothingOption; + // mouthAccessory + App.Data.slaveWear.mouthAccessory.forEach(item => { + clothingOption = { + text: item.name, + updateSlave: {mouthAccessory: item.value}, + FS: item.fs + }; + array.push(clothingOption); + }); - let clothingOption; - // mouthAccessory - App.Data.slaveWear.mouthAccessory.forEach(item => { - clothingOption = { - text: item.name, - updateSlave: {mouthAccessory: item.value}, - FS: item.fs - }; - array.push(clothingOption); - }); + // Sort + array = array.sort((a, b) => (a.text > b.text) ? 1 : -1); - // Sort - array = array.sort((a, b) => (a.text > b.text) ? 1 : -1); + let links = document.createElement('div'); + links.className = "choices"; + links.appendChild(App.UI.SlaveInteract.generateRows(array, slave, "mouthAccessory", true, refresh)); + el.appendChild(links); - let links = document.createElement('div'); - links.className = "choices"; - links.appendChild(App.UI.SlaveInteract.generateRows(array, slave, "mouthAccessory", true, refresh)); - el.appendChild(links); + return el; + } - return el; + function armAccessory() { + if (slave.fuckdoll !== 0) { + return; } - function armAccessory() { - if (slave.fuckdoll !== 0) { - return; - } + let el = document.createElement('div'); + // App.Desc.armwear(slave) - let el = document.createElement('div'); - // App.Desc.armwear(slave) + let label = document.createElement('div'); + label.append(`Arm accessory: `); - let label = document.createElement('div'); - label.append(`Arm accessory: `); + let choice = document.createElement('span'); + choice.style.fontWeight = "bold"; + choice.textContent = (`${slave.armAccessory} `); + label.appendChild(choice); - let choice = document.createElement('span'); - choice.style.fontWeight = "bold"; - choice.textContent = (`${slave.armAccessory} `); - label.appendChild(choice); + let array = []; - let array = []; + // Choose her own + if (slave.armAccessory !== "none") { + array.push({text: `None`, updateSlave: {armAccessory: `none`}}); + label.appendChild(App.UI.SlaveInteract.generateRows(array, slave, "armAccessory", false, refresh)); + } - // Choose her own - if (slave.armAccessory !== "none") { - array.push({text: `None`, updateSlave: {armAccessory: `none`}}); - label.appendChild(App.UI.SlaveInteract.generateRows(array, slave, "armAccessory", false, refresh)); - } + el.appendChild(label); - el.appendChild(label); + let links = document.createElement('div'); + links.className = "choices"; + array = [ + {text: "Hand gloves", updateSlave: {armAccessory: "hand gloves"}}, + {text: "Elbow gloves", updateSlave: {armAccessory: "elbow gloves"}} + ]; + links.appendChild(App.UI.SlaveInteract.generateRows(array, slave, "armAccessory", false, refresh)); + el.appendChild(links); - let links = document.createElement('div'); - links.className = "choices"; - array = [ - {text: "Hand gloves", updateSlave: {armAccessory: "hand gloves"}}, - {text: "Elbow gloves", updateSlave: {armAccessory: "elbow gloves"}} - ]; - links.appendChild(App.UI.SlaveInteract.generateRows(array, slave, "armAccessory", false, refresh)); - el.appendChild(links); + return el; + } - return el; + function shoes() { + if (slave.fuckdoll !== 0) { + return; } + let el = document.createElement('div'); - function shoes() { - if (slave.fuckdoll !== 0) { - return; - } - let el = document.createElement('div'); + let label = document.createElement('div'); + label.append(`Shoes: `); - let label = document.createElement('div'); - label.append(`Shoes: `); + let choice = document.createElement('span'); + choice.style.fontWeight = "bold"; + choice.textContent = (`${slave.shoes} `); + label.appendChild(choice); - let choice = document.createElement('span'); - choice.style.fontWeight = "bold"; - choice.textContent = (`${slave.shoes} `); - label.appendChild(choice); - - /* We have "barefoot" in App.Data.slaveWear to cover for this + /* We have "barefoot" in App.Data.slaveWear to cover for this // Choose her own if (slave.shoes !== `none`) { let choiceOptionsArray = []; @@ -346,497 +340,497 @@ App.UI.SlaveInteract.wardrobe = function(slave) { label.appendChild(App.UI.SlaveInteract.generateRows(choiceOptionsArray, slave, "shoes", false, refresh)); } */ - el.appendChild(label); - - let optionsArray = []; - - let clothingOption; - App.Data.slaveWear.shoes.forEach(item => { - clothingOption = { - text: item.name, - updateSlave: {shoes: item.value}, - FS: item.fs - }; - optionsArray.push(clothingOption); - }); - - // Sort - // No sort here since we want light -> advanced. optionsArray = optionsArray.sort((a, b) => (a.text > b.text) ? 1 : -1); - - // Options - let links = document.createElement('div'); + el.appendChild(label); + + let optionsArray = []; + + let clothingOption; + App.Data.slaveWear.shoes.forEach(item => { + clothingOption = { + text: item.name, + updateSlave: {shoes: item.value}, + FS: item.fs + }; + optionsArray.push(clothingOption); + }); + + // Sort + // No sort here since we want light -> advanced. optionsArray = optionsArray.sort((a, b) => (a.text > b.text) ? 1 : -1); + + // Options + let links = document.createElement('div'); + links.className = "choices"; + links.appendChild(App.UI.SlaveInteract.generateRows(optionsArray, slave, "shoes", true, refresh)); + el.appendChild(links); + + if (V.seeImages === 1 && V.imageChoice === 1 && slave.shoes !== "none") { + // Color options + links = document.createElement('div'); links.className = "choices"; - links.appendChild(App.UI.SlaveInteract.generateRows(optionsArray, slave, "shoes", true, refresh)); + links.append(`Color: `); + links.appendChild(colorOptions("shoeColor")); el.appendChild(links); + } - if (V.seeImages === 1 && V.imageChoice === 1 && slave.shoes !== "none") { - // Color options - links = document.createElement('div'); - links.className = "choices"; - links.append(`Color: `); - links.appendChild(colorOptions("shoeColor")); - el.appendChild(links); - } + return el; + } - return el; + function legAccessory() { + if (slave.fuckdoll !== 0) { + return; } - function legAccessory() { - if (slave.fuckdoll !== 0) { - return; - } + let el = document.createElement('div'); - let el = document.createElement('div'); + let label = document.createElement('div'); + label.append(`Leg accessory: `); - let label = document.createElement('div'); - label.append(`Leg accessory: `); + let choice = document.createElement('span'); + choice.style.fontWeight = "bold"; + choice.textContent = (`${slave.legAccessory} `); + label.appendChild(choice); - let choice = document.createElement('span'); - choice.style.fontWeight = "bold"; - choice.textContent = (`${slave.legAccessory} `); - label.appendChild(choice); + let array = []; - let array = []; + // Choose her own + if (slave.legAccessory !== "none") { + array.push({text: `None`, updateSlave: {legAccessory: `none`}}); + label.appendChild(App.UI.SlaveInteract.generateRows(array, slave, "legAccessory", false, refresh)); + } - // Choose her own - if (slave.legAccessory !== "none") { - array.push({text: `None`, updateSlave: {legAccessory: `none`}}); - label.appendChild(App.UI.SlaveInteract.generateRows(array, slave, "legAccessory", false, refresh)); - } + el.appendChild(label); - el.appendChild(label); + let links = document.createElement('div'); + links.className = "choices"; + array = [ + {text: "Short stockings", updateSlave: {legAccessory: "short stockings"}}, + {text: "Long stockings", updateSlave: {legAccessory: "long stockings"}} + ]; + links.appendChild(App.UI.SlaveInteract.generateRows(array, slave, "legAccessory", false, refresh)); + el.appendChild(links); - let links = document.createElement('div'); - links.className = "choices"; - array = [ - {text: "Short stockings", updateSlave: {legAccessory: "short stockings"}}, - {text: "Long stockings", updateSlave: {legAccessory: "long stockings"}} - ]; - links.appendChild(App.UI.SlaveInteract.generateRows(array, slave, "legAccessory", false, refresh)); - el.appendChild(links); + return el; + } - return el; + function bellyAccessory() { + if (slave.fuckdoll !== 0) { + return; } - - function bellyAccessory() { - if (slave.fuckdoll !== 0) { - return; + // <<waistDescription>><<= App.Desc.pregnancy($activeSlave)>><<clothingCorsetDescription>> + let choiceOptionsArray = []; + choiceOptionsArray.push({text: `None`, updateSlave: {bellyAccessory: `none`}}); + + let optionsArray = []; + + let clothingOption; + App.Data.slaveWear.bellyAccessories.forEach(item => { + clothingOption = { + text: item.name, + updateSlave: {bellyAccessory: item.value}, + FS: item.fs + }; + if (item.value !== "none") { + // skip none in set, we set the link elsewhere. + optionsArray.push(clothingOption); } - // <<waistDescription>><<= App.Desc.pregnancy($activeSlave)>><<clothingCorsetDescription>> - let choiceOptionsArray = []; - choiceOptionsArray.push({text: `None`, updateSlave: {bellyAccessory: `none`}}); + }); + // Sort + // No sort here since we want small -> large.optionsArray = optionsArray.sort((a, b) => (a.text > b.text) ? 1 : -1); - let optionsArray = []; + let el = document.createElement('div'); - let clothingOption; - App.Data.slaveWear.bellyAccessories.forEach(item => { - clothingOption = { - text: item.name, - updateSlave: {bellyAccessory: item.value}, - FS: item.fs - }; - if (item.value !== "none") { - // skip none in set, we set the link elsewhere. - optionsArray.push(clothingOption); - } - }); - // Sort - // No sort here since we want small -> large.optionsArray = optionsArray.sort((a, b) => (a.text > b.text) ? 1 : -1); - - let el = document.createElement('div'); + let label = document.createElement('div'); + label.append(`Belly accessory: `); - let label = document.createElement('div'); - label.append(`Belly accessory: `); - - let choice = document.createElement('span'); - choice.style.fontWeight = "bold"; - choice.textContent = (`${slave.bellyAccessory} `); - label.appendChild(choice); + let choice = document.createElement('span'); + choice.style.fontWeight = "bold"; + choice.textContent = (`${slave.bellyAccessory} `); + label.appendChild(choice); - // Choose her own - if (slave.bellyAccessory !== `none`) { - label.appendChild(App.UI.SlaveInteract.generateRows(choiceOptionsArray, slave, "bellyAccessory", false, refresh)); - } + // Choose her own + if (slave.bellyAccessory !== `none`) { + label.appendChild(App.UI.SlaveInteract.generateRows(choiceOptionsArray, slave, "bellyAccessory", false, refresh)); + } - el.appendChild(label); + el.appendChild(label); + + // Options + let links = document.createElement('div'); + links.className = "choices"; + links.appendChild(App.UI.SlaveInteract.generateRows(optionsArray, slave, "bellyAccessory", true, refresh)); + if (slave.pregKnown === 1) { + let note = document.createElement('span'); + note.className = "note"; + note.textContent = ` Extreme corsets will endanger the life within ${him}.`; + links.appendChild(note); + } + el.appendChild(links); - // Options - let links = document.createElement('div'); - links.className = "choices"; - links.appendChild(App.UI.SlaveInteract.generateRows(optionsArray, slave, "bellyAccessory", true, refresh)); - if (slave.pregKnown === 1) { - let note = document.createElement('span'); - note.className = "note"; - note.textContent = ` Extreme corsets will endanger the life within ${him}.`; - links.appendChild(note); - } - el.appendChild(links); + return el; + } - return el; + function buttplug() { + if (slave.fuckdoll !== 0) { + return; } + // App.Desc.buttplug(slave) - function buttplug() { - if (slave.fuckdoll !== 0) { - return; - } - // App.Desc.buttplug(slave) - - let el = document.createElement('div'); + let el = document.createElement('div'); - let label = document.createElement('div'); - label.append(`Anal accessory: `); + let label = document.createElement('div'); + label.append(`Anal accessory: `); - let choice = document.createElement('span'); - choice.style.fontWeight = "bold"; - choice.textContent = (`${slave.buttplug} `); - label.appendChild(choice); + let choice = document.createElement('span'); + choice.style.fontWeight = "bold"; + choice.textContent = (`${slave.buttplug} `); + label.appendChild(choice); - if (slave.buttplug !== `none`) { - let choiceOptionsArray = []; - choiceOptionsArray.push({text: `None`, updateSlave: {buttplug: `none`, buttplugAttachment: `none`}}); - label.appendChild(App.UI.SlaveInteract.generateRows(choiceOptionsArray, slave, "buttplug", false, refresh)); + if (slave.buttplug !== `none`) { + let choiceOptionsArray = []; + choiceOptionsArray.push({text: `None`, updateSlave: {buttplug: `none`, buttplugAttachment: `none`}}); + label.appendChild(App.UI.SlaveInteract.generateRows(choiceOptionsArray, slave, "buttplug", false, refresh)); + } + el.appendChild(label); + + let optionsArray = []; + + let clothingOption; + App.Data.slaveWear.buttplugs.forEach(item => { + clothingOption = { + text: item.name, + updateSlave: {buttplug: item.value}, + FS: item.fs + }; + if (item.value !== "none") { + // skip none in set, we set the link elsewhere. + optionsArray.push(clothingOption); } - el.appendChild(label); + }); - let optionsArray = []; + // Sort + // No sort here since we want small -> large. optionsArray = optionsArray.sort((a, b) => (a.text > b.text) ? 1 : -1); - let clothingOption; - App.Data.slaveWear.buttplugs.forEach(item => { - clothingOption = { - text: item.name, - updateSlave: {buttplug: item.value}, - FS: item.fs - }; - if (item.value !== "none") { - // skip none in set, we set the link elsewhere. - optionsArray.push(clothingOption); - } - }); - - // Sort - // No sort here since we want small -> large. optionsArray = optionsArray.sort((a, b) => (a.text > b.text) ? 1 : -1); + // Options + let links = document.createElement('div'); + links.className = "choices"; + links.appendChild(App.UI.SlaveInteract.generateRows(optionsArray, slave, "buttplug", true, refresh)); + el.appendChild(links); - // Options - let links = document.createElement('div'); - links.className = "choices"; - links.appendChild(App.UI.SlaveInteract.generateRows(optionsArray, slave, "buttplug", true, refresh)); - el.appendChild(links); + return el; + } + function buttplugAttachment() { + let el = document.createElement('div'); + if (slave.fuckdoll !== 0 || slave.buttplug === "none") { return el; } - function buttplugAttachment() { - let el = document.createElement('div'); - if (slave.fuckdoll !== 0 || slave.buttplug === "none") { - return el; - } + let label = document.createElement('div'); + label.append(`Anal accessory attachment: `); - let label = document.createElement('div'); - label.append(`Anal accessory attachment: `); + let choice = document.createElement('span'); + choice.style.fontWeight = "bold"; + choice.textContent = (`${slave.buttplugAttachment} `); + label.appendChild(choice); - let choice = document.createElement('span'); - choice.style.fontWeight = "bold"; - choice.textContent = (`${slave.buttplugAttachment} `); - label.appendChild(choice); - - if (slave.buttplugAttachment !== `none`) { - let choiceOptionsArray = []; - choiceOptionsArray.push({text: `None`, updateSlave: {buttplugAttachment: `none`}}); - label.appendChild(App.UI.SlaveInteract.generateRows(choiceOptionsArray, slave, "buttplugAttachment", false, refresh)); + if (slave.buttplugAttachment !== `none`) { + let choiceOptionsArray = []; + choiceOptionsArray.push({text: `None`, updateSlave: {buttplugAttachment: `none`}}); + label.appendChild(App.UI.SlaveInteract.generateRows(choiceOptionsArray, slave, "buttplugAttachment", false, refresh)); + } + el.appendChild(label); + + let optionsArray = []; + + let clothingOption; + App.Data.slaveWear.buttplugAttachments.forEach(item => { + clothingOption = { + text: item.name, + updateSlave: {buttplugAttachment: item.value}, + FS: item.fs + }; + if (item.value !== "none") { + // skip none in set, we set the link elsewhere. + optionsArray.push(clothingOption); } - el.appendChild(label); + }); - let optionsArray = []; + // Sort + optionsArray = optionsArray.sort((a, b) => (a.text > b.text) ? 1 : -1); - let clothingOption; - App.Data.slaveWear.buttplugAttachments.forEach(item => { - clothingOption = { - text: item.name, - updateSlave: {buttplugAttachment: item.value}, - FS: item.fs - }; - if (item.value !== "none") { - // skip none in set, we set the link elsewhere. - optionsArray.push(clothingOption); - } - }); - - // Sort - optionsArray = optionsArray.sort((a, b) => (a.text > b.text) ? 1 : -1); + // Options + let links = document.createElement('div'); + links.className = "choices"; + links.appendChild(App.UI.SlaveInteract.generateRows(optionsArray, slave, "buttplugAttachment", true, refresh)); + el.appendChild(links); - // Options - let links = document.createElement('div'); - links.className = "choices"; - links.appendChild(App.UI.SlaveInteract.generateRows(optionsArray, slave, "buttplugAttachment", true, refresh)); - el.appendChild(links); + return el; + } - return el; + function vaginalAccessory() { + if (slave.fuckdoll !== 0) { + return; } - function vaginalAccessory() { - if (slave.fuckdoll !== 0) { - return; - } + // <<vaginalAccessoryDescription>> - // <<vaginalAccessoryDescription>> + let el = document.createElement('div'); - let el = document.createElement('div'); + let label = document.createElement('div'); + label.append(`Vaginal accessory: `); - let label = document.createElement('div'); - label.append(`Vaginal accessory: `); - - let choice = document.createElement('span'); - choice.style.fontWeight = "bold"; - choice.textContent = (`${slave.vaginalAccessory} `); - label.appendChild(choice); + let choice = document.createElement('span'); + choice.style.fontWeight = "bold"; + choice.textContent = (`${slave.vaginalAccessory} `); + label.appendChild(choice); - if (slave.vaginalAccessory !== `none`) { - let choiceOptionsArray = []; - choiceOptionsArray.push({text: `None`, updateSlave: {vaginalAccessory: `none`}}); - label.appendChild(App.UI.SlaveInteract.generateRows(choiceOptionsArray, slave, "vaginalAccessory", false, refresh)); + if (slave.vaginalAccessory !== `none`) { + let choiceOptionsArray = []; + choiceOptionsArray.push({text: `None`, updateSlave: {vaginalAccessory: `none`}}); + label.appendChild(App.UI.SlaveInteract.generateRows(choiceOptionsArray, slave, "vaginalAccessory", false, refresh)); + } + el.appendChild(label); + + let optionsArray = []; + + let clothingOption; + App.Data.slaveWear.vaginalAccessories.forEach(item => { + clothingOption = { + text: item.name, + updateSlave: {vaginalAccessory: item.value}, + FS: item.fs + }; + if (item.value !== "none") { + // skip none in set, we set the link elsewhere. + optionsArray.push(clothingOption); } - el.appendChild(label); + }); - let optionsArray = []; + // Sort + // No sort here since we want small -> large. optionsArray = optionsArray.sort((a, b) => (a.text > b.text) ? 1 : -1); - let clothingOption; - App.Data.slaveWear.vaginalAccessories.forEach(item => { - clothingOption = { - text: item.name, - updateSlave: {vaginalAccessory: item.value}, - FS: item.fs - }; - if (item.value !== "none") { - // skip none in set, we set the link elsewhere. - optionsArray.push(clothingOption); - } - }); - - // Sort - // No sort here since we want small -> large. optionsArray = optionsArray.sort((a, b) => (a.text > b.text) ? 1 : -1); + // Options + let links = document.createElement('div'); + links.className = "choices"; + links.appendChild(App.UI.SlaveInteract.generateRows(optionsArray, slave, "vaginalAccessory", true, refresh)); + el.appendChild(links); - // Options - let links = document.createElement('div'); - links.className = "choices"; - links.appendChild(App.UI.SlaveInteract.generateRows(optionsArray, slave, "vaginalAccessory", true, refresh)); - el.appendChild(links); + return el; + } + function vaginalAttachment() { + let el = document.createElement('div'); + if (slave.fuckdoll !== 0 || (["none", "bullet vibrator", "smart bullet vibrator"].includes(slave.vaginalAccessory))) { return el; } - function vaginalAttachment() { - let el = document.createElement('div'); - if (slave.fuckdoll !== 0 || (["none", "bullet vibrator", "smart bullet vibrator"].includes(slave.vaginalAccessory))) { - return el; - } + let label = document.createElement('div'); + label.append(`Vaginal accessory attachment: `); - let label = document.createElement('div'); - label.append(`Vaginal accessory attachment: `); + let choice = document.createElement('span'); + choice.style.fontWeight = "bold"; + choice.textContent = (`${slave.vaginalAttachment} `); + label.appendChild(choice); - let choice = document.createElement('span'); - choice.style.fontWeight = "bold"; - choice.textContent = (`${slave.vaginalAttachment} `); - label.appendChild(choice); - - if (slave.vaginalAttachment !== `none`) { - let choiceOptionsArray = []; - choiceOptionsArray.push({text: `None`, updateSlave: {vaginalAttachment: `none`}}); - label.appendChild(App.UI.SlaveInteract.generateRows(choiceOptionsArray, slave, "vaginalAttachment", false, refresh)); - } - el.appendChild(label); - - let optionsArray = []; - - let clothingOption; - App.Data.slaveWear.vaginalAttachments.forEach(item => { - clothingOption = { - text: item.name, - updateSlave: {vaginalAttachment: item.value}, - FS: item.fs - }; - if (item.value !== "none") { - // skip none in set, we set the link elsewhere. - optionsArray.push(clothingOption); - } - }); - - // Sort - optionsArray = optionsArray.sort((a, b) => (a.text > b.text) ? 1 : -1); - - // Options - let links = document.createElement('div'); - links.className = "choices"; - links.appendChild(App.UI.SlaveInteract.generateRows(optionsArray, slave, "vaginalAttachment", true, refresh)); - el.appendChild(links); - - return el; + if (slave.vaginalAttachment !== `none`) { + let choiceOptionsArray = []; + choiceOptionsArray.push({text: `None`, updateSlave: {vaginalAttachment: `none`}}); + label.appendChild(App.UI.SlaveInteract.generateRows(choiceOptionsArray, slave, "vaginalAttachment", false, refresh)); } - - function dickAccessory() { - if (slave.fuckdoll !== 0) { - return; + el.appendChild(label); + + let optionsArray = []; + + let clothingOption; + App.Data.slaveWear.vaginalAttachments.forEach(item => { + clothingOption = { + text: item.name, + updateSlave: {vaginalAttachment: item.value}, + FS: item.fs + }; + if (item.value !== "none") { + // skip none in set, we set the link elsewhere. + optionsArray.push(clothingOption); } - // <<= App.Desc.dickAccessory($activeSlave)>> - let el = document.createElement('div'); + }); - let label = document.createElement('div'); - label.append(`Dick accessory: `); + // Sort + optionsArray = optionsArray.sort((a, b) => (a.text > b.text) ? 1 : -1); - let choice = document.createElement('span'); - choice.style.fontWeight = "bold"; - choice.textContent = (`${slave.dickAccessory} `); - label.appendChild(choice); - - if (slave.dickAccessory !== `none`) { - let choiceOptionsArray = []; - choiceOptionsArray.push({text: `None`, updateSlave: {dickAccessory: `none`}}); - label.appendChild(App.UI.SlaveInteract.generateRows(choiceOptionsArray, slave, "dickAccessory", false, refresh)); - } - el.appendChild(label); + // Options + let links = document.createElement('div'); + links.className = "choices"; + links.appendChild(App.UI.SlaveInteract.generateRows(optionsArray, slave, "vaginalAttachment", true, refresh)); + el.appendChild(links); - let optionsArray = []; + return el; + } - let clothingOption; - App.Data.slaveWear.dickAccessories.forEach(item => { - clothingOption = { - text: item.name, - updateSlave: {dickAccessory: item.value}, - FS: item.fs - }; - if (item.value !== "none") { - // skip none in set, we set the link elsewhere. - optionsArray.push(clothingOption); - } - }); + function dickAccessory() { + if (slave.fuckdoll !== 0) { + return; + } + // <<= App.Desc.dickAccessory($activeSlave)>> + let el = document.createElement('div'); - // Sort - // No sort here since we want small -> large. optionsArray = optionsArray.sort((a, b) => (a.text > b.text) ? 1 : -1); + let label = document.createElement('div'); + label.append(`Dick accessory: `); - // Options - let links = document.createElement('div'); - links.className = "choices"; - links.appendChild(App.UI.SlaveInteract.generateRows(optionsArray, slave, "dickAccessory", true, refresh)); - el.appendChild(links); + let choice = document.createElement('span'); + choice.style.fontWeight = "bold"; + choice.textContent = (`${slave.dickAccessory} `); + label.appendChild(choice); - return el; + if (slave.dickAccessory !== `none`) { + let choiceOptionsArray = []; + choiceOptionsArray.push({text: `None`, updateSlave: {dickAccessory: `none`}}); + label.appendChild(App.UI.SlaveInteract.generateRows(choiceOptionsArray, slave, "dickAccessory", false, refresh)); } - - function chastity() { - if (slave.fuckdoll !== 0) { - return; + el.appendChild(label); + + let optionsArray = []; + + let clothingOption; + App.Data.slaveWear.dickAccessories.forEach(item => { + clothingOption = { + text: item.name, + updateSlave: {dickAccessory: item.value}, + FS: item.fs + }; + if (item.value !== "none") { + // skip none in set, we set the link elsewhere. + optionsArray.push(clothingOption); } + }); - let el = document.createElement('div'); + // Sort + // No sort here since we want small -> large. optionsArray = optionsArray.sort((a, b) => (a.text > b.text) ? 1 : -1); - let label = document.createElement('div'); - label.append(`Chastity devices: `); + // Options + let links = document.createElement('div'); + links.className = "choices"; + links.appendChild(App.UI.SlaveInteract.generateRows(optionsArray, slave, "dickAccessory", true, refresh)); + el.appendChild(links); - let choice = document.createElement('span'); - choice.style.fontWeight = "bold"; - if (slave.choosesOwnChastity === 1) { - choice.textContent = `choosing ${his} own chastity `; - } else if (slave.chastityAnus === 1 && slave.chastityPenis === 1 && slave.chastityVagina === 1) { - choice.textContent = `full chastity `; - } else if (slave.chastityPenis === 1 && slave.chastityVagina === 1) { - choice.textContent = `genital chastity `; - } else if (slave.chastityAnus === 1 && slave.chastityPenis === 1) { - choice.textContent = `combined chastity cage `; - } else if (slave.chastityAnus === 1 && slave.chastityVagina === 1) { - choice.textContent = `combined chastity belt `; - } else if (slave.chastityVagina === 1) { - choice.textContent = `chastity belt `; - } else if (slave.chastityPenis === 1) { - choice.textContent = `chastity cage `; - } else if (slave.chastityAnus === 1) { - choice.textContent = `anal chastity `; - } else if (slave.chastityAnus === 0 && slave.chastityPenis === 0 && slave.chastityVagina === 0) { - choice.textContent = `none `; - } else { - choice.textContent = `THERE HAS BEEN AN ERROR `; - } - label.appendChild(choice); + return el; + } - if (slave.chastityAnus !== 0 || slave.chastityPenis !== 0 || slave.chastityVagina !== 0) { - let choiceOptionsArray = []; - choiceOptionsArray.push({ - text: `None`, - updateSlave: { - choosesOwnChastity: 0, - chastityAnus: 0, - chastityPenis: 0, - chastityVagina: 0 - } - }); - label.appendChild(App.UI.SlaveInteract.generateRows(choiceOptionsArray, slave, "chastity", false, refresh)); - } - el.appendChild(label); + function chastity() { + if (slave.fuckdoll !== 0) { + return; + } - let optionsArray = []; + let el = document.createElement('div'); + + let label = document.createElement('div'); + label.append(`Chastity devices: `); + + let choice = document.createElement('span'); + choice.style.fontWeight = "bold"; + if (slave.choosesOwnChastity === 1) { + choice.textContent = `choosing ${his} own chastity `; + } else if (slave.chastityAnus === 1 && slave.chastityPenis === 1 && slave.chastityVagina === 1) { + choice.textContent = `full chastity `; + } else if (slave.chastityPenis === 1 && slave.chastityVagina === 1) { + choice.textContent = `genital chastity `; + } else if (slave.chastityAnus === 1 && slave.chastityPenis === 1) { + choice.textContent = `combined chastity cage `; + } else if (slave.chastityAnus === 1 && slave.chastityVagina === 1) { + choice.textContent = `combined chastity belt `; + } else if (slave.chastityVagina === 1) { + choice.textContent = `chastity belt `; + } else if (slave.chastityPenis === 1) { + choice.textContent = `chastity cage `; + } else if (slave.chastityAnus === 1) { + choice.textContent = `anal chastity `; + } else if (slave.chastityAnus === 0 && slave.chastityPenis === 0 && slave.chastityVagina === 0) { + choice.textContent = `none `; + } else { + choice.textContent = `THERE HAS BEEN AN ERROR `; + } + label.appendChild(choice); - let clothingOption; - App.Data.slaveWear.chastityDevices.forEach(item => { - clothingOption = { - text: item.name, - updateSlave: {}, - FS: item.fs - }; - Object.assign(clothingOption.updateSlave, item.updateSlave); - if (item.value !== "none") { - // skip none in set, we set the link elsewhere. - optionsArray.push(clothingOption); + if (slave.chastityAnus !== 0 || slave.chastityPenis !== 0 || slave.chastityVagina !== 0) { + let choiceOptionsArray = []; + choiceOptionsArray.push({ + text: `None`, + updateSlave: { + choosesOwnChastity: 0, + chastityAnus: 0, + chastityPenis: 0, + chastityVagina: 0 } }); + label.appendChild(App.UI.SlaveInteract.generateRows(choiceOptionsArray, slave, "chastity", false, refresh)); + } + el.appendChild(label); + + let optionsArray = []; + + let clothingOption; + App.Data.slaveWear.chastityDevices.forEach(item => { + clothingOption = { + text: item.name, + updateSlave: {}, + FS: item.fs + }; + Object.assign(clothingOption.updateSlave, item.updateSlave); + if (item.value !== "none") { + // skip none in set, we set the link elsewhere. + optionsArray.push(clothingOption); + } + }); - // Sort - // skip sort for this one too. optionsArray = optionsArray.sort((a, b) => (a.text > b.text) ? 1 : -1); + // Sort + // skip sort for this one too. optionsArray = optionsArray.sort((a, b) => (a.text > b.text) ? 1 : -1); - // Options - let links = document.createElement('div'); - links.className = "choices"; - links.appendChild(App.UI.SlaveInteract.generateRows(optionsArray, slave, "chastity", true, refresh)); - el.appendChild(links); + // Options + let links = document.createElement('div'); + links.className = "choices"; + links.appendChild(App.UI.SlaveInteract.generateRows(optionsArray, slave, "chastity", true, refresh)); + el.appendChild(links); - return el; - } + return el; + } - function shopping() { - return App.UI.DOM.passageLink( - `Go shopping for more options`, - "Wardrobe" - ); - } + function shopping() { + return App.UI.DOM.passageLink( + `Go shopping for more options`, + "Wardrobe" + ); + } - /** - * @param {string} update - * @returns {Node} - */ - function colorOptions(update) { - let el = new DocumentFragment(); - let colorChoice = App.UI.DOM.colorInput( - slave[update], - v => { - slave[update] = v; - refresh(); - } + /** + * @param {string} update + * @returns {Node} + */ + function colorOptions(update) { + let el = new DocumentFragment(); + let colorChoice = App.UI.DOM.colorInput( + slave[update], + v => { + slave[update] = v; + refresh(); + } + ); + el.appendChild(colorChoice); + + if (slave[update]) { + el.appendChild( + App.UI.DOM.link( + ` Reset`, + () => { + delete slave[update]; + refresh(); + }, + ) ); - el.appendChild(colorChoice); - - if (slave[update]) { - el.appendChild( - App.UI.DOM.link( - ` Reset`, - () => { - delete slave[update]; - refresh(); - }, - ) - ); - } - return el; } + return el; } + function refresh() { App.Art.refreshSlaveArt(slave, 3, "art-frame"); - jQuery("#si-wardrobe").empty().append(wardrobeContent()); + jQuery("#content-appearance").empty().append(App.UI.SlaveInteract.wardrobe(slave)); } }; diff --git a/src/interaction/siWork.js b/src/interaction/siWork.js index 7beac876dd4183bcb234acd3cf5b18c120e03e77..3206f24d318b9c69de7fb94026fc1e69dae24329 100644 --- a/src/interaction/siWork.js +++ b/src/interaction/siWork.js @@ -1,299 +1,293 @@ App.UI.SlaveInteract.work = function(slave) { - const el = document.createElement("p"); - el.id = "si-work"; - el.append(work()); - return el; + let el = new DocumentFragment(); + let p; + let div; + let span; + const links = []; + const { + His, He, + his, him + } = getPronouns(slave); + + function appendLink(text, whoreClass, enabled, disabledText) { + const link = {text: text}; + if (enabled) { + link.whoreClass = whoreClass; + } else { + link.disabled = disabledText; + } + links.push(link); + } - function work() { - let el = new DocumentFragment(); - let p; - let div; - let span; - const links = []; - const { - His, He, - his, him - } = getPronouns(slave); - - function appendLink(text, whoreClass, enabled, disabledText) { - const link = {text: text}; - if (enabled) { - link.whoreClass = whoreClass; - } else { - link.disabled = disabledText; + p = document.createElement('p'); + if (slave.assignment === Job.AGENT) { + const arc = V.arcologies.find((a) => a.leaderID === slave.ID); + p.className = "scene-intro"; + p.textContent = `${He} is serving as your Agent${arc ? ` leading ${arc.name}` : ` but is not currently assigned to an arcology`}. `; + p.appendChild(App.UI.DOM.link(`Recall and reenslave ${him}`, () => { removeJob(slave, slave.assignment, false); refresh(); })); + } else if (slave.assignment === Job.AGENTPARTNER) { + const agent = getSlave(slave.relationshipTarget); + const arc = agent ? V.arcologies.find((a) => a.leaderID === agent.ID) : null; + p.className = "scene-intro"; + p.textContent = `${He} is living with your Agent ${SlaveFullName(agent)}${arc ? ` in ${arc.name}` : ``}. `; + p.appendChild(App.UI.DOM.link(`Recall ${him}`, () => { removeJob(slave, slave.assignment, false); refresh(); })); + } else { + div = document.createElement('div'); + div.id = "mini-scene"; + p.appendChild(div); + + span = document.createElement('span'); + span.id = "useSlave"; + p.appendChild(span); + p.appendChild(useSlaveDisplay()); + } + el.append(p); + + p = document.createElement('p'); + span = document.createElement('span'); + span.className = "note"; + switch (slave.assignment) { + case Job.BODYGUARD: + span.textContent = `${He} is your Bodyguard and is not available for other work`; + break; + case Job.MADAM: + span.textContent = `${He} is the Madam and is not available for other work`; + break; + case Job.DJ: + span.textContent = `${He} is the DJ and is not available for other work`; + break; + case Job.MILKMAID: + span.textContent = `${He} is the Milkmaid and is not available for other work`; + break; + case Job.FARMER: + span.textContent = `${He} is the Farmer and is not available for other work`; + break; + case Job.STEWARD: + span.textContent = `${He} is the Stewardess and is not available for other work`; + break; + case Job.HEADGIRL: + span.textContent = `${He} is your Head Girl and is not available for other work`; + break; + case Job.RECRUITER: + span.textContent = `${He} is recruiting slaves and is not available for other work`; + break; + case Job.NURSE: + span.textContent = `${He} is the Nurse and is not available for other work`; + break; + case Job.ATTENDANT: + span.textContent = `${He} is the Attendant of the spa and is not available for other work`; + break; + case Job.MATRON: + span.textContent = `${He} is the Matron of the nursery and is not available for other work`; + break; + case Job.TEACHER: + span.textContent = `${He} is the Schoolteacher and is not available for other work`; + break; + case Job.CONCUBINE: + span.textContent = `${He} is your Concubine and is not available for other work`; + break; + case Job.WARDEN: + span.textContent = `${He} is the Wardeness and is not available for other work`; + break; + default: + // CAN BE REASSIGNED + span.classList.remove("note"); + span.id = "assignmentLinks"; + span.appendChild(assignmentBlock()); + + if ((V.brothel + V.club + V.dairy + V.farmyard + V.servantsQuarters + V.masterSuite + V.spa + V.nursery + V.clinic + V.schoolroom + V.cellblock + V.arcade + V.HGSuite) > 0) { + span.append(`Transfer to: `); + span.appendChild(App.UI.jobLinks.transfersFragment(slave.ID)); } - links.push(link); - } - p = document.createElement('p'); - if (slave.assignment === Job.AGENT) { - const arc = V.arcologies.find((a) => a.leaderID === slave.ID); - p.className = "scene-intro"; - p.textContent = `${He} is serving as your Agent${arc ? ` leading ${arc.name}` : ` but is not currently assigned to an arcology`}. `; - p.appendChild(App.UI.DOM.link(`Recall and reenslave ${him}`, () => { removeJob(slave, slave.assignment, false); refresh(); })); - } else if (slave.assignment === Job.AGENTPARTNER) { - const agent = getSlave(slave.relationshipTarget); - const arc = agent ? V.arcologies.find((a) => a.leaderID === agent.ID) : null; - p.className = "scene-intro"; - p.textContent = `${He} is living with your Agent ${SlaveFullName(agent)}${arc ? ` in ${arc.name}` : ``}. `; - p.appendChild(App.UI.DOM.link(`Recall ${him}`, () => { removeJob(slave, slave.assignment, false); refresh(); })); - } else { div = document.createElement('div'); - div.id = "mini-scene"; - p.appendChild(div); - - span = document.createElement('span'); - span.id = "useSlave"; - p.appendChild(span); - p.appendChild(useSlaveDisplay()); - } - el.append(p); + div.id = "fucktoy-pref"; + div.append(fucktoyPref()); + span.appendChild(div); + } + el.append(span); - p = document.createElement('p'); + if (slave.assignment === Job.WHORE || slave.assignment === Job.BROTHEL) { + div = document.createElement('div'); + div.textContent = `Whoring Target: `; span = document.createElement('span'); - span.className = "note"; - switch (slave.assignment) { - case Job.BODYGUARD: - span.textContent = `${He} is your Bodyguard and is not available for other work`; - break; - case Job.MADAM: - span.textContent = `${He} is the Madam and is not available for other work`; - break; - case Job.DJ: - span.textContent = `${He} is the DJ and is not available for other work`; - break; - case Job.MILKMAID: - span.textContent = `${He} is the Milkmaid and is not available for other work`; - break; - case Job.FARMER: - span.textContent = `${He} is the Farmer and is not available for other work`; - break; - case Job.STEWARD: - span.textContent = `${He} is the Stewardess and is not available for other work`; - break; - case Job.HEADGIRL: - span.textContent = `${He} is your Head Girl and is not available for other work`; - break; - case Job.RECRUITER: - span.textContent = `${He} is recruiting slaves and is not available for other work`; - break; - case Job.NURSE: - span.textContent = `${He} is the Nurse and is not available for other work`; - break; - case Job.ATTENDANT: - span.textContent = `${He} is the Attendant of the spa and is not available for other work`; - break; - case Job.MATRON: - span.textContent = `${He} is the Matron of the nursery and is not available for other work`; - break; - case Job.TEACHER: - span.textContent = `${He} is the Schoolteacher and is not available for other work`; - break; - case Job.CONCUBINE: - span.textContent = `${He} is your Concubine and is not available for other work`; - break; - case Job.WARDEN: - span.textContent = `${He} is the Wardeness and is not available for other work`; - break; - default: - // CAN BE REASSIGNED - span.classList.remove("note"); - span.id = "assignmentLinks"; - span.appendChild(assignmentBlock()); - - if ((V.brothel + V.club + V.dairy + V.farmyard + V.servantsQuarters + V.masterSuite + V.spa + V.nursery + V.clinic + V.schoolroom + V.cellblock + V.arcade + V.HGSuite) > 0) { - span.append(`Transfer to: `); - span.appendChild(App.UI.jobLinks.transfersFragment(slave.ID)); - } - - div = document.createElement('div'); - div.id = "fucktoy-pref"; - div.append(fucktoyPref()); - span.appendChild(div); + span.style.fontWeight = "bold"; + + span.id = "whoreClass"; + if (!slave.whoreClass) { + span.textContent = `auto`; + } else if (slave.whoreClass === 1) { + span.textContent = `the lower class`; + } else if (slave.whoreClass === 2) { + span.textContent = `the middle class`; + } else if (slave.whoreClass === 3) { + span.textContent = `the upper class`; + } else if (slave.whoreClass === 4) { + span.textContent = `millionaires`; + } else { + span.textContent = `THERE HAS BEEN AN ERROR`; } - el.append(span); - - if (slave.assignment === Job.WHORE || slave.assignment === Job.BROTHEL) { - div = document.createElement('div'); - div.textContent = `Whoring Target: `; - span = document.createElement('span'); - span.style.fontWeight = "bold"; - - span.id = "whoreClass"; - if (!slave.whoreClass) { - span.textContent = `auto`; - } else if (slave.whoreClass === 1) { - span.textContent = `the lower class`; - } else if (slave.whoreClass === 2) { - span.textContent = `the middle class`; - } else if (slave.whoreClass === 3) { - span.textContent = `the upper class`; - } else if (slave.whoreClass === 4) { - span.textContent = `millionaires`; - } else { - span.textContent = `THERE HAS BEEN AN ERROR`; - } - div.append(span); - div.append(`. `); + div.append(span); + div.append(`. `); - div.append(App.UI.DOM.makeElement('span', `This is the highest class they are allowed to service, when eligible `, 'note')); + div.append(App.UI.DOM.makeElement('span', `This is the highest class they are allowed to service, when eligible `, 'note')); - appendLink(`Auto`, 0, true); - appendLink(`Lower Class`, 1, true); - appendLink(`Middle Class`, 2, true); - appendLink(`Upper Class`, 3, true); - appendLink(`Millionaires Class`, 4, true); - div.appendChild(App.UI.DOM.generateLinksStrip(links.map(generateLink))); + appendLink(`Auto`, 0, true); + appendLink(`Lower Class`, 1, true); + appendLink(`Middle Class`, 2, true); + appendLink(`Upper Class`, 3, true); + appendLink(`Millionaires Class`, 4, true); + div.appendChild(App.UI.DOM.generateLinksStrip(links.map(generateLink))); - el.append(div); - } + el.append(div); + } - el.append(tutorBlock()); - return el; + el.append(tutorBlock()); + return el; - function generateLink(linkDesc) { - // is it just text? - if (linkDesc.disabled) { return App.UI.DOM.disabledLink(linkDesc.text, [linkDesc.disabled]); } - // Are they already on this whoreClass? - if (linkDesc.whoreClass === slave.whoreClass) { return document.createTextNode(linkDesc.text); } - // Set up the link - const link = App.UI.DOM.link( - linkDesc.text, - () => { - slave.whoreClass = linkDesc.whoreClass; - refresh(); - }, - ); + function generateLink(linkDesc) { + // is it just text? + if (linkDesc.disabled) { return App.UI.DOM.disabledLink(linkDesc.text, [linkDesc.disabled]); } + // Are they already on this whoreClass? + if (linkDesc.whoreClass === slave.whoreClass) { return document.createTextNode(linkDesc.text); } + // Set up the link + const link = App.UI.DOM.link( + linkDesc.text, + () => { + slave.whoreClass = linkDesc.whoreClass; + refresh(); + }, + ); - // add a note node if required - if (linkDesc.note) { - App.UI.DOM.appendNewElement("span", link, linkDesc.note, "note"); - } - return link; + // add a note node if required + if (linkDesc.note) { + App.UI.DOM.appendNewElement("span", link, linkDesc.note, "note"); } + return link; + } - function assignmentBlock() { - let el = document.createElement('div'); - let title = document.createElement('div'); - const linkArray = []; - title.append(`Assignment: `); + function assignmentBlock() { + let el = document.createElement('div'); + let title = document.createElement('div'); + const linkArray = []; + title.append(`Assignment: `); - let assign = document.createElement('span'); + let assign = document.createElement('span'); + assign.style.fontWeight = "bold"; + if (slave.sentence) { + assign.textContent = `${slave.assignment} (${slave.sentence} weeks). `; + } else { + assign.textContent = `${slave.assignment}. `; + } + title.appendChild(assign); + if (V.assignmentRecords[slave.ID] && V.assignmentRecords[slave.ID] !== slave.assignment) { + title.append(`Previously: `); + assign = document.createElement('span'); assign.style.fontWeight = "bold"; - if (slave.sentence) { - assign.textContent = `${slave.assignment} (${slave.sentence} weeks). `; + assign.textContent = `${V.assignmentRecords[slave.ID]}. `; + title.appendChild(assign); + } + if (slave.assignment === Job.SUBORDINATE) { + const target = getSlave(slave.subTarget); + let linkText = ``; + if (target) { + title.appendChild(document.createTextNode(`Serving ${target.slaveName} exclusively. `)); + linkText = `Change`; + } else if (slave.subTarget === -1) { + title.appendChild(document.createTextNode(`Serving as a Stud. `)); + linkText = `Change role`; } else { - assign.textContent = `${slave.assignment}. `; + title.appendChild(document.createTextNode(`Serving all your other slaves. `)); + linkText = `Choose a specific slave to submit to`; } - title.appendChild(assign); - if (V.assignmentRecords[slave.ID] && V.assignmentRecords[slave.ID] !== slave.assignment) { - title.append(`Previously: `); - assign = document.createElement('span'); - assign.style.fontWeight = "bold"; - assign.textContent = `${V.assignmentRecords[slave.ID]}. `; - title.appendChild(assign); - } - if (slave.assignment === Job.SUBORDINATE) { - const target = getSlave(slave.subTarget); - let linkText = ``; - if (target) { - title.appendChild(document.createTextNode(`Serving ${target.slaveName} exclusively. `)); - linkText = `Change`; - } else if (slave.subTarget === -1) { - title.appendChild(document.createTextNode(`Serving as a Stud. `)); - linkText = `Change role`; - } else { - title.appendChild(document.createTextNode(`Serving all your other slaves. `)); - linkText = `Choose a specific slave to submit to`; - } - linkArray.push(App.UI.DOM.passageLink(linkText, "Subordinate Targeting", () => { V.returnTo = "Slave Interact"; })); - } - if (slave.assignment !== Job.CHOICE) { - linkArray.push( - App.UI.DOM.link( - `Stay on this assignment for another month`, - () => { - slave.sentence += 4; - refresh(); - }, - ) - ); - } - title.append(App.UI.DOM.generateLinksStrip(linkArray)); - el.appendChild(title); - - let links = document.createElement('div'); - links.className = "choices"; - links.appendChild( - App.UI.jobLinks.assignmentsFragment( - slave.ID, passage(), - (slave, assignment) => { - assignJob(slave, assignment); - } + linkArray.push(App.UI.DOM.passageLink(linkText, "Subordinate Targeting", () => { V.returnTo = "Slave Interact"; })); + } + if (slave.assignment !== Job.CHOICE) { + linkArray.push( + App.UI.DOM.link( + `Stay on this assignment for another month`, + () => { + slave.sentence += 4; + refresh(); + }, ) ); - el.appendChild(links); - return el; } + title.append(App.UI.DOM.generateLinksStrip(linkArray)); + el.appendChild(title); + + let links = document.createElement('div'); + links.className = "choices"; + links.appendChild( + App.UI.jobLinks.assignmentsFragment( + slave.ID, passage(), + (slave, assignment) => { + assignJob(slave, assignment); + } + ) + ); + el.appendChild(links); + return el; + } - function tutorBlock() { - let el = App.UI.DOM.makeElement("div"); - let title = App.UI.DOM.appendNewElement("div", el, `Private tutoring: `); - let tutor = tutorForSlave(slave); + function tutorBlock() { + let el = App.UI.DOM.makeElement("div"); + let title = App.UI.DOM.appendNewElement("div", el, `Private tutoring: `); + let tutor = tutorForSlave(slave); - if (tutor === null) { - App.UI.DOM.appendNewElement("span", title, `none.`, "bold"); - } else { - App.UI.DOM.appendNewElement("span", title, tutor + `.`, "bold"); - } + if (tutor === null) { + App.UI.DOM.appendNewElement("span", title, `none.`, "bold"); + } else { + App.UI.DOM.appendNewElement("span", title, tutor + `.`, "bold"); + } - if (tutor != null) { - App.UI.DOM.appendNewElement("span", title, ` To progress slave needs to be assigned to: "` + Job.CLASSES + `" or "` + Job.SCHOOL + `".`, "note"); - } + if (tutor != null) { + App.UI.DOM.appendNewElement("span", title, ` To progress slave needs to be assigned to: "` + Job.CLASSES + `" or "` + Job.SCHOOL + `".`, "note"); + } - let list = ["None"]; - for (const keys of Object.keys(V.slaveTutor)) { - list.push(keys); + let list = ["None"]; + for (const keys of Object.keys(V.slaveTutor)) { + list.push(keys); + } + const array = list.map((s) => { + if (shouldBeEnabled(slave, s)) { + return App.UI.DOM.link(s, () => setTutorForSlave(slave, s)); + } else { + let reason = ["Already being taught this skill."]; + return App.UI.DOM.disabledLink(s, reason); } - const array = list.map((s) => { - if (shouldBeEnabled(slave, s)) { - return App.UI.DOM.link(s, () => setTutorForSlave(slave, s)); - } else { - let reason = ["Already being taught this skill."]; - return App.UI.DOM.disabledLink(s, reason); - } - }); - App.UI.DOM.appendNewElement("div", el, App.UI.DOM.generateLinksStrip(array)); + }); + App.UI.DOM.appendNewElement("div", el, App.UI.DOM.generateLinksStrip(array)); - function shouldBeEnabled(slave, key) { - let tutor = tutorForSlave(slave); - if (tutor === null) { - return "None"; - } - return (tutor !== key); + function shouldBeEnabled(slave, key) { + let tutor = tutorForSlave(slave); + if (tutor === null) { + return "None"; } + return (tutor !== key); + } - function setTutorForSlave(slave, tutor) { - const cur = tutorForSlave(slave); + function setTutorForSlave(slave, tutor) { + const cur = tutorForSlave(slave); - if (tutor !== cur && cur != null) { - V.slaveTutor[cur].delete(slave.ID); - } - - if (cur !== tutor && tutor !== "None") { - V.slaveTutor[tutor].push(slave.ID); - } - refresh(); + if (tutor !== cur && cur != null) { + V.slaveTutor[cur].delete(slave.ID); } - return el; + if (cur !== tutor && tutor !== "None") { + V.slaveTutor[tutor].push(slave.ID); + } + refresh(); } - function useSlaveDisplay() { - // Goal: Be able to write the entire "use her" block with only dom fragments. - let el = document.createElement('div'); + return el; + } - /* + function useSlaveDisplay() { + // Goal: Be able to write the entire "use her" block with only dom fragments. + let el = document.createElement('div'); + + /* Array of objects. Each object follows the form: { text: "Link text", scene: "scene to include", @@ -303,447 +297,446 @@ App.UI.SlaveInteract.work = function(slave) { note: if a note must appear after the link } */ - const sexOptions = []; - const fillFaceOptions = []; - const fillAssOptions = []; - const dairyNameCaps = capFirstChar(V.dairyName); - // if no scene, it's just text, no link. Italicize it. - - if (slave.fuckdoll === 0) { - if (slave.vagina > -1) { - if (canDoVaginal(slave)) { - sexOptions.push({text: `Fuck ${him}`, scene: `FVagina`}); - if (canDoAnal(slave)) { - sexOptions.push({text: `Use ${his} holes`, scene: `FButt`}); - } - } else { - sexOptions.push({text: `Fuck ${him}`, disabled: `Remove ${his} chastity belt if you wish to fuck ${him}`}); + const sexOptions = []; + const fillFaceOptions = []; + const fillAssOptions = []; + const dairyNameCaps = capFirstChar(V.dairyName); + // if no scene, it's just text, no link. Italicize it. + + if (slave.fuckdoll === 0) { + if (slave.vagina > -1) { + if (canDoVaginal(slave)) { + sexOptions.push({text: `Fuck ${him}`, scene: `FVagina`}); + if (canDoAnal(slave)) { + sexOptions.push({text: `Use ${his} holes`, scene: `FButt`}); } + } else { + sexOptions.push({text: `Fuck ${him}`, disabled: `Remove ${his} chastity belt if you wish to fuck ${him}`}); } - if (slave.bellyPreg >= 300000) { - if (canDoVaginal(slave) || canDoAnal(slave)) { - sexOptions.push({text: `Fuck ${him} on ${his} belly`, scene: `FBellyFuck`}); - if (V.pregInventions >= 1) { - sexOptions.push({text: `Fuck ${him} in ${his} maternity swing`, scene: `FMaternitySwing`}); - sexOptions.push({text: `Fuck ${him} with the help of ${his} assistants`, scene: `FAssistedSex`}); - sexOptions.push({text: `Fuck ${him} in your goo pool`, scene: `FPoolSex`}); - } + } + if (slave.bellyPreg >= 300000) { + if (canDoVaginal(slave) || canDoAnal(slave)) { + sexOptions.push({text: `Fuck ${him} on ${his} belly`, scene: `FBellyFuck`}); + if (V.pregInventions >= 1) { + sexOptions.push({text: `Fuck ${him} in ${his} maternity swing`, scene: `FMaternitySwing`}); + sexOptions.push({text: `Fuck ${him} with the help of ${his} assistants`, scene: `FAssistedSex`}); + sexOptions.push({text: `Fuck ${him} in your goo pool`, scene: `FPoolSex`}); } } + } - if (canDoAnal(slave)) { - sexOptions.push({text: `Fuck ${his} ass`, scene: `FAnus`}); - } else { - sexOptions.push({text: `Fuck ${his} ass`, disabled: `Remove ${his} chastity belt if you wish to fuck ${his} ass`}); - } - sexOptions.push({text: `Use ${his} mouth`, scene: `FLips`}); - sexOptions.push({text: `Kiss ${him}`, scene: `FKiss`}); - if (hasAnyLegs(slave)) { - sexOptions.push({text: `Have ${him} dance for you`, scene: `FDance`}); - } + if (canDoAnal(slave)) { + sexOptions.push({text: `Fuck ${his} ass`, scene: `FAnus`}); + } else { + sexOptions.push({text: `Fuck ${his} ass`, disabled: `Remove ${his} chastity belt if you wish to fuck ${his} ass`}); + } + sexOptions.push({text: `Use ${his} mouth`, scene: `FLips`}); + sexOptions.push({text: `Kiss ${him}`, scene: `FKiss`}); + if (hasAnyLegs(slave)) { + sexOptions.push({text: `Have ${him} dance for you`, scene: `FDance`}); + } - sexOptions.push({text: `Play with ${his} tits`, scene: `FBoobs`}); + sexOptions.push({text: `Play with ${his} tits`, scene: `FBoobs`}); - sexOptions.push({text: `Caress ${him}`, scene: `FCaress`}); + sexOptions.push({text: `Caress ${him}`, scene: `FCaress`}); - sexOptions.push({text: `Give ${him} a hug`, scene: `FEmbrace`}); - if (V.cheatMode === 1) { - sexOptions.push({text: `Pat ${his} head`, scene: `FPat`}); - } + sexOptions.push({text: `Give ${him} a hug`, scene: `FEmbrace`}); + if (V.cheatMode === 1) { + sexOptions.push({text: `Pat ${his} head`, scene: `FPat`}); + } - sexOptions.push({text: `Grope ${his} boobs`, scene: `FondleBoobs`}); - if (slave.nipples === "fuckable" && V.PC.dick > 0) { - sexOptions.push({text: `Fuck ${his} nipples`, scene: `FNippleFuck`}); - } - if (slave.lactation > 0 && slave.boobs >= 2000 && slave.belly < 60000 && hasAnyArms(slave)) { - sexOptions.push({text: `Drink ${his} milk`, scene: `FSuckle`}); - } + sexOptions.push({text: `Grope ${his} boobs`, scene: `FondleBoobs`}); + if (slave.nipples === "fuckable" && V.PC.dick > 0) { + sexOptions.push({text: `Fuck ${his} nipples`, scene: `FNippleFuck`}); + } + if (slave.lactation > 0 && slave.boobs >= 2000 && slave.belly < 60000 && hasAnyArms(slave)) { + sexOptions.push({text: `Drink ${his} milk`, scene: `FSuckle`}); + } - if (canDoAnal(slave)) { - sexOptions.push({text: `Grope ${his} butt`, scene: `FondleButt`}); - } + if (canDoAnal(slave)) { + sexOptions.push({text: `Grope ${his} butt`, scene: `FondleButt`}); + } - if (slave.vagina > -1) { - if (canDoVaginal(slave)) { - sexOptions.push({text: `Grope ${his} pussy`, scene: `FondleVagina`}); - sexOptions.push({text: `Eat ${him} out`, scene: `FLickPussy`}); - } + if (slave.vagina > -1) { + if (canDoVaginal(slave)) { + sexOptions.push({text: `Grope ${his} pussy`, scene: `FondleVagina`}); + sexOptions.push({text: `Eat ${him} out`, scene: `FLickPussy`}); } + } - if (slave.dick > 0) { - if (!(slave.chastityPenis)) { - sexOptions.push({text: `Grope ${his} dick`, scene: `FondleDick`}); - if (canPenetrate(slave)) { - if (V.policies.sexualOpenness === 1 || slave.toyHole === "dick") { - sexOptions.push({text: `Ride ${his} dick`, scene: `FDick`}); - } + if (slave.dick > 0) { + if (!(slave.chastityPenis)) { + sexOptions.push({text: `Grope ${his} dick`, scene: `FondleDick`}); + if (canPenetrate(slave)) { + if (V.policies.sexualOpenness === 1 || slave.toyHole === "dick") { + sexOptions.push({text: `Ride ${his} dick`, scene: `FDick`}); } - } else { - sexOptions.push({text: `Use ${his} dick`, disabled: `Remove ${his} dick chastity belt if you wish to play with ${his} cock`}); } + } else { + sexOptions.push({text: `Use ${his} dick`, disabled: `Remove ${his} dick chastity belt if you wish to play with ${his} cock`}); } + } - if (hasAnyLegs(slave) && V.PC.dick > 0) { - sexOptions.push({text: `Get a footjob`, scene: `FFeet`}); - } + if (hasAnyLegs(slave) && V.PC.dick > 0) { + sexOptions.push({text: `Get a footjob`, scene: `FFeet`}); + } - if (canGetPregnant(slave) && (slave.geneticQuirks.superfetation !== 2 || V.geneticMappingUpgrade !== 0) && (slave.fuckdoll === 0) && V.seePreg !== 0) { - if (canImpreg(slave, V.PC)) { - sexOptions.push({text: `Impregnate ${him} yourself`, scene: `FPCImpreg`}); - } - if (canImpreg(slave, slave)) { - sexOptions.push({text: `Use ${his} own seed to impregnate ${him}`, scene: `FSlaveSelfImpreg`}); - } - sexOptions.push({text: `Use another slave to impregnate ${him}`, scene: `FSlaveImpreg`}); + if (canGetPregnant(slave) && (slave.geneticQuirks.superfetation !== 2 || V.geneticMappingUpgrade !== 0) && (slave.fuckdoll === 0) && V.seePreg !== 0) { + if (canImpreg(slave, V.PC)) { + sexOptions.push({text: `Impregnate ${him} yourself`, scene: `FPCImpreg`}); } - if (slave.assignment !== Job.DAIRY && slave.assignment !== Job.ARCADE && slave.assignment !== Job.CELLBLOCK) { - if (V.dairyPiping === 1) { - if ((V.milkPipeline > 88 && V.milkPipeline !== 0) || V.arcologies[0].FSPastoralistLaw === 1) { - if ((slave.inflation < 3 && slave.pregKnown === 0 && slave.bellyImplant < 1500) || slave.inflation < 1) { - if (slave.inflationType === "milk" || slave.inflationType === "none") { - fillAssOptions.push({text: `Milk`, scene: `FillUpButt`, updateSlave: {inflationType: "milk", inflationMethod: 2}}); - fillFaceOptions.push({text: `Milk`, scene: `FillUpFace`, updateSlave: {inflationType: "milk", inflationMethod: 1}}); - } + if (canImpreg(slave, slave)) { + sexOptions.push({text: `Use ${his} own seed to impregnate ${him}`, scene: `FSlaveSelfImpreg`}); + } + sexOptions.push({text: `Use another slave to impregnate ${him}`, scene: `FSlaveImpreg`}); + } + if (slave.assignment !== Job.DAIRY && slave.assignment !== Job.ARCADE && slave.assignment !== Job.CELLBLOCK) { + if (V.dairyPiping === 1) { + if ((V.milkPipeline > 88 && V.milkPipeline !== 0) || V.arcologies[0].FSPastoralistLaw === 1) { + if ((slave.inflation < 3 && slave.pregKnown === 0 && slave.bellyImplant < 1500) || slave.inflation < 1) { + if (slave.inflationType === "milk" || slave.inflationType === "none") { + fillAssOptions.push({text: `Milk`, scene: `FillUpButt`, updateSlave: {inflationType: "milk", inflationMethod: 2}}); + fillFaceOptions.push({text: `Milk`, scene: `FillUpFace`, updateSlave: {inflationType: "milk", inflationMethod: 1}}); } - } else { - fillAssOptions.push({text: `Milk`, disabled: `${dairyNameCaps} is not producing enough milk to pump through the pipes`}); - fillFaceOptions.push({text: `Milk`, disabled: `${dairyNameCaps} is not producing enough milk to pump through the pipes`}); } - if ((V.cumPipeline > 88 && V.cumPipeline !== 0) || V.arcologies[0].FSPastoralistLaw === 1) { - if ((slave.inflation < 3 && slave.pregKnown === 0 && slave.bellyImplant < 1500) || slave.inflation < 1) { - if (slave.inflationType === "cum" || slave.inflationType === "none") { - fillAssOptions.push({text: `Cum`, scene: `FillUpButt`, updateSlave: {inflationType: "cum", inflationMethod: 2}}); - fillFaceOptions.push({text: `Cum`, scene: `FillUpFace`, updateSlave: {inflationType: "cum", inflationMethod: 1}}); - } + } else { + fillAssOptions.push({text: `Milk`, disabled: `${dairyNameCaps} is not producing enough milk to pump through the pipes`}); + fillFaceOptions.push({text: `Milk`, disabled: `${dairyNameCaps} is not producing enough milk to pump through the pipes`}); + } + if ((V.cumPipeline > 88 && V.cumPipeline !== 0) || V.arcologies[0].FSPastoralistLaw === 1) { + if ((slave.inflation < 3 && slave.pregKnown === 0 && slave.bellyImplant < 1500) || slave.inflation < 1) { + if (slave.inflationType === "cum" || slave.inflationType === "none") { + fillAssOptions.push({text: `Cum`, scene: `FillUpButt`, updateSlave: {inflationType: "cum", inflationMethod: 2}}); + fillFaceOptions.push({text: `Cum`, scene: `FillUpFace`, updateSlave: {inflationType: "cum", inflationMethod: 1}}); } - } else { - fillAssOptions.push({text: `Cum`, disabled: `${dairyNameCaps} is not producing enough cum to pump through the pipes`}); - fillFaceOptions.push({text: `Cum`, disabled: `${dairyNameCaps} is not producing enough cum to pump through the pipes`}); } - } /* dairyPiping === 1 */ - if (V.boughtItem.toys.enema === 1) { - if ((slave.inflation < 3 && slave.pregKnown === 0 && slave.bellyImplant < 1500) || slave.inflation < 1) { - if (slave.inflationType === "water" || slave.inflationType === "none") { - fillAssOptions.push({text: `Water`, scene: `FillUpButt`, updateSlave: {inflationType: "water", inflationMethod: 2}}); + } else { + fillAssOptions.push({text: `Cum`, disabled: `${dairyNameCaps} is not producing enough cum to pump through the pipes`}); + fillFaceOptions.push({text: `Cum`, disabled: `${dairyNameCaps} is not producing enough cum to pump through the pipes`}); + } + } /* dairyPiping === 1 */ + if (V.boughtItem.toys.enema === 1) { + if ((slave.inflation < 3 && slave.pregKnown === 0 && slave.bellyImplant < 1500) || slave.inflation < 1) { + if (slave.inflationType === "water" || slave.inflationType === "none") { + fillAssOptions.push({text: `Water`, scene: `FillUpButt`, updateSlave: {inflationType: "water", inflationMethod: 2}}); + } + if (V.boughtItem.toys.medicalEnema === 1) { + if (slave.inflationType === "aphrodisiac" || slave.inflationType === "none") { + fillAssOptions.push({text: `Aphrodisiacs`, scene: `FillUpButt`, updateSlave: {inflationType: "aphrodisiac", inflationMethod: 2}}); } - if (V.boughtItem.toys.medicalEnema === 1) { - if (slave.inflationType === "aphrodisiac" || slave.inflationType === "none") { - fillAssOptions.push({text: `Aphrodisiacs`, scene: `FillUpButt`, updateSlave: {inflationType: "aphrodisiac", inflationMethod: 2}}); - } - if (slave.inflationType === "curative" || slave.inflationType === "none") { - fillAssOptions.push({text: `Curatives`, scene: `FillUpButt`, updateSlave: {inflationType: "curative", inflationMethod: 2}}); - } - if (slave.inflationType === "tightener" || slave.inflationType === "none") { - fillAssOptions.push({text: `Rectal tighteners`, scene: `FillUpButt`, updateSlave: {inflationType: "tightener", inflationMethod: 2}}); - } + if (slave.inflationType === "curative" || slave.inflationType === "none") { + fillAssOptions.push({text: `Curatives`, scene: `FillUpButt`, updateSlave: {inflationType: "curative", inflationMethod: 2}}); } - } /* inflation < 3 */ - } /* enema === 1 */ - if (V.wcPiping === 1) { - if ((slave.inflation < 3 && slave.pregKnown === 0 && slave.bellyImplant < 1500) || slave.inflation < 1) { - if (slave.inflationType === "urine" || slave.inflationType === "none") { - fillAssOptions.push({text: `Urine`, scene: `FillUpButt`, updateSlave: {inflationType: "urine", inflationMethod: 2}}); + if (slave.inflationType === "tightener" || slave.inflationType === "none") { + fillAssOptions.push({text: `Rectal tighteners`, scene: `FillUpButt`, updateSlave: {inflationType: "tightener", inflationMethod: 2}}); } } - } /* wcPiping === 1 */ - } /* assigned to dairy or arcade */ - if (slave.inflation === 0 && slave.bellyImplant < 1500) { - if (slave.assignment !== Job.DAIRY && slave.assignment !== Job.ARCADE && slave.assignment !== Job.CELLBLOCK) { - if (V.boughtItem.toys.buckets === 1) { - fillFaceOptions.push({text: `Two liters of slave food`, scene: `forceFeeding`, updateSlave: {inflation: 1, inflationType: "food", inflationMethod: 1}}); - if (slave.pregKnown === 0) { - fillFaceOptions.push({text: `A gallon of slave food`, scene: `forceFeeding`, updateSlave: {inflation: 2, inflationType: "food", inflationMethod: 1}}); - fillFaceOptions.push({text: `Two gallons of slave food`, scene: `forceFeeding`, updateSlave: {inflation: 3, inflationType: "food", inflationMethod: 1}}); - } + } /* inflation < 3 */ + } /* enema === 1 */ + if (V.wcPiping === 1) { + if ((slave.inflation < 3 && slave.pregKnown === 0 && slave.bellyImplant < 1500) || slave.inflation < 1) { + if (slave.inflationType === "urine" || slave.inflationType === "none") { + fillAssOptions.push({text: `Urine`, scene: `FillUpButt`, updateSlave: {inflationType: "urine", inflationMethod: 2}}); + } + } + } /* wcPiping === 1 */ + } /* assigned to dairy or arcade */ + if (slave.inflation === 0 && slave.bellyImplant < 1500) { + if (slave.assignment !== Job.DAIRY && slave.assignment !== Job.ARCADE && slave.assignment !== Job.CELLBLOCK) { + if (V.boughtItem.toys.buckets === 1) { + fillFaceOptions.push({text: `Two liters of slave food`, scene: `forceFeeding`, updateSlave: {inflation: 1, inflationType: "food", inflationMethod: 1}}); + if (slave.pregKnown === 0) { + fillFaceOptions.push({text: `A gallon of slave food`, scene: `forceFeeding`, updateSlave: {inflation: 2, inflationType: "food", inflationMethod: 1}}); + fillFaceOptions.push({text: `Two gallons of slave food`, scene: `forceFeeding`, updateSlave: {inflation: 3, inflationType: "food", inflationMethod: 1}}); } - fillFaceOptions.push({text: `Get another slave to do it`, goto: `SlaveOnSlaveFeedingWorkAround`}); } + fillFaceOptions.push({text: `Get another slave to do it`, goto: `SlaveOnSlaveFeedingWorkAround`}); } - if (canDoVaginal(slave)) { - sexOptions.push({text: `Have another slave fuck ${his} pussy`, scene: `FSlaveSlaveVag`}); + } + if (canDoVaginal(slave)) { + sexOptions.push({text: `Have another slave fuck ${his} pussy`, scene: `FSlaveSlaveVag`}); + } + if (canPenetrate(slave)) { + sexOptions.push({text: `Have another slave ride ${his} cock`, scene: `FSlaveSlaveDick`}); + } else if (slave.clit >= 4) { + sexOptions.push({text: `Have another slave ride ${his} clit-dick`, scene: `FSlaveSlaveDick`}); + } + if (V.seeBestiality) { + if (V.farmyardKennels > 0 && V.activeCanine) { + sexOptions.push({text: `Have a ${V.activeCanine.species} mount ${him}`, scene: `BeastFucked`, update: {animalType: "canine"}}); } - if (canPenetrate(slave)) { - sexOptions.push({text: `Have another slave ride ${his} cock`, scene: `FSlaveSlaveDick`}); - } else if (slave.clit >= 4) { - sexOptions.push({text: `Have another slave ride ${his} clit-dick`, scene: `FSlaveSlaveDick`}); + if (V.farmyardStables > 0 && V.activeHooved) { + sexOptions.push({text: `Let a ${V.activeHooved.species} mount ${him}`, scene: `BeastFucked`, update: {animalType: "hooved"}}); } - if (V.seeBestiality) { - if (V.farmyardKennels > 0 && V.activeCanine) { - sexOptions.push({text: `Have a ${V.activeCanine.species} mount ${him}`, scene: `BeastFucked`, update: {animalType: "canine"}}); - } - if (V.farmyardStables > 0 && V.activeHooved) { - sexOptions.push({text: `Let a ${V.activeHooved.species} mount ${him}`, scene: `BeastFucked`, update: {animalType: "hooved"}}); - } - if (V.farmyardCages > 0 && V.activeFeline) { - sexOptions.push({text: `Have a ${V.activeFeline.species} mount ${him}`, scene: `BeastFucked`, update: {animalType: "feline"}}); - } + if (V.farmyardCages > 0 && V.activeFeline) { + sexOptions.push({text: `Have a ${V.activeFeline.species} mount ${him}`, scene: `BeastFucked`, update: {animalType: "feline"}}); } - sexOptions.push({text: `Abuse ${him}`, scene: `FAbuse`}); - if (V.seeIncest === 1) { - const availRelatives = availableRelatives(slave); - if (availRelatives.mother) { - sexOptions.push({text: `Fuck ${him} with ${his} mother`, scene: `FRelation`, update: {partner: "mother"}}); - } else if (availRelatives.motherName !== null) { - sexOptions.push({text: `${His} mother, ${availRelatives.motherName}, is unavailable`}); - } - /* + } + sexOptions.push({text: `Abuse ${him}`, scene: `FAbuse`}); + if (V.seeIncest === 1) { + const availRelatives = availableRelatives(slave); + if (availRelatives.mother) { + sexOptions.push({text: `Fuck ${him} with ${his} mother`, scene: `FRelation`, update: {partner: "mother"}}); + } else if (availRelatives.motherName !== null) { + sexOptions.push({text: `${His} mother, ${availRelatives.motherName}, is unavailable`}); + } + /* if (availRelatives.father) { sexOptions.push({text: `Fuck ${him} with ${his} father`, scene: `FRelation`, update: {partner: "father"}}); } else if (availRelatives.fatherName !== null) { sexOptions.push({text: `${His} father, ${availRelatives.motherName}, is unavailable`}); } */ - if (slave.daughters > 0) { - if (availRelatives.daughters === 0) { - if (slave.daughters === 1) { - sexOptions.push({text: `Fuck ${him} with ${his} daughter`, disabled: `${His} ${availRelatives.oneDaughterRel} is unavailable`}); - } else { - sexOptions.push({text: `Fuck ${him} with one of ${his} daughters`, disabled: `${His} daughters are unavailable`}); - } + if (slave.daughters > 0) { + if (availRelatives.daughters === 0) { + if (slave.daughters === 1) { + sexOptions.push({text: `Fuck ${him} with ${his} daughter`, disabled: `${His} ${availRelatives.oneDaughterRel} is unavailable`}); } else { - if (slave.daughters === 1) { - sexOptions.push({text: `Fuck ${him} with ${his} ${availRelatives.oneDaughterRel}`, scene: `FRelation`, update: {partner: "daughter"}}); - } else { - sexOptions.push({text: `Fuck ${him} with one of ${his} daughters`, scene: `FRelation`, update: {partner: "daughter"}}); - } - /* + sexOptions.push({text: `Fuck ${him} with one of ${his} daughters`, disabled: `${His} daughters are unavailable`}); + } + } else { + if (slave.daughters === 1) { + sexOptions.push({text: `Fuck ${him} with ${his} ${availRelatives.oneDaughterRel}`, scene: `FRelation`, update: {partner: "daughter"}}); + } else { + sexOptions.push({text: `Fuck ${him} with one of ${his} daughters`, scene: `FRelation`, update: {partner: "daughter"}}); + } + /* if (availRelatives.daughters > 1) { sexOptions.push({text: `Fuck ${him} with ${his} daughters`, scene: `FRelation`, update: {partner: "daughter"}}); } */ - } } - if (slave.sisters > 0) { - if (availRelatives.sisters === 0) { - if (slave.sisters === 1) { - sexOptions.push({text: `Fuck ${him} with ${his} sister`, disabled: `${His} ${availRelatives.oneSisterRel} is unavailable`}); - } else { - sexOptions.push({text: `Fuck ${him} with one of ${his} sisters`, disabled: `${His} sisters are unavailable`}); - } + } + if (slave.sisters > 0) { + if (availRelatives.sisters === 0) { + if (slave.sisters === 1) { + sexOptions.push({text: `Fuck ${him} with ${his} sister`, disabled: `${His} ${availRelatives.oneSisterRel} is unavailable`}); } else { - if (slave.sisters === 1) { - sexOptions.push({text: `Fuck ${him} with ${his} ${availRelatives.oneSisterRel}`, scene: `FRelation`, update: {partner: "sister"}}); - } else { - sexOptions.push({text: `Fuck ${him} with one of ${his} sisters`, scene: `FRelation`, update: {partner: "sister"}}); - } - /* + sexOptions.push({text: `Fuck ${him} with one of ${his} sisters`, disabled: `${His} sisters are unavailable`}); + } + } else { + if (slave.sisters === 1) { + sexOptions.push({text: `Fuck ${him} with ${his} ${availRelatives.oneSisterRel}`, scene: `FRelation`, update: {partner: "sister"}}); + } else { + sexOptions.push({text: `Fuck ${him} with one of ${his} sisters`, scene: `FRelation`, update: {partner: "sister"}}); + } + /* if (availRelatives.sisters > 1) { sexOptions.push({text: `Fuck ${him} with ${his} sisters`, scene: `FRelation`, update: {partner: "sisters}}); } */ - } } } - if (slave.relationship > 0) { - const lover = getSlave(slave.relationshipTarget); - if (isSlaveAvailable(lover)) { - sexOptions.push({text: `Fuck ${him} with ${his} ${relationshipTermShort(slave)} ${SlaveFullName(lover)}`, scene: `FRelation`, update: {partner: "relationship"}}); - } else if (lover.assignment === Job.AGENT) { - if (slave.broodmother < 2) { - sexOptions.push({text: `Send ${him} to live with your agent ${SlaveFullName(lover)}`, goto: `Agent Company`, update: {subSlave: lover}}); - } else { - sexOptions.push({text: `A hyper-broodmother cannot be sent to live with your agent`}); - } + } + if (slave.relationship > 0) { + const lover = getSlave(slave.relationshipTarget); + if (isSlaveAvailable(lover)) { + sexOptions.push({text: `Fuck ${him} with ${his} ${relationshipTermShort(slave)} ${SlaveFullName(lover)}`, scene: `FRelation`, update: {partner: "relationship"}}); + } else if (lover.assignment === Job.AGENT) { + if (slave.broodmother < 2) { + sexOptions.push({text: `Send ${him} to live with your agent ${SlaveFullName(lover)}`, goto: `Agent Company`, update: {subSlave: lover}}); } else { - sexOptions.push({text: `${SlaveFullName(lover)} is unavailable`}); - } - } - if (slave.rivalryTarget !== 0 && hasAllLimbs(slave)) { - const rival = getSlave(slave.relationshipTarget); - if (isSlaveAvailable(rival) && hasAnyLegs(rival)) { - sexOptions.push({text: `Abuse ${his} rival with ${him}`, scene: `FRival`}); + sexOptions.push({text: `A hyper-broodmother cannot be sent to live with your agent`}); } + } else { + sexOptions.push({text: `${SlaveFullName(lover)} is unavailable`}); } - if (slave.fetish !== "mindbroken" && (canTalk(slave) || hasAnyArms(slave))) { - sexOptions.push({text: `Ask ${him} about ${his} feelings`, scene: `FFeelings`}); - if (V.PC.dick > 0) { - sexOptions.push({text: `Make ${him} beg`, scene: `FBeg`}); - } + } + if (slave.rivalryTarget !== 0 && hasAllLimbs(slave)) { + const rival = getSlave(slave.relationshipTarget); + if (isSlaveAvailable(rival) && hasAnyLegs(rival)) { + sexOptions.push({text: `Abuse ${his} rival with ${him}`, scene: `FRival`}); } - if (slave.devotion >= 100 && slave.relationship < 0 && slave.relationship > -3) { - sexOptions.push({text: `Talk to ${him} about relationships`, goto: `Matchmaking`, update: {subSlave: 0}}); + } + if (slave.fetish !== "mindbroken" && (canTalk(slave) || hasAnyArms(slave))) { + sexOptions.push({text: `Ask ${him} about ${his} feelings`, scene: `FFeelings`}); + if (V.PC.dick > 0) { + sexOptions.push({text: `Make ${him} beg`, scene: `FBeg`}); } - let ML = V.marrying.length; - if ((V.policies.mixedMarriage === 1 || V.cheatMode === 1) && slave.relationship !== 5 && slave.relationship !== -3) { - if (V.marrying.includes(slave.ID)) { - sexOptions.push({text: `Marry ${him}`, disabled: `You are already marrying ${him} this weekend`}); - } else { - if (ML < 2) { - if (V.cheatMode === 1 || ML === 0) { - sexOptions.push({text: `Marry ${him}`, goto: "FMarry"}); - } else { - sexOptions.push({text: `Marry ${him}`, disabled: `You already have a wedding planned for this weekend`}); - } + } + if (slave.devotion >= 100 && slave.relationship < 0 && slave.relationship > -3) { + sexOptions.push({text: `Talk to ${him} about relationships`, goto: `Matchmaking`, update: {subSlave: 0}}); + } + let ML = V.marrying.length; + if ((V.policies.mixedMarriage === 1 || V.cheatMode === 1) && slave.relationship !== 5 && slave.relationship !== -3) { + if (V.marrying.includes(slave.ID)) { + sexOptions.push({text: `Marry ${him}`, disabled: `You are already marrying ${him} this weekend`}); + } else { + if (ML < 2) { + if (V.cheatMode === 1 || ML === 0) { + sexOptions.push({text: `Marry ${him}`, goto: "FMarry"}); } else { - sexOptions.push({text: `Marry ${him}`, disabled: `You can only marry up to two slaves per week`}); + sexOptions.push({text: `Marry ${him}`, disabled: `You already have a wedding planned for this weekend`}); } + } else { + sexOptions.push({text: `Marry ${him}`, disabled: `You can only marry up to two slaves per week`}); } } - if (V.cheatMode === 1) { - sexOptions.push({text: `Check ${his} stats`, goto: `Slave Stats`}); - } - } else { - /* IS A FUCKDOLL */ - sexOptions.push({text: `Fuck ${his} face hole`, scene: `FFuckdollOral`}); - if (canDoVaginal(slave)) { - sexOptions.push({text: `Fuck ${his} front hole`, scene: `FFuckdollVaginal`}); - } - if (canGetPregnant(slave) && (slave.geneticQuirks.superfetation !== 2 || V.geneticMappingUpgrade !== 0) && V.seePreg !== 0) { - if (canImpreg(slave, V.PC)) { - sexOptions.push({text: `Put a baby in ${him}`, scene: `FFuckdollImpreg`}); - } - } - if (canDoAnal(slave)) { - sexOptions.push({text: `Fuck ${his} rear hole`, scene: `FFuckdollAnal`}); + } + if (V.cheatMode === 1) { + sexOptions.push({text: `Check ${his} stats`, goto: `Slave Stats`}); + } + } else { + /* IS A FUCKDOLL */ + sexOptions.push({text: `Fuck ${his} face hole`, scene: `FFuckdollOral`}); + if (canDoVaginal(slave)) { + sexOptions.push({text: `Fuck ${his} front hole`, scene: `FFuckdollVaginal`}); + } + if (canGetPregnant(slave) && (slave.geneticQuirks.superfetation !== 2 || V.geneticMappingUpgrade !== 0) && V.seePreg !== 0) { + if (canImpreg(slave, V.PC)) { + sexOptions.push({text: `Put a baby in ${him}`, scene: `FFuckdollImpreg`}); } } - let activeSlaveRepSacrifice = repGainSacrifice(slave, V.arcologies[0]); - if (activeSlaveRepSacrifice > 0 && V.arcologies[0].FSPaternalist === "unset" && (slave.breedingMark === 0 || V.propOutcome === 0 || V.eugenicsFullControl === 1 || V.arcologies[0].FSRestart === "unset")) { - sexOptions.push({ - text: `Sacrifice ${him} on the altar`, - goto: `Aztec Slave Sacrifice`, - note: `This will kill ${him} and gain you ${activeSlaveRepSacrifice} reputation`, - update: {sacrificeType: "life"} - }); - } - el.append(`Use ${him}: `); - el.appendChild(generateRows(sexOptions)); - if (!jQuery.isEmptyObject(fillFaceOptions)) { - let fill = document.createElement('div'); - fill.appendChild(document.createTextNode(` Fill ${his} mouth with: `)); - fill.appendChild(generateRows(fillFaceOptions)); - el.appendChild(fill); - } - if (!jQuery.isEmptyObject(fillAssOptions)) { - let fill = document.createElement('div'); - fill.appendChild(document.createTextNode(` Fill ${his} ass with: `)); - fill.appendChild(generateRows(fillAssOptions)); - el.appendChild(fill); - } - - function generateRows(sexArray) { - const linkArray = []; - for (let i = 0; i < sexArray.length; i++) { - let link; - - // is it just text? - if (sexArray[i].disabled) { - link = App.UI.DOM.disabledLink(sexArray[i].text, [sexArray[i].disabled]); - } else { - let passage = ""; - if (sexArray[i].goto) { - passage = sexArray[i].goto; - } + if (canDoAnal(slave)) { + sexOptions.push({text: `Fuck ${his} rear hole`, scene: `FFuckdollAnal`}); + } + } + let activeSlaveRepSacrifice = repGainSacrifice(slave, V.arcologies[0]); + if (activeSlaveRepSacrifice > 0 && V.arcologies[0].FSPaternalist === "unset" && (slave.breedingMark === 0 || V.propOutcome === 0 || V.eugenicsFullControl === 1 || V.arcologies[0].FSRestart === "unset")) { + sexOptions.push({ + text: `Sacrifice ${him} on the altar`, + goto: `Aztec Slave Sacrifice`, + note: `This will kill ${him} and gain you ${activeSlaveRepSacrifice} reputation`, + update: {sacrificeType: "life"} + }); + } + el.append(`Use ${him}: `); + el.appendChild(generateRows(sexOptions)); + if (!jQuery.isEmptyObject(fillFaceOptions)) { + let fill = document.createElement('div'); + fill.appendChild(document.createTextNode(` Fill ${his} mouth with: `)); + fill.appendChild(generateRows(fillFaceOptions)); + el.appendChild(fill); + } + if (!jQuery.isEmptyObject(fillAssOptions)) { + let fill = document.createElement('div'); + fill.appendChild(document.createTextNode(` Fill ${his} ass with: `)); + fill.appendChild(generateRows(fillAssOptions)); + el.appendChild(fill); + } - // Set up the link - link = App.UI.DOM.link( - sexArray[i].text, - () => { click(sexArray[i]); }, - [], - passage - ); - - // add a note node if required - if (sexArray[i].note) { - link.appendChild(App.UI.DOM.makeElement('span', sexArray[i].note, 'note')); - } + function generateRows(sexArray) { + const linkArray = []; + for (let i = 0; i < sexArray.length; i++) { + let link; + + // is it just text? + if (sexArray[i].disabled) { + link = App.UI.DOM.disabledLink(sexArray[i].text, [sexArray[i].disabled]); + } else { + let passage = ""; + if (sexArray[i].goto) { + passage = sexArray[i].goto; + } + + // Set up the link + link = App.UI.DOM.link( + sexArray[i].text, + () => { click(sexArray[i]); }, + [], + passage + ); + + // add a note node if required + if (sexArray[i].note) { + link.appendChild(App.UI.DOM.makeElement('span', sexArray[i].note, 'note')); } - linkArray.push(link); } + linkArray.push(link); + } - return App.UI.DOM.generateLinksStrip(linkArray); + return App.UI.DOM.generateLinksStrip(linkArray); - function click(sexOption) { - if (sexOption.updateSlave) { - Object.assign(slave, sexOption.updateSlave); - } - if (sexOption.update) { - Object.assign(V, sexOption.update); - } + function click(sexOption) { + if (sexOption.updateSlave) { + Object.assign(slave, sexOption.updateSlave); + } + if (sexOption.update) { + Object.assign(V, sexOption.update); + } - if (sexOption.goto) { - // just play the passage, no need to refresh anything here - Engine.play(sexOption.goto); - } else if (sexOption.scene) { - // Run scene and store render results temporarily - let frag = App.UI.DOM.renderPassage(sexOption.scene); + if (sexOption.goto) { + // just play the passage, no need to refresh anything here + Engine.play(sexOption.goto); + } else if (sexOption.scene) { + // Run scene and store render results temporarily + let frag = App.UI.DOM.renderPassage(sexOption.scene); - // Refresh (clears scene display) - refresh(); + // Refresh (clears scene display) + refresh(); - // Display scene render results - $("#mini-scene").append(frag); - } else { - // just refresh - refresh(); - } + // Display scene render results + $("#mini-scene").append(frag); + } else { + // just refresh + refresh(); } } - return el; } + return el; + } - function fucktoyPref() { - const el = document.createElement('div'); - let links = []; + function fucktoyPref() { + const el = document.createElement('div'); + let links = []; - function appendLink(text, toyHole, enabled, disabledText) { - const link = {text: text}; - if (enabled) { - link.toyHole = toyHole; - } else { - link.disabled = disabledText; - } - links.push(link); + function appendLink(text, toyHole, enabled, disabledText) { + const link = {text: text}; + if (enabled) { + link.toyHole = toyHole; + } else { + link.disabled = disabledText; } + links.push(link); + } - if ((slave.assignment === App.Data.Facilities.penthouse.jobs.fucktoy.assignment) || (slave.assignment === App.Data.Facilities.masterSuite.jobs.fucktoy.assignment) || (slave.assignment === App.Data.Facilities.masterSuite.manager.assignment)) { - App.UI.DOM.appendNewElement("span", el, "Fucktoy use preference:", "story-label"); - el.append(` `); + if ((slave.assignment === App.Data.Facilities.penthouse.jobs.fucktoy.assignment) || (slave.assignment === App.Data.Facilities.masterSuite.jobs.fucktoy.assignment) || (slave.assignment === App.Data.Facilities.masterSuite.manager.assignment)) { + App.UI.DOM.appendNewElement("span", el, "Fucktoy use preference:", "story-label"); + el.append(` `); - const hole = App.UI.DOM.appendNewElement('span', el, `${slave.toyHole}. `); - hole.style.fontWeight = "bold"; + const hole = App.UI.DOM.appendNewElement('span', el, `${slave.toyHole}. `); + hole.style.fontWeight = "bold"; - appendLink('Mouth', 'mouth', true); - appendLink('Tits', 'boobs', true); - if (slave.vagina >= 0) { - appendLink('Pussy', 'pussy', slave.vagina > 0 && canDoVaginal(slave), `Take ${his} virginity before giving ${his} pussy special attention`); - } - appendLink('Ass', 'ass', (slave.anus > 0) && canDoAnal(slave), `Take ${his} anal virginity before giving ${his} ass special attention`); - if (slave.dick > 0 && canPenetrate(slave)) { - appendLink('Dick', 'dick', true); - } - appendLink('No Preference', "all her holes", true); + appendLink('Mouth', 'mouth', true); + appendLink('Tits', 'boobs', true); + if (slave.vagina >= 0) { + appendLink('Pussy', 'pussy', slave.vagina > 0 && canDoVaginal(slave), `Take ${his} virginity before giving ${his} pussy special attention`); } + appendLink('Ass', 'ass', (slave.anus > 0) && canDoAnal(slave), `Take ${his} anal virginity before giving ${his} ass special attention`); + if (slave.dick > 0 && canPenetrate(slave)) { + appendLink('Dick', 'dick', true); + } + appendLink('No Preference', "all her holes", true); + } - function generateLink(linkDesc) { - // is it just text? - if (linkDesc.disabled) { return App.UI.DOM.disabledLink(linkDesc.text, [linkDesc.disabled]); } - // Are they already on this toyHole? - if (linkDesc.toyHole === slave.toyHole) { return document.createTextNode(linkDesc.text); } - // Set up the link - const link = App.UI.DOM.link( - linkDesc.text, - () => { - slave.toyHole = linkDesc.toyHole; - jQuery('#fucktoy-pref').empty().append(fucktoyPref()); - }, - ); + function generateLink(linkDesc) { + // is it just text? + if (linkDesc.disabled) { return App.UI.DOM.disabledLink(linkDesc.text, [linkDesc.disabled]); } + // Are they already on this toyHole? + if (linkDesc.toyHole === slave.toyHole) { return document.createTextNode(linkDesc.text); } + // Set up the link + const link = App.UI.DOM.link( + linkDesc.text, + () => { + slave.toyHole = linkDesc.toyHole; + jQuery('#fucktoy-pref').empty().append(fucktoyPref()); + }, + ); - // add a note node if required - if (linkDesc.note) { - App.UI.DOM.appendNewElement("span", link, linkDesc.note, "note"); - } - return link; + // add a note node if required + if (linkDesc.note) { + App.UI.DOM.appendNewElement("span", link, linkDesc.note, "note"); } + return link; + } - el.appendChild(App.UI.DOM.generateLinksStrip(links.map(generateLink))); + el.appendChild(App.UI.DOM.generateLinksStrip(links.map(generateLink))); - return el; - } + return el; } function refresh() { - jQuery("#si-work").empty().append(work()); + jQuery("#si-work").empty().append(App.UI.SlaveInteract.work(slave)); } }; diff --git a/src/interaction/slaveInteract.js b/src/interaction/slaveInteract.js index ab9a7b7d57ad5f1e4feb15ce6bc5738939e6f7ae..512fc04de2acade0d594f99ebe93491120b24ae3 100644 --- a/src/interaction/slaveInteract.js +++ b/src/interaction/slaveInteract.js @@ -79,48 +79,57 @@ App.UI.SlaveInteract.mainPage = function(slave) { { title: "Description", id: "description", - onClick: () => jQuery("#si-description").empty().append(App.UI.SlaveInteract.description(slave)), - get node() { return App.UI.SlaveInteract.descriptionWrapper(slave); } + onClick: () => jQuery("#content-description").empty().append(App.UI.SlaveInteract.description(slave)), + get node() { return App.UI.SlaveInteract.description(slave); } }, { title: "Modify", id: "modify", + onClick: () => jQuery("#content-modify").empty().append(App.UI.SlaveInteract.modify(slave)), get node() { return App.UI.SlaveInteract.modify(slave); } }, { title: "Work", id: "work", + onClick: () => jQuery("#content-work").empty().append(App.UI.SlaveInteract.work(slave)), get node() { return App.UI.SlaveInteract.work(slave); } }, { title: "Appearance", id: "appearance", + onClick: () => jQuery("#content-appearance").empty().append(App.UI.SlaveInteract.wardrobe(slave)), get node() { return App.UI.SlaveInteract.wardrobe(slave); } }, { title: "Physical Regimen", id: "physical-regimen", + onClick: () => jQuery("#content-physical-regimen").empty().append(App.UI.SlaveInteract.physicalRegimen(slave)), get node() { return App.UI.SlaveInteract.physicalRegimen(slave); } }, { title: "Rules", id: "rules", + onClick: () => jQuery("#content-rules").empty().append(App.UI.SlaveInteract.rules(slave)), get node() { return App.UI.SlaveInteract.rules(slave); } }, { title: "Financial", id: "financial", + onClick: () => jQuery("#content-financial").empty().append(App.UI.SlaveInteract.financial(slave)), get node() { return App.UI.SlaveInteract.financial(slave); } }, { title: "Customize", id: "customize", + onClick: () => jQuery("#content-customize").empty().append(App.UI.SlaveInteract.custom(slave)), get node() { return App.UI.SlaveInteract.custom(slave); } }, { title: "Family", id: "family-tab", - onClick: () => renderFamilyTree(V.slaves, slave.ID), + onClick: () => { + renderFamilyTree(V.slaves, slave.ID); + }, get node() { return App.UI.SlaveInteract.family(); } } ]; @@ -190,8 +199,15 @@ App.UI.SlaveInteract.mainPage = function(slave) { const classEl = document.createElement("div"); classEl.classList.add("content"); - classEl.append(item.node); + + const uniqueContent = document.createElement("span"); + uniqueContent.id = `content-${item.id}`; + + uniqueContent.append(item.node); + classEl.append(uniqueContent); wrapperEl.append(classEl); + + return wrapperEl; } };