diff --git a/src/interaction/slaveInteract.js b/src/interaction/slaveInteract.js index 5dbb04312fdacb30c36078b9d02f8891424b8f2b..f1e9a9faf2717dde1f092be6449898b532b94437 100644 --- a/src/interaction/slaveInteract.js +++ b/src/interaction/slaveInteract.js @@ -1708,7 +1708,7 @@ App.UI.SlaveInteract.incubator = function(slave) { 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)) {} else { + if ((slave.assignment === Job.DAIRY && V.dairyPregSetting > 0) || (slave.assignment === Job.FARMYARD && V.farmyardBreeding > 0)) { } else { let title = document.createElement('div'); let link = document.createElement('div'); link.className = "choices"; @@ -1878,7 +1878,7 @@ App.UI.SlaveInteract.nursery = function(slave) { 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)) {} else { + if ((slave.assignment === Job.DAIRY && V.dairyPregSetting > 0) || (slave.assignment === Job.FARMYARD && V.farmyardBreeding > 0)) { } else { let title = document.createElement('div'); let link = document.createElement('div'); link.className = "choices"; @@ -2036,6 +2036,9 @@ App.UI.SlaveInteract.rules = function(slave) { let div; let array; let choices; + const { + he, him, his, hers, himself, boy, He, His + } = getPronouns(slave); if (V.seePreg !== 0) { p = document.createElement('p'); if (V.universalRulesImpregnation === "HG") { @@ -2091,10 +2094,10 @@ App.UI.SlaveInteract.rules = function(slave) { } 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 = []; array.push( App.UI.DOM.link( `Include ${him}`, @@ -2111,7 +2114,15 @@ App.UI.SlaveInteract.rules = function(slave) { p.append(App.UI.DOM.passageLink("Rules Assistant Options", "Rules Assistant")); const ul = document.createElement("UL"); ul.style.margin = 0; - ul.append(V.defaultRules.filter(x => ruleApplied(slave, x)).map(x => `<li>Rule "V.{x.name}" applied</li>`).join(" ")); + V.defaultRules.filter( + x => ruleApplied(slave, x) + ).map( + x => { + const li = document.createElement('li'); + li.append(`Rule "${x.name}" applied`); + ul.append(li); + } + ); p.append(ul); } else { array.push(App.UI.DOM.passageLink("Rules Assistant Options", "Rules Assistant")); @@ -2139,232 +2150,114 @@ App.UI.SlaveInteract.rules = function(slave) { frag.append(p); p = document.createElement('p'); + App.UI.DOM.appendNewElement("h2", p, `Other Rules`); + + // Living if (slave.fuckdoll > 0) { // Rules have little meaning for living sex toys// } else { penthouseCensus(); + p.append("Living standard: "); App.UI.DOM.appendNewElement("span", p, slave.rules.living, "bold"); - } if (setup.facilityCareers.includes(slave.assignment)) { + } + if (setup.facilityCareers.includes(slave.assignment)) { // ${His} living conditions are managed by ${his} assignment.// } else if ((slave.assignment === "be your Head Girl") && (V.HGSuite === 1)) { // ${He} has ${his} own little luxurious room in the penthouse with everything ${he} needs to be a proper Head Girl.// } else if ((slave.assignment === "guard you") && (V.dojo > 1)) { // ${He} has a comfortable room in the armory to call ${his} own.// } else { - array = []; - array.push( - App.UI.DOM.link( - `Spare`, - () => { - slave.rules.living = "spare"; - App.UI.SlaveInteract.rules(slave); - } - ) - ); - array.push( - App.UI.DOM.link( - `Normal`, - () => { - slave.rules.living = "normal"; - App.UI.SlaveInteract.rules(slave); - } - ) - ); - + choices = [ + {value: "spare"}, + {value: "normal"}, + {value: "restrictive"}, + {value: "permissive"}, + {value: "mandatory"}, + ]; if (V.roomsPopulation <= V.rooms - 0.5) { - array.push( - App.UI.DOM.link( - `Luxurious`, - () => { - slave.rules.living = "luxurious"; - App.UI.SlaveInteract.rules(slave); - } - ) - ); + choices.push({value: "luxurious"}); } else { - array.push(App.UI.DOM.disabledLink(`Luxurious`, "No luxurious rooms available")); + choices.push(App.UI.DOM.disabledLink(`Luxurious`, "No luxurious rooms available")); } - p.append(App.UI.DOM.generateLinksStrip(array)); + + p.append(listChoices(choices, "rest")); } + // Rest if (V.cheatMode) { if (["be a servant", "get milked", "please you", "serve in the club", "serve the public", "whore", "work as a farmhand", "work in the brothel", "work in the dairy", "work a glory hole"].includes(slave.assignment)) { div = document.createElement("div"); div.append("Sleep rules: "); App.UI.DOM.appendNewElement("span", div, slave.rules.rest, "bold"); - array = []; - array.push( - App.UI.DOM.link( - `None`, - () => { - slave.rules.rest = "none"; - App.UI.SlaveInteract.rules(slave); - } - ) - ); - array.push( - App.UI.DOM.link( - `Cruel`, - () => { - slave.rules.rest = "cruel"; - App.UI.SlaveInteract.rules(slave); - } - ) - ); - array.push( - App.UI.DOM.link( - `Restrictive`, - () => { - slave.rules.rest = "restrictive"; - App.UI.SlaveInteract.rules(slave); - } - ) - ); - array.push( - App.UI.DOM.link( - `Permissive`, - () => { - slave.rules.rest = "permissive"; - App.UI.SlaveInteract.rules(slave); - } - ) - ); - array.push( - App.UI.DOM.link( - `Mandatory`, - () => { - slave.rules.rest = "mandatory"; - App.UI.SlaveInteract.rules(slave); - } - ) - ); - div.append(App.UI.DOM.generateLinksStrip(array)); + choices = [ + {value: "none"}, + {value: "cruel"}, + {value: "restrictive"}, + {value: "permissive"}, + {value: "mandatory"}, + ]; + div.append(listChoices(choices, "rest")); p.append(div); } } + // Punishment div = document.createElement("div"); div.append("Typical punishment: "); App.UI.DOM.appendNewElement("span", div, slave.rules.punishment, "bold"); - array = []; - array.push( - App.UI.DOM.link( - `Confinement`, - () => { - slave.rules.punishment = "confinement"; - App.UI.SlaveInteract.rules(slave); - } - ) - ); - array.push( - App.UI.DOM.link( - `Whipping`, - () => { - slave.rules.punishment = "whipping"; - App.UI.SlaveInteract.rules(slave); - } - ) - ); - array.push( - App.UI.DOM.link( - `Chastity`, - () => { - slave.rules.punishment = "chastity"; - App.UI.SlaveInteract.rules(slave); - } - ) - ); - array.push( - App.UI.DOM.link( - `Situational`, - () => { - slave.rules.punishment = "situational"; - App.UI.SlaveInteract.rules(slave); - } - ) - ); - div.append(App.UI.DOM.generateLinksStrip(array)); + choices = [ + {value: "confinement"}, + {value: "whipping"}, + {value: "orgasm"}, + {value: "chastity"}, + {value: "situational"}, + ]; + div.append(listChoices(choices, "punishment")); p.append(div); + // Reward div = document.createElement("div"); div.append("Typical reward: "); App.UI.DOM.appendNewElement("span", div, slave.rules.reward, "bold"); - array = []; - array.push( - App.UI.DOM.link( - `Relaxation`, - () => { - slave.rules.reward = "relaxation"; - App.UI.SlaveInteract.rules(slave); - } - ) - ); - array.push( - App.UI.DOM.link( - `Drugs`, - () => { - slave.rules.reward = "drugs"; - App.UI.SlaveInteract.rules(slave); - } - ) - ); - array.push( - App.UI.DOM.link( - `Orgasm`, - () => { - slave.rules.reward = "orgasm"; - App.UI.SlaveInteract.rules(slave); - } - ) - ); - array.push( - App.UI.DOM.link( - `Situational`, - () => { - slave.rules.reward = "situational"; - App.UI.SlaveInteract.rules(slave); - } - ) - ); - div.append(App.UI.DOM.generateLinksStrip(array)); + 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: "); App.UI.DOM.appendNewElement("span", div, slave.rules.lactation, "bold"); - array = []; - array.push( - App.UI.DOM.link( - `Left alone`, - () => { - slave.rules.lactation = "none"; - App.UI.SlaveInteract.rules(slave); - } - ) - ); + choices = [ + { + title: "Left alone", + value: "none", + }, + ]; + if (slave.lactation === 0) { - array.push( - App.UI.DOM.link( - `Induce lactation`, - () => { - slave.rules.lactation = "induce"; - App.UI.SlaveInteract.rules(slave); - } - ) + choice.push( + { + title: "Induce lactation", + value: "induce", + } ); } else { - array.push( - App.UI.DOM.link( - `Maintain lactation`, - () => { - slave.rules.lactation = "maintain"; - App.UI.SlaveInteract.rules(slave); - } - ) + choice.push( + { + title: "Maintain lactation", + value: "maintain", + } ); } + div.append(listChoices(choices, "lactation")); + p.append(div); } p.append(orgasm(slave)); @@ -2374,28 +2267,16 @@ App.UI.SlaveInteract.rules = function(slave) { div.append("Speech rules: "); App.UI.DOM.appendNewElement("span", div, slave.rules.speech, "bold"); choices = [ - { - title: "Restrictive", - value: "restrictive", - }, - { - title: "Permissive", - value: "permissive", - }, + {value: "restrictive"}, + {value: "permissive"}, ]; if (slave.accent > 0 && slave.accent < 4) { choices.push( - { - title: "Accent elimination", - value: "accent elimination", - }, + {value: "accent elimination"}, ); } else if (slave.accent > 3) { choices.push( - { - title: "Language lessons", - value: "language lessons", - }, + {value: "language lessons"}, ); } div.append(listChoices(choices, "speech")); @@ -2406,39 +2287,36 @@ App.UI.SlaveInteract.rules = function(slave) { div.append("Relationship rules: "); App.UI.DOM.appendNewElement("span", div, slave.rules.relationship, "bold"); choices = [ - { - title: "Restrictive", - value: "restrictive", - }, - { - title: "Just friends", - value: "just friends", - }, - { - title: "Permissive", - value: "permissive", - }, + {value: "restrictive"}, + {value: "just friends"}, + {value: "permissive"}, ]; div.append(listChoices(choices, "relationship")); p.append(div); p.append(smartSettings(slave)); + frag.append(p); + return jQuery('#rules').empty().append(frag); - return jQuery('#rules').empty().append(el); function listChoices(choices, property) { const links = []; for (const c of choices) { - array.push( - App.UI.DOM.link( - c.title, - () => { - slave.rules.speech = c.value; - App.UI.SlaveInteract[property](slave); - } - ) - ); + if (typeof c == "object") { + const title = c.title || capFirstChar(c.value); + links.push( + App.UI.DOM.link( + title, + () => { + slave.rules[property] = c.value; + App.UI.SlaveInteract.rules(slave); + } + ) + ); + } else { // node + links.push(c); + } } - return App.UI.DOM.generateLinksStrip(array); + return App.UI.DOM.generateLinksStrip(links); } function orgasm(slave) { let el = document.createElement('div'); @@ -3491,7 +3369,6 @@ App.UI.SlaveInteract.refreshAll = function(slave) { App.UI.SlaveInteract.diet(slave); App.UI.SlaveInteract.dietBase(slave); App.UI.SlaveInteract.snacks(slave); - App.UI.SlaveInteract.smartSettings(slave); - App.UI.SlaveInteract.orgasm(slave); + App.UI.SlaveInteract.rules(slave); App.UI.SlaveInteract.work(slave); }; diff --git a/src/uncategorized/slaveInteract.tw b/src/uncategorized/slaveInteract.tw index 23f69235becfe32ed3c72112c6c6c0302c1b521a..46ba3454f437d529763d019fea65732ac0a5acd0 100644 --- a/src/uncategorized/slaveInteract.tw +++ b/src/uncategorized/slaveInteract.tw @@ -259,125 +259,8 @@ <div id="Rules" class="tabcontent"> <div class="content"> - <p> - <<if $seePreg != 0>> - <<if $universalRulesImpregnation == "HG">> - <<if getSlave($AS).HGExclude == 0>> - Will be bred by the Head Girl when fertile. <<link "Exempt $him" "Slave Interact">><<set getSlave($AS).HGExclude = 1>><</link>> - <<else>> - Will not be bred by the Head Girl when fertile. <<link "Include $him" "Slave Interact">><<set getSlave($AS).HGExclude = 0>><</link>> - <</if>> - <<elseif $universalRulesImpregnation == "Stud">> - <<if getSlave($AS).StudExclude == 0>> - Will be bred by your Stud when fertile. <<link "Exempt $him" "Slave Interact">><<set getSlave($AS).StudExclude = 1>><</link>> - <<else>> - Will not be bred by your Stud when fertile. <<link "Include $him" "Slave Interact">><<set getSlave($AS).StudExclude = 0>><</link>> - <</if>> - <</if>> - <</if>> - </p> - - <p> - <<if getSlave($AS).useRulesAssistant == 0>> - <span class="gray"> - ''Not subject'' to the Rules Assistant. - </span> - <<link "Include $him" "Slave Interact">> - <<set getSlave($AS).useRulesAssistant = 1>> - <</link>> - <<else>> - __Rules Assistant:__ [[Rules Assistant Options|Rules Assistant]] - - <<if (def getSlave($AS).currentRules) && (getSlave($AS).currentRules.length > 0)>> - <ul style="margin:0"> - <<= $defaultRules.filter(x => ruleApplied(getSlave($AS), x)).map(x => `<li>Rule "${x.name}" applied</li>`).join(" ") >> - </ul> - <<else>> - | - <</if>> - <span style="font-style:italic"> - <<link "Apply rules">> - <<run DefaultRules(getSlave($AS))>> - <<goto "Slave Interact">> - <</link>> - </span> - | - <<link "Exempt $him" "Slave Interact">> - <<set getSlave($AS).useRulesAssistant = 0>> - <</link>> - <</if>> - </p> - <<if getSlave($AS).fuckdoll > 0>> - //Rules have little meaning for living sex toys// - <<else>> - <<run penthouseCensus()>> - - Living standard: <span id="livingRules" style="font-weight:bold"><<= getSlave($AS).rules.living>></span>. - <<if setup.facilityCareers.includes(getSlave($AS).assignment)>> - //$His living conditions are managed by $his assignment.// - <<elseif (getSlave($AS).assignment == "be your Head Girl") && ($HGSuite == 1)>> - //$He has $his own little luxurious room in the penthouse with everything $he needs to be a proper Head Girl.// - <<elseif (getSlave($AS).assignment == "guard you") && ($dojo > 1)>> - //$He has a comfortable room in the armory to call $his own.// - <<else>> - <<link "Spare">><<set getSlave($AS).rules.living = "spare">><<replace "#livingRules">><<= getSlave($AS).rules.living>><</replace>><</link>> | - <<link "Normal">><<set getSlave($AS).rules.living = "normal">><<replace "#livingRules">><<= getSlave($AS).rules.living>><</replace>><</link>> | - <<if $roomsPopulation <= $rooms-0.5>><<link "Luxurious">><<set getSlave($AS).rules.living = "luxurious">><<replace "#livingRules">><<= getSlave($AS).rules.living>><</replace>><</link>><<else>>//No luxurious rooms available//<</if>> - <</if>> - - <<if $cheatMode>> - <<if ["be a servant", "get milked", "please you", "serve in the club", "serve the public", "whore", "work as a farmhand", "work in the brothel", "work in the dairy", "work a glory hole"].includes($activeSlave.assignment)>> - <br>Sleep rules: <span id="restRules" style="font-weight:bold"><<= getSlave($AS).rules.rest>></span>. - <<link "None">><<set getSlave($AS).rules.rest = "none">><<replace "#restRules">><<= getSlave($AS).rules.rest>><</replace>><</link>> | - <<link "Cruel">><<set getSlave($AS).rules.rest = "cruel">><<replace "#restRules">><<= getSlave($AS).rules.rest>><</replace>><</link>> | - <<link "Restrictive">><<set getSlave($AS).rules.rest = "restrictive">><<replace "#restRules">><<= getSlave($AS).rules.rest>><</replace>><</link>> | - <<link "Permissive">><<set getSlave($AS).rules.rest = "permissive">><<replace "#restRules">><<= getSlave($AS).rules.rest>><</replace>><</link>> | - <<link "Mandatory">><<set getSlave($AS).rules.rest = "mandatory">><<replace "#restRules">><<= getSlave($AS).rules.rest>><</replace>><</link>> - <</if>> - <</if>> - - <br>Typical punishment: <span id="standardPunishment" style="font-weight:bold"><<= getSlave($AS).rules.punishment>></span>. - <<link "Confinement">><<set getSlave($AS).rules.punishment = "confinement">><<replace "#standardPunishment">><<= getSlave($AS).rules.punishment>><</replace>><</link>> | - <<link "Whipping">><<set getSlave($AS).rules.punishment = "whipping">><<replace "#standardPunishment">><<= getSlave($AS).rules.punishment>><</replace>><</link>> | - <<link "Chastity">><<set getSlave($AS).rules.punishment = "chastity">><<replace "#standardPunishment">><<= getSlave($AS).rules.punishment>><</replace>><</link>> | - <<link "Situational">><<set getSlave($AS).rules.punishment = "situational">><<replace "#standardPunishment">><<= getSlave($AS).rules.punishment>><</replace>><</link>> - <br>Typical reward: <span id="standardReward" style="font-weight:bold"><<= getSlave($AS).rules.reward>></span>. - <<link "Relaxation">><<set getSlave($AS).rules.reward = "relaxation">><<replace "#standardReward">><<= getSlave($AS).rules.reward>><</replace>><</link>> | - <<link "Drugs">><<set getSlave($AS).rules.reward = "drugs">><<replace "#standardReward">><<= getSlave($AS).rules.reward>><</replace>><</link>> | - <<link "Orgasm">><<set getSlave($AS).rules.reward = "orgasm">><<replace "#standardReward">><<= getSlave($AS).rules.reward>><</replace>><</link>> | - <<link "Situational">><<set getSlave($AS).rules.reward = "situational">><<replace "#standardReward">><<= getSlave($AS).rules.reward>><</replace>><</link>> - - - <<if getSlave($AS).lactation != 2>> - <br>Lactation maintenance: <span id="lactationRules" style="font-weight:bold"><<= getSlave($AS).rules.lactation>></span>. - <<link "Left alone">><<set getSlave($AS).rules.lactation = "none">><<replace "#lactationRules">><<= getSlave($AS).rules.lactation>><</replace>><</link>> | - <<if getSlave($AS).lactation == 0>> - <<link "Induce lactation">><<set getSlave($AS).rules.lactation = "induce">><<replace "#lactationRules">><<= getSlave($AS).rules.lactation>><</replace>><</link>> - <<else>> - <<link "Maintain lactation">><<set getSlave($AS).rules.lactation = "maintain">><<replace "#lactationRules">><<= getSlave($AS).rules.lactation>><</replace>><</link>> - <</if>> - <</if>> - - <span id="orgasm"></span> - <script>App.UI.SlaveInteract.orgasm(getSlave(V.activeSlave.ID))</script> - - <<if getSlave($AS).voice != 0>> - Speech rules: <span id="speechRules" style="font-weight:bold"><<= getSlave($AS).rules.speech>></span>. - <<link "Restrictive">><<set getSlave($AS).rules.speech = "restrictive">><<replace "#speechRules">><<= getSlave($AS).rules.speech>><</replace>><</link>> | - <<link "Permissive">><<set getSlave($AS).rules.speech = "permissive">><<replace "#speechRules">><<= getSlave($AS).rules.speech>><</replace>><</link>> - <<if getSlave($AS).accent > 0 && getSlave($AS).accent < 4>>| <<link "Accent elimination">><<set getSlave($AS).rules.speech = "accent elimination">><<replace "#speechRules">><<= getSlave($AS).rules.speech>><</replace>><</link>> - <<elseif getSlave($AS).accent > 3>>| <<link "Language lessons">><<set getSlave($AS).rules.speech = "language lessons">><<replace "#speechRules">><<= getSlave($AS).rules.speech>><</replace>><</link>> - <</if>> - <</if>> - - <br> - Relationship rules: <span id="relationshipRules" style="font-weight:bold"><<= getSlave($AS).rules.relationship>></span>. - <<link "Restrictive">><<set getSlave($AS).rules.relationship = "restrictive">><<replace "#relationshipRules">><<= getSlave($AS).rules.relationship>><</replace>><</link>> | - <<link "Just friends">><<set getSlave($AS).rules.relationship = "just friends">><<replace "#relationshipRules">><<= getSlave($AS).rules.relationship>><</replace>><</link>> | - <<link "Permissive">><<set getSlave($AS).rules.relationship = "permissive">><<replace "#relationshipRules">><<= getSlave($AS).rules.relationship>><</replace>><</link>> - <</if>> - <span id="smartSettings"></span> - <script>App.UI.SlaveInteract.smartSettings(getSlave(V.activeSlave.ID))</script> + <span id="rules"></span> + <script>App.UI.SlaveInteract.rules(getSlave(V.activeSlave.ID))</script> </div> </div>