diff --git a/src/interaction/slaveInteract.js b/src/interaction/slaveInteract.js index 0bac999020850d2d74bf857af5db3e200eea533d..d8a3f70062e55d3aa90e6690a4d87ef547c39b22 100644 --- a/src/interaction/slaveInteract.js +++ b/src/interaction/slaveInteract.js @@ -531,6 +531,313 @@ App.UI.SlaveInteract.drugs = function(slave) { return jQuery('#drugs').empty().append(el); }; +App.UI.SlaveInteract.hormones = function(slave) { + let el = document.createElement('div'); + const options = []; + const level = []; + + if (slave.hormones !== 0) { + level.push({text: `None`, updateSlave: {hormones: 0}}); + } + + 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`}); + } + + 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. `; + } + } + + title.append(choice); + title.appendChild(App.UI.SlaveInteract.generateRows(level, slave)); + el.append(title); + + let links = document.createElement('div'); + links.appendChild(App.UI.SlaveInteract.generateRows(options, slave)); + links.className = "choices"; + el.append(links); + + return jQuery('#hormones').empty().append(el); +}; + +App.UI.SlaveInteract.diet = function(slave) { + const { + // eslint-disable-next-line no-unused-vars + he, + him, + his, + hers, + himself, + boy, + He, + His + } = getPronouns(slave); + let el = document.createElement('div'); + + let title = document.createElement('div'); + title.textContent = `Diet: `; + let choice = document.createElement('span'); + choice.style.fontWeight = "bold"; + choice.textContent = `${capFirstChar(slave.diet)}. `; + + title.append(choice); + el.append(title); + + 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`}); + } + } + + 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 { + 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`}); + } + + const muscle = []; + if (slave.muscles <= 95 && !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`}); + } + + if ((slave.muscles > 5 || 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 move 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 production = []; + if (slave.balls > 0 && V.cumProDiet === 1) { + production.push({text: `Cum production`, updateSlave: {diet: "cum production"}}); + } + if (isFertile(slave) && slave.preg === 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"}}); + } + } + + let links; + if (health.length) { + links = document.createElement('div'); + links.append(`Health: `); + links.appendChild(App.UI.SlaveInteract.generateRows(health, slave)); + links.className = "choices"; + el.append(links); + } + + if (weight.length) { + links = document.createElement('div'); + links.append(`Weight: `); + links.appendChild(App.UI.SlaveInteract.generateRows(weight, slave)); + links.className = "choices"; + el.append(links); + } + + if (muscle.length) { + links = document.createElement('div'); + links.append(`Muscle: `); + links.appendChild(App.UI.SlaveInteract.generateRows(muscle, slave)); + links.className = "choices"; + el.append(links); + } + + if (production.length) { + links = document.createElement('div'); + links.append(`Production: `); + links.appendChild(App.UI.SlaveInteract.generateRows(production, slave)); + links.className = "choices"; + el.append(links); + } + + if (hormone.length) { + links = document.createElement('div'); + links.append(`Hormone: `); + links.appendChild(App.UI.SlaveInteract.generateRows(hormone, slave)); + links.className = "choices"; + el.append(links); + } + + return jQuery('#diet').empty().append(el); +}; + +App.UI.SlaveInteract.dietBase = function(slave) { + let el = document.createElement('div'); + const milk = []; + const cum = []; + + // Milk + 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`}); + } + + + // 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); + + let links; + if (milk.length) { + links = document.createElement('div'); + links.append(`Milk: `); + links.appendChild(App.UI.SlaveInteract.generateRows(milk, slave)); + links.className = "choices"; + el.append(links); + } + if (cum.length) { + links = document.createElement('div'); + links.append(`Cum: `); + links.appendChild(App.UI.SlaveInteract.generateRows(cum, slave)); + links.className = "choices"; + el.append(links); + } + + return jQuery('#dietBase').empty().append(el); +}; + +App.UI.SlaveInteract.snacks = function(slave) { + const { + // eslint-disable-next-line no-unused-vars + he, + him, + his, + hers, + himself, + boy, + He, + His + } = getPronouns(slave); + 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)); + links.className = "choices"; + el.append(links); + } + + return jQuery('#snacks').empty().append(el); +}; + App.UI.SlaveInteract.useSlaveDisplay = function(slave) { // Goal: Be able to write the entire "use her" block with only dom fragments. let el = document.createElement('div'); @@ -2630,4 +2937,8 @@ App.UI.SlaveInteract.refreshAll = function(slave) { App.UI.SlaveInteract.incubator(slave); App.UI.SlaveInteract.nursery(slave); App.UI.SlaveInteract.custom(slave); + App.UI.SlaveInteract.hormones(slave); + App.UI.SlaveInteract.diet(slave); + App.UI.SlaveInteract.dietBase(slave); + App.UI.SlaveInteract.snacks(slave); }; diff --git a/src/uncategorized/slaveInteract.tw b/src/uncategorized/slaveInteract.tw index 94563e1648293ab8a1089e530db378682f18de42..52f4425885c3cc02e173d9a52d53b106c88b573b 100644 --- a/src/uncategorized/slaveInteract.tw +++ b/src/uncategorized/slaveInteract.tw @@ -315,83 +315,17 @@ <span id="bloating"></span> <script>App.UI.SlaveInteract.bloating(getSlave(V.activeSlave.ID))</script> - Hormones: <strong><span id="hormones"> - <<if getSlave($AS).hormones == -2>>intensive male<<elseif getSlave($AS).hormones == -1>>male<<elseif getSlave($AS).hormones == 2>>intensive female<<elseif getSlave($AS).hormones == 1>>female<<else>>none<</if>></span></strong>. - <<if getSlave($AS).indentureRestrictions < 2>> - <<link "Intensive Female">><<set getSlave($AS).hormones = 2>><<replace "#hormones">>intensive female<</replace>><</link>> | - <</if>> - <<link "Female">><<set getSlave($AS).hormones = 1>><<replace "#hormones">>female<</replace>><</link>> | - <<link "None">><<set getSlave($AS).hormones = 0>><<replace "#hormones">>none<</replace>><</link>> | - <<link "Male">><<set getSlave($AS).hormones = -1>><<replace "#hormones">>male<</replace>><</link>> | - <<if getSlave($AS).indentureRestrictions < 2>> - <<link "Intensive Male">><<set getSlave($AS).hormones = -2>><<replace "#hormones">>intensive male<</replace>><</link>> - <</if>> + <span id="hormones"></span> + <script>App.UI.SlaveInteract.hormones(getSlave(V.activeSlave.ID))</script> - <br>Diet: <strong><span id="diet"><<= getSlave($AS).diet>></span></strong>. - <<link "Healthy">><<set getSlave($AS).diet = "healthy">><<replace "#diet">><<= getSlave($AS).diet>><</replace>><</link>> - <<if (getSlave($AS).health.condition < 90 || getSlave($AS).chem >= 10) && ($dietCleanse == 1)>> - | <<link "Cleanse">><<set getSlave($AS).diet = "cleansing">><<replace "#diet">><<= getSlave($AS).diet>><</replace>><</link>> - <<elseif ($dietCleanse == 1)>> - | //$He is already healthy// - <</if>> - <<if (getSlave($AS).balls > 0) && ($cumProDiet == 1)>> - | <<link "Cum production">><<set getSlave($AS).diet = "cum production">><<replace "#diet">><<= getSlave($AS).diet>><</replace>><</link>> - <</if>> - <<if isFertile(getSlave($AS)) && getSlave($AS).preg == 0 && ($dietFertility == 1)>> - | <<link "Fertility">><<set getSlave($AS).diet = "fertility">><<replace "#diet">><<= getSlave($AS).diet>><</replace>><</link>> - <</if>> - <<if (getSlave($AS).weight >= -95)>> - | <<link "Lose weight">><<set getSlave($AS).diet = "restricted">><<replace "#diet">><<= getSlave($AS).diet>><</replace>><</link>> - <<else>> - | //$He is already underweight// - <</if>> - <<if getSlave($AS).weight <= 200>> - | <<link "Fatten">><<set getSlave($AS).diet = "fattening">><<replace "#diet">><<= getSlave($AS).diet>><</replace>><</link>> - <<else>> - | //$He is already extremely overweight// - <</if>> - <<if $feeder == 1>> - <<if getSlave($AS).fuckdoll == 0 && getSlave($AS).fetish != "mindbroken">> - <<if (getSlave($AS).weight > 10 || getSlave($AS).weight < -10)>> - | <<link "Correct weight">><<set getSlave($AS).diet = "corrective">><<replace "#diet">><<= getSlave($AS).diet>><</replace>><</link>> - <<else>> - //$He is already a healthy weight// - <</if>> - <</if>> - | <<link "Estrogen enriched">><<set getSlave($AS).diet = "XX">><<replace "#diet">><<= getSlave($AS).diet>><</replace>><</link>> - | <<link "Testosterone enriched">><<set getSlave($AS).diet = "XY">><<replace "#diet">><<= getSlave($AS).diet>><</replace>><</link>> - <<if $dietXXY == 1 && getSlave($AS).balls > 0 && (getSlave($AS).ovaries == 1 || getSlave($AS).mpreg == 1)>> - | <<link "Herm hormone blend">><<set getSlave($AS).diet = "XXY">><<replace "#diet">><<= getSlave($AS).diet>><</replace>><</link>> - <</if>> - <</if>> - <<if (getSlave($AS).muscles <= 95) && !isAmputee(getSlave($AS))>> - | <<link "Build muscle">><<set getSlave($AS).diet = "muscle building">><<replace "#diet">><<= getSlave($AS).diet>><</replace>><</link>> - <<elseif !isAmputee(getSlave($AS))>> - | //$He is maintaining $his enormous musculature// - <<else>> - | //$He has no limbs and thus can't effectively build muscle// - <</if>> - <<if (getSlave($AS).muscles > 5 || getSlave($AS).fuckdoll == 0) && canWalk(getSlave($AS))>> - | <<link "Slim down">><<set getSlave($AS).diet = "slimming">><<replace "#diet">><<= getSlave($AS).diet>><</replace>><</link>> - <<elseif !canWalk(getSlave($AS))>> - | //$He can't move and thus can't trim down// - <<elseif getSlave($AS).fuckdoll > 0>> - | //$He has no muscles left to lose// - <</if>> + <span id="diet"></span> + <script>App.UI.SlaveInteract.diet(getSlave(V.activeSlave.ID))</script> - <br>Diet Base: <strong><span id="dietBase"><<if getSlave($AS).dietCum == 2>>cum based<<elseif (getSlave($AS).dietCum == 1) && (getSlave($AS).dietMilk == 0)>>cum added<<elseif (getSlave($AS).dietCum == 1) && (getSlave($AS).dietMilk == 1)>>cum and milk added<<elseif (getSlave($AS).dietMilk == 1) && (getSlave($AS).dietCum == 0)>>milk added<<elseif (getSlave($AS).dietMilk == 2)>>milk based<<elseif (getSlave($AS).dietCum == 0) && (getSlave($AS).dietMilk == 0)>>normal<<else>>THERE HAS BEEN AN ERROR<</if>></span></strong>. - <<link "Normal">><<set getSlave($AS).dietCum = 0>><<set getSlave($AS).dietMilk = 0>><<replace "#dietBase">>normal<</replace>><</link>> | - <<link "Cum added">><<set getSlave($AS).dietCum = 1>><<set getSlave($AS).dietMilk = 0>><<replace "#dietBase">>cum added<</replace>><</link>> | - <<link "Milk added">><<set getSlave($AS).dietCum = 0>><<set getSlave($AS).dietMilk = 1>><<replace "#dietBase">>milk added<</replace>><</link>> | - <<link "Cum & milk added">><<set getSlave($AS).dietCum = 1>><<set getSlave($AS).dietMilk = 1>><<replace "#dietBase">>cum & milk added<</replace>><</link>> | - <<link "Cum based">><<set getSlave($AS).dietCum = 2>><<set getSlave($AS).dietMilk = 0>><<replace "#dietBase">>cum based<</replace>><</link>> | - <<link "Milk based">><<set getSlave($AS).dietCum = 0>><<set getSlave($AS).dietMilk = 2>><<replace "#dietBase">>milk based<</replace>><</link>> - - <<if $arcologies[0].FSHedonisticDecadenceResearch == 1>> - <br>Solid Slave Food Access: <strong><span id="snacks"><<if getSlave($AS).onDiet == 0>>Free to stuff $himself.<<else>>On a strict diet.<</if>></span></strong> - <<link "No access">><<set getSlave($AS).onDiet = 1>><<replace "#snacks">>On a strict diet.<</replace>><</link>> | - <<link "Full access">><<set getSlave($AS).onDiet = 0>><<replace "#snacks">>Free to stuff $himself.<</replace>><</link>> - <</if>> + <span id="dietBase"></span> + <script>App.UI.SlaveInteract.dietBase(getSlave(V.activeSlave.ID))</script> + + <span id="snacks"></span> + <script>App.UI.SlaveInteract.snacks(getSlave(V.activeSlave.ID))</script> </p> </div> </div>