From 1c82efffcbdc3d087ab084dba8a4a2e8f3039332 Mon Sep 17 00:00:00 2001 From: ezsh <ezsh.junk@gmail.com> Date: Mon, 11 Feb 2019 00:15:35 +0100 Subject: [PATCH] Convert slave summary to JS --- src/002-config/fc-js-init.js | 2 + src/art/artWidgets.tw | 5 + src/js/slaveSummaryWidgets.js | 1180 ++++++++++++++++++++++++++++- src/js/utilJS.js | 33 +- src/uncategorized/slaveSummary.tw | 1018 +------------------------ 5 files changed, 1225 insertions(+), 1013 deletions(-) diff --git a/src/002-config/fc-js-init.js b/src/002-config/fc-js-init.js index 3966b6a6838..e5d890dc402 100644 --- a/src/002-config/fc-js-init.js +++ b/src/002-config/fc-js-init.js @@ -9,3 +9,5 @@ var App = window.App || {}; App.Debug = {}; App.Entity = {}; +App.UI = {}; +App.Utils = {}; diff --git a/src/art/artWidgets.tw b/src/art/artWidgets.tw index 5155656a65a..3c6bf94f054 100644 --- a/src/art/artWidgets.tw +++ b/src/art/artWidgets.tw @@ -502,3 +502,8 @@ vector art added later is drawn over previously added art <</if>> /* CLOSES IMAGE CHOICE */ <</widget>> + +<<widget "SlaveArtById">> + <<set _s = getSlave($args[0])>> + <<SlaveArt _s $args[1]>> +<</widget>> diff --git a/src/js/slaveSummaryWidgets.js b/src/js/slaveSummaryWidgets.js index 8da38e0f2aa..3fde79aa213 100644 --- a/src/js/slaveSummaryWidgets.js +++ b/src/js/slaveSummaryWidgets.js @@ -1,4 +1,4 @@ -window.clearSummaryCache = /** @param {App.Entity.SlaveState} slave */ function clearSummaryCache(slave) { +window.clearSummaryCache = /** @param {App.Entity.SlaveState | number} slave */ function clearSummaryCache(slave) { if (!slave) setup.summaryCache = {}; else if (slave instanceof Object && slave.ID !== Infinity && slave.ID !== -Infinity) @@ -21,7 +21,8 @@ window.SlaveSummaryUncached = (function(){ "use strict"; let V, r; - /** @param {App.Entity.SlaveState} slave */ + /** @param {App.Entity.SlaveState} slave + * @returns {string} */ function SlaveSummaryUncached(slave) { V = State.variables; r = ""; @@ -4700,3 +4701,1178 @@ window.SlaveSummaryUncached = (function(){ return SlaveSummaryUncached; })(); + +App.UI.PassageSlaveFilers = { + "Main": s => (s.assignmentVisible === 1), + "Personal Attention Select": s => (s.assignmentVisible === 1 && s.fuckdoll <= 0), + "Agent Select": s => (s.fuckdoll === 0 && s.devotion > 20 && s.intelligence + s.intelligenceImplant > 15 && s.intelligenceImplant >= 15 && canWalk(s) && canSee(s) && canHear(s) && canTalk(s) && s.broodmother < 2 && (s.breedingMark !== 1 || State.variables.propOutcome === 0)), + "BG Select": s => (s.assignmentVisible === 1 && s.fuckdoll === 0 && s.devotion > 50 && s.assignment != "guard you" && canWalk(s) && canSee(s) && canHear(s) && (s.breedingMark != 1 || State.variables.propOutcome == 0)), + "Recruiter Select": s => (s.assignmentVisible == 1 && s.fuckdoll == 0 && s.devotion > 50 && s.assignment != "recruit girls" && canWalk(s) && canSee(s) && canTalk(s)), + "HG Select": s => (s.assignmentVisible == 1 && s.fuckdoll == 0 && s.devotion > 50 && s.assignment != "be your Head Girl" && canWalk(s) && canHear(s) && canSee(s) && canTalk(s)), + "Head Girl Suite": s => (s.assignmentVisible == 1 && s.fuckdoll <= 0 && ( + (State.variables.Flag == 0 && s.assignment != "be your Head Girl" && s.indentureRestrictions <= 0 && (s.breedingMark != 1 || State.variables.propOutcome == 0)) || + (State.variables.Flag != 0 && s.assignment == "live with your Head Girl"))), + "Subordinate Targeting": s => (s.devotion >= -20 && s.fuckdoll == 0 && State.variables.activeSlave.ID != s.ID && (State.variables.activeSlave.amp != 1 || s.amp != 1)), + "Spa": s => (s.assignmentVisible == 1 && s.fuckdoll <= 0 && ( + (State.variables.Flag == 0 && s.assignment != "rest in the spa") || + (State.variables.Flag == 1 && s.assignment == "rest in the spa") || + (State.variables.Flag != 0 && State.variables.Flag != 1 && s.ID == State.variables.Attendant.ID))), + "Attendant Select": s => (s.assignmentVisible == 1 && s.fuckdoll == 0 && s.devotion > 50 && canWalk(s) && canHear(s)), + "Nursery": s => (s.assignmentVisible == 1 && s.fuckdoll <= 0 && (s.devotion > 20 || s.trust > 20) && ( + (State.variables.Flag == 0 && s.assignment != "work as a nanny") || + (State.variables.Flag == 1 && s.assignment == "work as a nanny") || + (State.variables.Flag != 0 && State.variables.Flag != 1 && s.ID == State.variables.Matron.ID))), + "Matron Select": s => (s.assignmentVisible == 1 && s.fuckdoll == 0 && s.devotion > 50 && canWalk(s) && canHear(s)), + "Brothel": s => (s.assignmentVisible == 1 && s.fuckdoll <= 0 && ( + (State.variables.Flag == 0 && s.assignment != "work in the brothel") || + (State.variables.Flag == 1 && s.assignment == "work in the brothel") || + (State.variables.Flag != 0 && State.variables.Flag != 1 && s.ID == State.variables.Madam.ID))), + "Madam Select": s => (s.assignmentVisible == 1 && s.fuckdoll == 0 && s.devotion > 50 && s.intelligence + s.intelligenceImplant >= -50 && canWalk(s) && canSee(s) && canHear(s) && (s.breedingMark != 1 || State.variables.propOutcome == 0)), + "Club": s => (s.assignmentVisible == 1 && s.fuckdoll <= 0 && ( + (State.variables.Flag == 0 && s.assignment != "serve in the club") || + (State.variables.Flag == 1 && s.assignment == "serve in the club") || + (State.variables.Flag != 0 && State.variables.Flag != 1 && s.ID == State.variables.DJ.ID))), + "DJ Select": s => (s.assignmentVisible == 1 && s.fuckdoll == 0 && s.devotion > 50 && s.intelligence + s.intelligenceImplant >= -50 && canTalk(s) && canHear(s) && canWalk(s) && (s.breedingMark != 1 || State.variables.propOutcome == 0)), + "Clinic": s => (s.assignmentVisible == 1 && s.fuckdoll <= 0 && ( + (State.variables.Flag == 0 && s.assignment != "get treatment in the clinic") || + (State.variables.Flag == 1 && s.assignment == "get treatment in the clinic") || + (State.variables.Flag != 0 && State.variables.Flag != 1 && s.ID == State.variables.Nurse.ID))), + "Nurse Select": s => (s.assignmentVisible == 1 && s.fuckdoll == 0 && s.devotion > 50 && canWalk(s) && canSee(s)), + "Schoolroom": s => (s.assignmentVisible == 1 && s.fuckdoll <= 0 && ( + (State.variables.Flag == 0 && s.fetish != "mindbroken" && s.assignment != "learn in the schoolroom") || + (State.variables.Flag == 1 && s.assignment == "learn in the schoolroom") || + (State.variables.Flag != 0 && State.variables.Flag != 1 && s.ID == State.variables.Schoolteacher.ID))), + "Schoolteacher Select": s => (s.assignmentVisible == 1 && s.fuckdoll == 0 && s.devotion > 50 && canTalk(s) && canHear(s) && canSee(s)), + "Dairy": s => (s.assignmentVisible == 1 && s.fuckdoll <= 0 && ( + (State.variables.Flag == 0 && s.assignment != "work in the dairy") || + (State.variables.Flag == 1 && s.assignment == "work in the dairy") || + (State.variables.Flag != 0 && State.variables.Flag != 1 && s.ID == State.variables.Milkmaid.ID))), + "Milkmaid Select": s => (s.assignmentVisible == 1 && s.fuckdoll == 0 && s.devotion > 20 && canWalk(s) && canSee(s) && canHear(s)), + "Farmyard": s => (s.assignmentVisible == 1 && s.fuckdoll <= 0 && canWalk(s) && ( + (State.variables.Flag == 0 && s.assignment != "work as a farmhand") || + (State.variables.Flag == 1 && s.assignment == "work as a farmhand") || + (State.variables.Flag != 0 && State.variables.Flag != 1 && s.ID == State.variables.Farmer.ID))), + "Farmer Select": s => (s.assignmentVisible == 1 && s.fuckdoll == 0 && s.devotion > 50 && canWalk(s) && canSee(s) && canHear(s)), + "Servants' Quarters": s => (s.assignmentVisible == 1 && s.fuckdoll <= 0 && ( + (State.variables.Flag == 0 && s.assignment != "work as a servant") || + (State.variables.Flag == 1 && s.assignment == "work as a servant") || + (State.variables.Flag != 0 && State.variables.Flag != 1 && s.ID == State.variables.Stewardess.ID))), + "Stewardess Select": s => (s.assignmentVisible == 1 && s.fuckdoll == 0 && s.devotion > 50 && s.intelligence + s.intelligenceImplant >= -50 && canWalk(s) && canSee(s) && canHear(s)), + "Master Suite": s => (s.assignmentVisible == 1 && s.fuckdoll <= 0 && ( + (State.variables.Flag == 0 && s.assignment != "serve in the master suite") || + (State.variables.Flag == 1 && s.assignment == "serve in the master suite") || + (State.variables.Flag != 0 && State.variables.Flag != 1 && s.ID == State.variables.Concubine.ID))), + "Concubine Select": s => (s.assignmentVisible == 1 && s.fuckdoll == 0 && s.devotion > 50 && s.amp != 1), + "Cellblock": s => (s.assignmentVisible == 1 && s.fuckdoll <= 0 && s.fetish != "mindbroken" && ( + (State.variables.Flag == 0 && s.assignment != "be confined in the cellblock") || + (State.variables.Flag == 1 && s.assignment == "be confined in the cellblock") || + (State.variables.Flag != 0 && State.variables.Flag != 1 && s.ID == State.variables.Wardeness.ID))), + "Wardeness Select": s => (s.assignmentVisible == 1 && s.fuckdoll == 0 && s.devotion > 50 && canWalk(s) && canSee(s) && canHear(s)), + "Arcade": s => (s.assignmentVisible == 1 && (State.variables.arcade >= State.variables.arcadeSlaves || State.variables.arcadeUpgradeFuckdolls == 1) && ( + (State.variables.Flag == 0 && s.assignment != "be confined in the arcade") || + (State.variables.Flag != 0 && s.assignment == "be confined in the arcade"))), + "Pit": s => (s.assignmentVisible == 1 && s.fuckdoll == 0 && ( + (State.variables.Flag == 0 && !State.variables.fighterIDs.includes(s.ID) && canWalk(s) && (s.assignment != "guard you") && (s.assignment != "work in the dairy" || State.variables.dairyRestraintsSetting < 2)) || + (State.variables.Flag != 0 && State.variables.fighterIDs.includes(s.ID)))), + "Coursing Association": s => (s.assignmentVisible == 1 && s.fuckdoll == 0 && ( + (State.variables.Flag == 0 && canWalk(s) && State.variables.Lurcher.ID != s.ID) || + (State.variables.Flag != 0 && State.variables.Lurcher.ID == s.ID))), + "New Game Plus": s => ((State.variables.Flag == 0 && s.assignment != "be imported") || (State.variables.Flag != 0 && s.assignment == "be imported")), + "Rules Slave Select": s => ((State.variables.Flag == 0 && !ruleSlaveSelected(s, State.variables.currentRule)) || (State.variables.Flag != 0 && ruleSlaveSelected(s, State.variables.currentRule))), + "Rules Slave Exclude": s => ((State.variables.Flag == 0 && !ruleSlaveExcluded(s, State.variables.currentRule)) || (State.variables.Flag != 0 && ruleSlaveExcluded(s, State.variables.currentRule))), + "Matchmaking": s => (s.devotion >= 100 && s.relationship == State.variables.activeSlave.relationship && s.ID != State.variables.activeSlave.ID), + "Dinner Party Preparations": s => (s.assignmentVisible == 1 && s.fuckdoll == 0), +}; + +/** + * Slave filtering predicate + * + * @callback slaveFilter + * @param {App.Entity.SlaveState} slave + * @returns {boolean} + */ +/** + * @param {string} passageName + * @returns {string} + */ +App.UI.slaveSummaryList = function (passageName) { + 'use strict'; + const V = State.variables; + + let _indexed = 0; + /** @type {App.Entity.SlaveState[]} */ + const slaves = V.slaves; + + /** + * @param {App.Entity.SlaveState} s + * @returns {boolean} + */ + function _passagePreFilter(s) { + return s.assignment !== "be your agent" && s.assignment !== "live with your agent" && + (!App.UI.PassageSlaveFilers.hasOwnProperty(passageName) || App.UI.PassageSlaveFilers[passageName](s)); + } + + /** + * A simple macro which allows to create wrapping html elements with dynamic IDs. + * + * idea blatantly robbed from the spanMacroJS.tw but expanded to a more generic case, allowing <div>, + * <button> or whatever you want elements, default is for the div though. + * In addition, you can pass an object in as the first argument instead of an id, and each of the + * object's attributes will become attributes of the generate tag. + * + * Usage: << htag id >> ... << /htag>> + * Usage: << htag id tag >> ... << /htag>> + * Usage: << htag attributes >> ... << /htag>> + * Usage: << htag attributes tag >> ... << /htag>> + */ + function htag(text, attributes, tag) { + const payload = text.replace(/(^\n+|\n+$)/, ''); + let htag = tag || 'div'; + + if ("object" === typeof attributes) + attributes = $.map(attributes, (val, key) => key + '="' + val + '"').join(" "); + else + attributes = 'id="' + String(this.args[0]).trim() + '"'; + + return '<' + htag + ' ' + attributes + '>' + payload + '</' + htag + '>'; + } + + function SlaveArt(a, b) { + return '<<SlaveArtById ' + a.ID + ' ' + b + '>>'; + } + + function slaveImage(s) { + return '<div class="imageRef smlImg">' + SlaveArt(s, 1) + '</div>'; + } + + function dividerAndImage(s) { + let r = ['<div id="slave_' + s.ID + '" style="clear:both">', + V.lineSeparations == 0 ? '<br>' : '<hr style="margin:0">']; + if ((V.seeImages == 1) && (V.seeSummaryImages == 1)) { + r.push(slaveImage(s)); + } + return r.join(""); + } + + const _filteredSlaveIdxs = slaves.map(function (slave, idx) { + return _passagePreFilter(slave) ? idx : null; + }).filter(function (idx) { + return idx !== null; + }); + + const _indexSlavesIdxs = slaves.map(function (slave, idx) { + return _passagePreFilter(slave) ? idx : null; + }).filter(function (idx) { + return idx !== null; + }); + + let res = []; + const tabName = V.slaveAssignmentTab; + + console.log(`Rendering tab ${passageName}/${tabName}`); + const start = new Date().getTime(); + + let _tableCount = 0; + if (V.useSlaveListInPageJSNavigation == 1) { + const _Count = _indexSlavesIdxs.length; + /* Useful for finding weird combinations — usages of this passage that don't yet generate the quick index. + * <<print 'pass/count/indexed/flag::[' + passageName + '/' + _Count + '/' + _indexed + '/' + $Flag + ']'>> + */ + + if (((_Count > 1) && (_indexed == 0) && (((passageName == 'Main') && (V.Flag === undefined) && ((V.useSlaveSummaryTabs == 0) || (V.slaveAssignmentTab == "all"))) || (V.Flag == 1)))) { + let _indexed = 1, + _counter = 0, + _buttons = [], + _offset = -50; + if (/Select/i.test(passageName)) { + _offset = -25 + } + res.push("<br />") + _tableCount++; + /* + * we want <button data-quick-index="<<= _tableCount>>">... + */ + const _buttonAttributes = { + 'data-quick-index': _tableCount + }; + res.push(htag("Quick Index", _buttonAttributes, 'button')); + /* + * we want <div id="list_index3" class=" hidden">... + */ + var listIndexContent = ""; + + for (let _ssii of _indexSlavesIdxs) { + const _IndexSlave = slaves[_ssii]; + const _indexSlaveName = SlaveFullName(_IndexSlave); + const _devotionClass = getSlaveDevotionClass(_IndexSlave); + const _trustClass = getSlaveTrustClass(_IndexSlave); + _buttons.push({ + 'data-name': _indexSlaveName, + 'data-scroll-to': '#slave-' + _IndexSlave.ID, + 'data-scroll-offset': _offset, + 'data-devotion': _IndexSlave.devotion, + 'data-trust': _IndexSlave.trust, + class: _devotionClass + ' ' + _trustClass + }); + } + if (_buttons.length > 0) { + V.sortQuickList = V.sortQuickList || 'Devotion'; + listIndexContent += `//Sorting:// ''<span id="qlSort">$sortQuickList</span>.'' `; + listIndexContent += '<<link "Sort by Devotion">>' + + '<<set $sortQuickList = "Devotion" >>' + + '<<replace "#qlSort">> $sortQuickList <</replace>>' + + '<<run' + + '$("#qlWrapper").removeClass("trust").addClass("devotion");' + + 'sortButtonsByDevotion();' + + '>>' + + '<</link>> | ' + + '<<link "Sort by Trust">>' + + '<<set $sortQuickList = "Trust">>' + + '<<replace "#qlSort">> $sortQuickList <</replace>>' + + '<<run' + + '$("#qlWrapper").removeClass("devotion").addClass("trust");' + + 'sortButtonsByTrust();' + + '>>' + + '<</link>>' + + '<br/>'; + listIndexContent += '<div id="qlWrapper" class="quicklist devotion">'; + for (const _button of _buttons) { + const _buttonSlaveName = _button['data-name']; + listIndexContent += htag(_buttonSlaveName, _button, 'button'); + } + listIndexContent += '</div>'; + } + res.push(htag(listIndexContent, { + id: 'list_index' + _tableCount, + class: 'hidden' + })); + } + } + + for (let _ssi of _filteredSlaveIdxs) { + let _Slave = slaves[_ssi]; + const _slaveName = SlaveFullName(_Slave); + + let _tableCount = 0; + + switch (passageName) { + case "Main": + if (V.useSlaveSummaryTabs === 1) { + if (tabName === "overview") { + if (V.showOneSlave === "Head Girl" && _Slave.assignment !== "be your Head Girl") continue; + if (V.showOneSlave === "recruit girls" && _Slave.assignment !== "recruit girls") continue; + if (V.showOneSlave === "guard you" && _Slave.assignment !== "guard you") continue; + } + + if (tabName === "resting") { + if (_Slave.assignment !== "rest") continue; + } else { + if (tabName !== "all" && _Slave.assignment !== tabName) continue; + } + } + + if ((_Slave.choosesOwnClothes === 1) && (_Slave.clothes === "choosing her own clothes")) { + const _oldDevotion = _Slave.devotion; + const _chosenClothes = saChoosesOwnClothes(_Slave); + slaves[_ssi].devotion = _oldDevotion; + _Slave = slaves[_ssi]; /* restore devotion value so repeatedly changing clothes isn't an exploit */ + } + res.push(dividerAndImage(_Slave)); + if ("be your Head Girl" === _Slave.assignment) res.push('<strong>@@.lightcoral;HG@@</strong> '); + else if ("recruit girls" === _Slave.assignment) res.push('<strong>@@.lightcoral;RC@@</strong> '); + else if ("guard you" === _Slave.assignment) res.push('<strong>@@.lightcoral;BG@@</strong> '); + + if (Array.isArray(V.personalAttention) && V.personalAttention.findIndex(s => s.ID == _Slave.ID) != -1) { + res.push('<strong>@@.lightcoral; PA@@</strong> '); + } + res.push(this.passageLink(_slaveName, 'Slave Interact', `$activeSlave = $slaves[${_ssi}]`)); /* lists their names */ + break; + + case "Personal Attention Select": + res.push(dividerAndImage(_Slave)); + res.push(`<<link ${_slaveName}>>`); + + if (!Array.isArray(V.personalAttention)) { /* first PA target */ + V.personalAttention = [{ ID: slaves[_ssi].ID, trainingRegimen: "undecided" }]; + } else { + const _pai = V.personalAttention.findIndex(function (s) { return s.ID == slaves[_ssi].ID; }); + if (_pai == -1) { /* not already a PA target; add */ + V.activeSlave = slaves[_ssi]; + V.personalAttention.push({ ID: slaves[_ssi].ID, trainingRegimen: "undecided" }); + } else { /* already a PA target; remove */ + V.personalAttention.deleteAt(_pai); + if (V.personalAttention.length == 0) + V.personalAttention = "sex"; + } + } + res.push('<<goto "Personal Attention Select">>'); + res.push('<</link>>'); + break; + case "Agent Select": + res.push(dividerAndImage(_Slave)); + res.push(`[[${_slaveName}|Agent Workaround][$i = ${_ssi}]]`); + break; + case "BG Select": + res.push(dividerAndImage(_Slave)); + res.push(`[[${_slaveName}|Bodyguard Workaround][$i = ${_ssi}]]`); + break; + case "Recruiter Select": + res.push(dividerAndImage(_Slave)); + res.push(`[[${_slaveName}|Recruiter Workaround][$i = ${_ssi}]]`); + break; + case "HG Select": + res.push(dividerAndImage(_Slave)); + res.push(`[[${_slaveName}|HG Workaround][$i = ${_ssi}]]`); + break; + case "Head Girl Suite": + if (V.Flag == 0) { + res.push(dividerAndImage(_Slave)); + res.push(`[[${_slaveName}|Slave Interact][$activeSlave = $slaves[${_ssi}]]]`); + } else { + res.push(dividerAndImage(_Slave)); + res.push(`[[${_slaveName}|Slave Interact][$activeSlave = $slaves[${_ssi}]]]`); + } + break; + case "Subordinate Targeting": + res.push(dividerAndImage(_Slave)); + res.push(`[[${_slaveName}|Subordinate Targeting][$activeSlave.subTarget = $slaves[${_ssi}].ID]]`); + break; + case "Spa": + if (V.Flag == 0) { + if (V.spa <= V.spaSlaves) continue; + if ((_Slave.health < 20) || (_Slave.trust < 60) || (_Slave.devotion <= 60) || (_Slave.fetish == "mindbroken") || _Slave.sexualFlaw !== "none" || _Slave.behavioralFlaw !== "none") { + if (_Slave.devotion >= -20 || _Slave.fetish == "mindbroken") { + res.push(dividerAndImage(_Slave)); + res.push(`[[${_slaveName}|Slave Interact][$activeSlave = $slaves[${_ssi}]]]`); + } else { + res.push(`<br><i>${_Slave.slaveName} cannot be trusted in the spa</i>`); + continue; + } + } else { + res.push(`<br><i>${_Slave.slaveName} cannot benefit from the spa</i>`); + continue; + } + } else if (V.Flag == 1) { + res.push(dividerAndImage(_Slave)); + res.push(`[[${_slaveName}|Slave Interact][$activeSlave = $slaves[${_ssi}]]]`); + } else { + if ((V.seeImages == 1) && (V.seeSummaryImages == 1)) res.push(slaveImage(_Slave)); + res.push(`[[${_slaveName}|Slave Interact][$activeSlave = $slaves[${_ssi}]]]`); + } + break; + case "Attendant Select": + res.push(dividerAndImage(_Slave)); + res.push(`[[${_slaveName}|Attendant Workaround][$i = ${_ssi}]]`); + break; + case "Nursery": + if (V.Flag == 0) { + if (V.nurseryNannies <= V.nurserySlaves) continue; + if ((_Slave.devotion >= -20) || ((_Slave.devotion >= -50) && (_Slave.trust <= 20)) || (_Slave.trust < -20)) { + res.push(dividerAndImage(_Slave)); + res.push(`[[${_slaveName}|Slave Interact][$activeSlave = $slaves[${_ssi}]]]`); + } else { + res.push(`<br><i>${_Slave.slaveName} must be either more fearful of you or devoted to you</i>`); + continue; + } + } else if (V.Flag == 1) { + res.push(dividerAndImage(_Slave)); + res.push(`[[${_slaveName}|Slave Interact][$activeSlave = $slaves[${_ssi}]]]`); + } else { + if ((V.seeImages == 1) && (V.seeSummaryImages == 1)) { + res.push(slaveImage(_Slave)); + } + res.push(`[[${_slaveName}|Slave Interact][$activeSlave = $slaves[${_ssi}]]]`); + } + break; + case "Matron Select": + res.push(dividerAndImage(_Slave)); + res.push(`[[${_slaveName}|Matron Workaround][$i = ${_ssi}]]`); + break; + case "Brothel": + if (V.Flag == 0) { + if (V.brothel <= V.brothelSlaves) continue; + if (_Slave.breedingMark != 1 || V.propOutcome == 0) { + if ((_Slave.devotion > 50) || ((_Slave.devotion >= -50) && (_Slave.trust < -20)) || (_Slave.trust < -50) || (_Slave.trust > 50)) { + res.push(dividerAndImage(_Slave)); + res.push(`[[${_slaveName}|Slave Interact][$activeSlave = $slaves[${_ssi}]]]`); + } else { + res.push(`<br><i>${_Slave.slaveName} must be either more fearful of you or devoted to you</i>`); + continue; + } + } else { + res.push(`<br><i>${_Slave.slaveName} is for private use only</i>`); + continue; + } + } else if (V.Flag == 1) { + res.push(dividerAndImage(_Slave)); + res.push(`[[${_slaveName}|Slave Interact][$activeSlave = $slaves[${_ssi}]]]`); + } else { + if ((V.seeImages == 1) && (V.seeSummaryImages == 1)) { + res.push(slaveImage(_Slave)); + } + res.push(`[[${_slaveName}|Slave Interact][$activeSlave = $slaves[${_ssi}]]]`); + } + break; + case "Madam Select": + res.push(dividerAndImage(_Slave)); + res.push(`[[${_slaveName}|Madam Workaround][$i = ${_ssi}]]`); + break; + case "Club": + if (V.Flag == 0) { + if (V.club <= V.clubSlaves) continue; + if (_Slave.breedingMark != 1 || V.propOutcome == 0) { + if ((_Slave.devotion > 50) || ((_Slave.devotion >= -50) && (_Slave.trust < -20)) || (_Slave.trust < -50) || (_Slave.trust > 50)) { + res.push(dividerAndImage(_Slave)); + res.push(`[[${_slaveName}|Slave Interact][$activeSlave = $slaves[${_ssi}]]]`); + } else { + res.push(`<br>//${_Slave.slaveName} must be either more fearful of you or devoted to you//`); + continue; + } + } else { + res.push(`<br>//${_Slave.slaveName} is for private use only//`); + continue; + } + } else if (V.Flag == 1) { + res.push(dividerAndImage(_Slave)); + res.push(`[[${_slaveName}|Slave Interact][$activeSlave = $slaves[${_ssi}]]]`); + } else { + res.push(dividerAndImage(_Slave)); + res.push(`[[${_slaveName} | Slave Interact][$activeSlave = $slaves[${_ssi}]]]`); + } + break; + case "DJ Select": + res.push(dividerAndImage(_Slave)); + res.push(`[[${_slaveName}|DJ Workaround][$i = ${_ssi}]]`); + break; + case "Clinic": + if (V.Flag == 0) { + if (V.clinic <= V.clinicSlaves) continue; + if ((_Slave.health < 20) || (V.Nurse != 0 && ((_Slave.chem > 15 && V.clinicUpgradeFilters == 1) || (V.bellyImplants == 1 && _Slave.bellyImplant > -1) || (_Slave.pregKnown == 1 && (V.clinicSpeedGestation >= 0 || _Slave.pregControl == "speed up")) || (_Slave.pregAdaptation * 1000 < _Slave.bellyPreg || _Slave.preg > _Slave.pregData.normalBirth / 1.33)))) { + res.push(dividerAndImage(_Slave)); + res.push(`[[${_slaveName}|Slave Interact][$activeSlave = $slaves[${_ssi}]]]`); + } else { + res.push(`<br>//${_Slave.slaveName} cannot benefit from the clinic//`); + continue; + } + } else if (V.Flag == 1) { + res.push(dividerAndImage(_Slave)); + res.push(`[[${_slaveName}|Slave Interact][$activeSlave = $slaves[${_ssi}]]]`); + } else { + res.push(dividerAndImage(_Slave)); + res.push(`[[${_slaveName} | Slave Interact][$activeSlave = $slaves[${_ssi}]]]`); + } + break; + case "Nurse Select": + res.push(dividerAndImage(_Slave)); + res.push(`[[${_slaveName}|Nurse Workaround][$i = ${_ssi}]]`); + break; + case "Schoolroom": + if (V.Flag == 0) { + if (V.schoolroom <= V.schoolroomSlaves) continue; + if ((_Slave.devotion >= -20) || ((_Slave.devotion >= -50) && (_Slave.trust < -20)) || (_Slave.trust < -50)) { + if ((_Slave.intelligenceImplant < 30) || (_Slave.voice != 0 && _Slave.accent + V.schoolroomUpgradeLanguage > 2) || (_Slave.oralSkill <= 10 + V.schoolroomUpgradeSkills * 20) || (_Slave.whoreSkill <= 10 + V.schoolroomUpgradeSkills * 20) || (_Slave.entertainSkill <= 10 + V.schoolroomUpgradeSkills * 20) || (_Slave.analSkill < 10 + V.schoolroomUpgradeSkills * 20) || ((_Slave.vagina >= 0) && (_Slave.vaginalSkill < 10 + V.schoolroomUpgradeSkills * 20))) { + res.push(dividerAndImage(_Slave)); + res.push(`[[${_slaveName}|Slave Interact][$activeSlave = $slaves[${_ssi}]]]`); + } else { + res.push(`<br>//${_Slave.slaveName} already has a basic education//`); + continue; + } + } else { + res.push(`<br>//${_Slave.slaveName} is too resistant to learn//`); + continue; + } + } else if (V.Flag == 1) { + res.push(dividerAndImage(_Slave)); + res.push(`[[${_slaveName}|Slave Interact][$activeSlave = $slaves[${_ssi}]]]`); + } else { + res.push(dividerAndImage(_Slave)); + res.push(`[[${_slaveName}|Slave Interact][$activeSlave = $slaves[${_ssi}]]]`); + } + break; + case "Schoolteacher Select": + res.push(dividerAndImage(_Slave)); + res.push(`[[${_slaveName}|Schoolteacher Workaround][$i = ${_ssi}]]`); + break; + case "Dairy": + if (V.Flag == 0) { + const _dairySeed = V.bioreactorsXY + V.bioreactorsXX + V.bioreactorsHerm + V.bioreactorsBarren; + if (_Slave.assignment == "work in the dairy") continue; + if (V.dairy <= V.dairySlaves + _dairySeed) continue; + if ((_Slave.indentureRestrictions > 0) && (V.dairyRestraintsSetting > 1)) { + res.push(`<br>//${_Slave.slaveName}'s indenture forbids extractive Dairy service.//`); + continue; + } else if ((_Slave.indentureRestrictions > 1) && (V.dairyRestraintsSetting > 0)) { + res.push(`<br>//${_Slave.slaveName}'s indenture allows only free range milking.//`); + continue; + } else if (_Slave.breedingMark == 1 && V.propOutcome == 1 && V.dairyRestraintsSetting > 0) { + res.push(`<br>//${_Slave.slaveName} may only be a free range cow//`); + continue; + } else if ((V.dairyPregSetting > 0) && ((_Slave.bellyImplant != -1) || (_Slave.broodmother != 0))) { + res.push(`<br>//${_Slave.slaveName}'s womb cannot accommodate current machine settings//`); + continue; + } else { + if ((_Slave.lactation > 0) || (_Slave.balls > 0) || ((V.dairySlimMaintainUpgrade == 0 || V.dairySlimMaintain == 0) && (_Slave.boobs > 300 || _Slave.balls == 0 || V.dairyImplantsSetting == 1) && V.dairyImplantsSetting != 2)) { + if ((_Slave.devotion > 20) || ((_Slave.devotion >= -50) && (_Slave.trust < -20)) || (_Slave.trust < -50) || (_Slave.amp == 1) || (V.dairyRestraintsUpgrade == 1)) { + if ((V.dairyStimulatorsSetting < 2) || (_Slave.anus > 2) || (V.dairyPrepUpgrade == 1)) { + if ((V.dairyPregSetting < 2) || (_Slave.vagina > 2) || (_Slave.ovaries == 0) || (V.dairyPrepUpgrade == 1)) { + res.push(dividerAndImage(_Slave)); + res.push(`[[${_slaveName}|Slave Interact][$activeSlave = $slaves[${_ssi}]]]`); + } else { + res.push(`<br>//${_Slave.slaveName}'s vagina cannot accommodate current machine settings//`); + continue; + } + } else { + res.push(`<br>//${_Slave.slaveName}'s anus cannot accommodate current machine settings//`); + continue; + } + } else { + res.push(`<br>//${_Slave.slaveName} must be obedient in order to be milked here//`); + continue; + } + } else if ((V.dairySlimMaintainUpgrade == 1 && V.dairySlimMaintain == 1) || (V.dairyImplantsSetting == 2) || (_Slave.boobs <= 300 && _Slave.balls > 0 && (V.dairyImplantsSetting == 0 || V.dairyImplantsSetting == 3))) { + res.push(`<br>//${_Slave.slaveName} is not lactating` + (V.seeDicks > 0) ? 'or producing semen' : '' + `and ${V.dairyName}'s current settings forbid the automatic implantation of lactation inducing drugs or manual stimulation to induce it, so she cannot be a cow//`); + continue; + } else { + res.push(`<br>//${_Slave.slaveName} is not lactating` + (V.seeDicks > 0) ? 'or producing semen' : '' + 'and cannot be a cow//'); + continue; + } + } + } else if (V.Flag == 1) { + res.push(dividerAndImage(_Slave)); + res.push(`[[${_slaveName}|Slave Interact][$activeSlave = $slaves[${_ssi}]]]`); + } else { + res.push(dividerAndImage(_Slave)); + res.push(`[[${_slaveName}|Slave Interact][$activeSlave = $slaves[${_ssi}]]]`); + } + break; + case "Milkmaid Select": + res.push(dividerAndImage(_Slave)); + res.push(`[[${_slaveName}|Milkmaid Workaround][$i = ${_ssi}]]`); + break; + case "Farmyard": + if (V.Flag == 0) { + if (_Slave.assignment == "work as a farmhand") continue; + if (V.farmyard <= V.farmyardSlaves) continue; + res.push(dividerAndImage(_Slave)); + res.push(`[[${_slaveName}|Slave Interact][$activeSlave = $slaves[${_ssi}]]]`); + } else if (V.Flag == 1) { + res.push(dividerAndImage(_Slave)); + res.push(`[[${_slaveName}|Slave Interact][$activeSlave = $slaves[${_ssi}]]]`); + } else { + res.push(dividerAndImage(_Slave)); + res.push(`[[${_slaveName}|Slave Interact][$activeSlave = $slaves[${_ssi}]]]`); + } + break; + case "Farmer Select": + res.push(dividerAndImage(_Slave)); + res.push(`[[${_slaveName}|Farmer Workaround][$i = ${_ssi}]]`); + break; + case "Servants' Quarters": + if (V.Flag == 0) { + if (V.servantsQuarters <= V.servantsQuartersSlaves) continue; + if ((_Slave.devotion >= -20) || ((_Slave.devotion >= -50) && (_Slave.trust <= 20)) || (_Slave.trust < -20)) { + res.push(dividerAndImage(_Slave)); + res.push(`[[${_slaveName}|Slave Interact][$activeSlave = $slaves[${_ssi}]]]`); + } else { + res.push(`<br>//${_Slave.slaveName} must be either more fearful of you or devoted to you//`); + continue; + } + } else if (V.Flag == 1) { + res.push(dividerAndImage(_Slave)); + res.push(`[[${_slaveName}|Slave Interact][$activeSlave = $slaves[${_ssi}]]]`); + } else { + res.push(dividerAndImage(_Slave)); + res.push(`[[${_slaveName}|Slave Interact][$activeSlave = $slaves[${_ssi}]]]`); + } + break; + case "Stewardess Select": + res.push(dividerAndImage(_Slave)); + res.push(`[[${_slaveName}|Stewardess Workaround][$i = ${_ssi}]]`); + break; + case "Master Suite": + if (V.Flag == 0) { + if (V.masterSuite <= V.masterSuiteSlaves) continue; + if ((_Slave.devotion > 20) || ((_Slave.devotion >= -50) && (_Slave.trust < -20)) || (_Slave.trust < -50)) { + res.push(dividerAndImage(_Slave)); + res.push(`[[${_slaveName}|Slave Interact][$activeSlave = $slaves[${_ssi}]]]`); + } else { + res.push(`<br>//${_Slave.slaveName} is not sufficiently broken for the master suite//`); + continue; + } + } else if (V.Flag == 1) { + res.push(dividerAndImage(_Slave)); + res.push(`[[${_slaveName}|Slave Interact][$activeSlave = $slaves[${_ssi}]]]`); + } else { + res.push(dividerAndImage(_Slave)); + res.push(`[[${_slaveName}|Slave Interact][$activeSlave = $slaves[${_ssi}]]]`); + } + break; + case "Concubine Select": + res.push(dividerAndImage(_Slave)); + res.push(`[[${_slaveName}|Concubine Workaround][$i = ${_ssi}]]`); + break; + case "Cellblock": + if (_Slave.assignmentVisible != 1) continue; + if (V.Flag == 0) { + if (V.cellblock <= V.cellblockSlaves) continue; + if ((_Slave.devotion < -20 && _Slave.trust >= -20) || (_Slave.devotion < -50 && _Slave.trust >= -50)) { + res.push(dividerAndImage(_Slave)); + res.push(`[[${_slaveName}|Slave Interact][$activeSlave = $slaves[${_ssi}]]]`); + } else { + res.push(`<br>//${_Slave.slaveName} is sufficiently broken in so that the cellblock would have no effect//`); + continue; + } + } else if (V.Flag == 1) { + res.push(dividerAndImage(_Slave)); + res.push(`[[${_slaveName}|Slave Interact][$activeSlave = $slaves[${_ssi}]]]`); + } else { + res.push(dividerAndImage(_Slave)); + res.push(`[[${_slaveName}|Slave Interact][$activeSlave = $slaves[${_ssi}]]]`); + } + break; + case "Wardeness Select": + res.push(dividerAndImage(_Slave)); + res.push(`[[${_slaveName}|Wardeness Workaround][$i = ${_ssi}]]`); + break; + case "Arcade": + if (V.Flag == 0) { + if (_Slave.assignment == "be confined in the arcade") continue; + if (V.arcade <= V.arcadeSlaves && V.arcadeUpgradeFuckdolls != 1) continue; + if ((_Slave.breedingMark != 1 || V.propOutcome == 0)) { + if (_Slave.indentureRestrictions <= 0) { + res.push(dividerAndImage(_Slave)); + res.push(`[[${_slaveName}|Slave Interact][$activeSlave = $slaves[${_ssi}]]]`); + } else { + res.push(`<br>//${_Slave.slaveName}'s indenture forbids arcade service.//`); + continue; + } + } else { + res.push(`<br>//${_Slave.slaveName} is for private use only//`); + continue; + } + } else { + res.push(dividerAndImage(_Slave)); + res.push(`[[${_slaveName}|Slave Interact][$activeSlave = $slaves[${_ssi}]]]`); + } + break; + case "Pit": + if (V.Flag == 0) { + if ((_Slave.indentureRestrictions > 0) && (V.pitLethal == 1)) { + res.push(`<br>//${_Slave.slaveName}'s indenture forbids lethal fights.//`); + continue; + } else if (_Slave.indentureRestrictions > 1) { + res.push(`<br>//${_Slave.slaveName}'s indenture forbids fighting.//`); + continue; + } else if (_Slave.breedingMark == 1 && V.propOutcome == 1) { + res.push(`<br>//${_Slave.slaveName} may not participate in combat//`); + continue; + } else { + res.push(dividerAndImage(_Slave)); + res.push(`[[${_slaveName}|Assign][$i = ${_ssi}]]`); + } + } else { + res.push(dividerAndImage(_Slave)); + res.push(`[[${_slaveName}|Retrieve][$i = ${_ssi}]]`); + } + break; + case "Coursing Association": + if (V.Flag == 0) { + res.push(dividerAndImage(_Slave)); + res.push(`[[${_slaveName}|Assign][$i = ${_ssi}]]`); + } else { + res.push(dividerAndImage(_Slave)); + res.push(`[[${_slaveName}|Retrieve][$i = ${_ssi}]]`); + } + break; + case "New Game Plus": + if (V.Flag == 0) { + res.push(`<br>__''@@.pink;${_Slave.slaveName}@@''__`); + } else { + res.push(`<br>__''@@.pink;${_Slave.slaveName}@@''__`); + } + break; + case "Rules Slave Select": + if (V.Flag == 0) { + res.push(`<br>__''[[${_slaveName}|Rules Slave Select Workaround][$activeSlave = $slaves[${_ssi}]]]''__`); + } else { + res.push(`<br>__''[[${_slaveName}|Rules Slave Deselect Workaround][$activeSlave = $slaves[${_ssi}]]]''__`); + } + break; + case "Rules Slave Exclude": + if (V.Flag == 0) { + res.push(`<br>__''[[${_slaveName}|Rules Slave Exclude Workaround][$activeSlave = $slaves[${_ssi}]]]''__`); + } else { + res.push(`<br>__''[[${_slaveName}|Rules Slave NoExclude Workaround][$activeSlave = $slaves[${_ssi}]]]''__`); + } + break; + case "Matchmaking": + res.push(dividerAndImage(_Slave)); + res.push(`[[${_slaveName}|Slave Interact][$activeSlave = $slaves[${_ssi}]]]`); + break; + case "Dinner Party Preparations": + res.push(dividerAndImage(_Slave)); + res.push(`[[${_slaveName}|Slave Interact][$activeSlave = $slaves[${_ssi}]]]`); + break; + } + + SlaveStatClamp(_Slave); + _Slave.trust = Math.trunc(_Slave.trust), _Slave.devotion = Math.trunc(_Slave.devotion), _Slave.health = Math.trunc(_Slave.health); + V.slaves[_ssi] = _Slave; + + res.push(' will '); + if ((_Slave.assignment == "rest") && (_Slave.health >= -20)) { + res.push("''__@@.lawngreen;rest@@__''"); + } else if ((_Slave.assignment == "stay confined") && ((_Slave.devotion > 20) || ((_Slave.trust < -20) && (_Slave.devotion >= -20)) || ((_Slave.trust < -50) && (_Slave.devotion >= -50)))) { + res.push("''__@@.lawngreen;stay confined.@@__''"); + if (_Slave.sentence > 0) { + res.push(`(${_Slave.sentence} weeks)`); + } + } else if (_Slave.choosesOwnAssignment == 1) { + res.push('choose her own job'); + } else { + res.push(_Slave.assignment); + if (_Slave.sentence > 0) res.push(`${_Slave.sentence} weeks`); + } + res.push('. '); + + /** @type {string[]} */ + let assignments = []; + if ((V.displayAssignments == 1) && (passageName == "Main") && (_Slave.ID != V.HeadGirl.ID) && (_Slave.ID != V.Recruiter.ID) && (_Slave.ID != V.Bodyguard.ID)) { + if (_Slave.assignment != "rest") { + assignments.push(`<<link "Rest" "Main">><<= removeJob($slaves[${_ssi}], $slaves[${_ssi}].assignment)>><</link>>`); + } else { + assignments.push('Rest'); + } + if (_Slave.assignment != "please you") { + assignments.push(`<<link "Fucktoy" "Main">><<= assignJob($slaves[${_ssi}], "please you")>><</link>>`); + } else { + assignments.push('Fucktoy'); + } + if (_Slave.indentureRestrictions <= 0 && (_Slave.breedingMark != 1 || V.propOutcome == 0)) { + if (_Slave.assignment != "work a glory hole") { + assignments.push(`<<link "Gloryhole" "Main">><<= assignJob($slaves[${_ssi}], "work a glory hole")>><</link>>`); + } else { + assignments.push('Hole'); + } + } + if (_Slave.fuckdoll == 0) { /* NON-FUCKDOLL ASSIGNMENTS */ + if (_Slave.assignment != "take classes") { + if ((_Slave.intelligenceImplant < 15) && ((_Slave.devotion >= -20) || ((_Slave.trust < -20) && (_Slave.devotion >= -50)) || (_Slave.trust < -50)) && (_Slave.fetish != "mindbroken")) { + assignments.push(`<<link "Classes" "Main">><<= assignJob($slaves[${_ssi}], "take classes")>><</link>>`); + } + } else { + assignments.push(`Classes`); + } + if (_Slave.assignment != "be a servant") { + if (((_Slave.devotion >= -20) || ((_Slave.trust < -20) && (_Slave.devotion >= -50)) || (_Slave.trust < -50)) && canWalk(_Slave) && canSee(_Slave)) { + assignments.push(`<<link "House Servant" "Main">><<= assignJob($slaves[${_ssi}], "be a servant")>><</link>>`); + } + } else { + assignments.push('House Servant'); + } + if ((_Slave.assignment != "whore") && (_Slave.breedingMark != 1 || V.propOutcome == 0)) { + assignments.push(`<<link "Whore" "Main">><<= assignJob($slaves[${_ssi}], "whore")>><</link>>`); + } else { + assignments.push('Whore'); + } + if ((_Slave.assignment != "serve the public") && (_Slave.breedingMark != 1 || V.propOutcome == 0)) { + assignments.push(`<<link "Public Servant" "Main">><<= assignJob($slaves[${_ssi}], "serve the public")>><</link>>`); + } else { + assignments.push('Public Servant'); + } + if ((_Slave.lactation > 0) || (_Slave.balls > 0)) { + if (_Slave.assignment != "get milked") { + assignments.push(`<<link "Milked" "Main">><<= assignJob($slaves[${_ssi}], "get milked")>><</link>>`); + } else { + assignments.push('Milked'); + } + } + if (_Slave.assignment != "stay confined") { + assignments.push(`<<link "Confinement" "Main">><<= assignJob($slaves[${_ssi}], "stay confined")>><</link>>`); + } else { + assignments.push('Confinement'); + } + if (_Slave.assignment != "choose her own job") { + assignments.push(`<<link "Let ${_Slave.object} choose" "Main">><<= assignJob($slaves[${_ssi}], "choose her own job")>><</link>>`); + } else { + assignments.push(`Let ${_Slave.object} choose`); + } + } /* CLOSES FUCKDOLL CHECK */ + + res.push(assignments.join(" | ")); + } + + let _numFacilities = V.brothel + V.club + V.dairy + V.farmyard + V.servantsQuarters + V.masterSuite + V.spa + V.clinic + V.schoolroom + V.cellblock + V.arcade + V.HGSuite; + + if (_numFacilities > 0) { + if (passageName == "Main" || passageName == "Head Girl Suite" || passageName == "Spa" || passageName == "Brothel" || passageName == "Club" || passageName == "Arcade" || passageName == "Clinic" || passageName == "Schoolroom" || passageName == "Dairy" || passageName == "Farmyard" || passageName == "Servants' Quarters" || passageName == "Master Suite" || passageName == "Cellblock") { + V.returnTo = passageName; + + res.push('<br>Transfer to: '); + /** @type {string[]} */ + let transfers = [] + if (_Slave.assignment != "rest" && _Slave.assignment != "please you" && _Slave.assignment != "take classes" && _Slave.assignment != "be a servant" && _Slave.assignment != "whore" && _Slave.assignment != "serve the public" && _Slave.assignment != "get milked" && _Slave.assignment != "stay confined") { + transfers.push(`<<link "Penthouse" "Main">><<= removeJob($slaves[${_ssi}], $slaves[${_ssi}].assignment)>><</link>>`); + } else { + transfers.push('Penthouse'); + } + + if (V.arcade != 0) { + if (V.arcade > V.arcadeSlaves && (_Slave.indentureRestrictions <= 0) && (_Slave.breedingMark != 1 || V.propOutcome == 0)) { + transfers.push(`[[Arcade|Assign][$assignTo = "Arcade", $i = ${_ssi}]]`); /* $i = -1 tells Assign to use _Slave as-is */ + } else { + transfers.push('Arcade'); + } + } + + if (_Slave.fuckdoll == 0) { /* NON-FUCKDOLL FACILITIES */ + if (V.clinic != 0) { + if (V.clinic > V.clinicSlaves && (_Slave.health < 20 || (V.Nurse != 0 && ((_Slave.chem > 15 && V.clinicUpgradeFilters == 1) || (V.bellyImplants == 1 && _Slave.bellyImplant > -1) || (_Slave.pregKnown == 1 && (V.clinicSpeedGestation >= 0 || _Slave.pregControl == "speed up")) || (_Slave.pregAdaptation * 1000 < _Slave.bellyPreg || _Slave.preg > _Slave.pregData.normalBirth / 1.33))))) { + transfers.push(`[[Clinic|Assign][$assignTo = "Clinic", $i =${_ssi}]]`); /* $i = -1 tells Assign to use _Slave as-is */ + } else { + transfers.push('Clinic'); + } + } + + if (V.masterSuite != 0) { + if (V.masterSuite > V.masterSuiteSlaves && ((_Slave.devotion > 20) || ((_Slave.devotion >= -50) && (_Slave.trust < -20)) || (_Slave.trust < -50))) { + transfers.push(`[[Master Suite|Assign][$assignTo = "Master Suite", $i = ${_ssi}]]`); /* $i = -1 tells Assign to use _Slave as-is */ + } else { + transfers.push('Master Suite') + } + } + + if (V.cellblock != 0) { + if (V.cellblock > V.cellblockSlaves && ((_Slave.devotion < -20 && _Slave.trust >= -20) || (_Slave.devotion < -50 && _Slave.trust >= -50))) { + transfers.push(`[[Cellblock|Assign][$assignTo = "Cellblock", $i = ${_ssi}]]`); /* $i = -1 tells Assign to use _Slave as-is */ + } else { + transfers.push('Cellblock'); + } + } + + if (V.schoolroom != 0) { + if (V.schoolroom > V.schoolroomSlaves && (_Slave.fetish != "mindbroken" && (_Slave.devotion >= -20 || (_Slave.devotion >= -50 && _Slave.trust < -20) || _Slave.trust < -50) && ((_Slave.intelligenceImplant < 30) || (_Slave.voice != 0 && _Slave.accent + V.schoolroomUpgradeLanguage > 2) || (_Slave.oralSkill <= 10 + V.schoolroomUpgradeSkills * 20) || (_Slave.whoreSkill <= 10 + V.schoolroomUpgradeSkills * 20) || (_Slave.entertainSkill <= 10 + V.schoolroomUpgradeSkills * 20) || (_Slave.analSkill < 10 + V.schoolroomUpgradeSkills * 20) || (_Slave.vagina >= 0 && _Slave.vaginalSkill < 10 + V.schoolroomUpgradeSkills * 20)))) { + transfers.push(`[[Schoolroom|Assign][$assignTo = "Schoolroom", $i = ${_ssi}]]`); /* $i = -1 tells Assign to use _Slave as-is */ + } else { + transfers.push('Schoolroom') + } + } + + if (V.servantsQuarters != 0) { + if (V.servantsQuarters > V.servantsQuartersSlaves && (canWalk(_Slave) && canSee(_Slave) && (_Slave.devotion >= -20 || (_Slave.devotion >= -50 && _Slave.trust <= 20) || _Slave.trust < -20))) { + transfers.push(`[[Servants' Quarters|Assign][$assignTo = "Servants' Quarters", $i = ${_ssi}]]`); /* $i = -1 tells Assign to use _Slave as-is */ + } else { + transfers.push('Servants\' Quarters'); + } + } + + if (V.brothel != 0) { + if (V.brothel > V.brothelSlaves && (((_Slave.devotion > 50) || ((_Slave.devotion >= -50) && (_Slave.trust < -20)) || (_Slave.trust < -50) || (_Slave.trust > 50)) && (_Slave.breedingMark != 1 || V.propOutcome == 0))) { + transfers.push(`[[Brothel|Assign][$assignTo = "Brothel", $i = ${_ssi}]]`); /* $i = -1 tells Assign to use _Slave as-is */ + } else { + transfers.push('Brothel') + } + } + + if (V.club != 0) { + if (V.club > V.clubSlaves && (((_Slave.devotion > 50) || ((_Slave.devotion >= -50) && (_Slave.trust < -20)) || (_Slave.trust < -50) || (_Slave.trust > 50)) && (_Slave.breedingMark != 1 || V.propOutcome == 0))) { + transfers.push(`[[Club|Assign][$assignTo = "Club", $i = ${_ssi}]]`); /* $i = -1 tells Assign to use _Slave as-is */ + } else { + transfers.push('Club') + } + } + + if (V.dairy != 0) { + let _dairySeed = V.bioreactorsXY + V.bioreactorsXX + V.bioreactorsHerm + V.bioreactorsBarren; + if (V.dairy <= V.dairySlaves + _dairySeed) { + transfers.push('Dairy'); + } else if (((_Slave.indentureRestrictions > 0) && (V.dairyRestraintsSetting > 1)) || ((_Slave.indentureRestrictions > 1) && (V.dairyRestraintsSetting > 0)) || (_Slave.breedingMark == 1 && V.propOutcome == 1 && V.dairyRestraintsSetting > 0) || ((V.dairyPregSetting > 0) && ((_Slave.bellyImplant != -1) || (_Slave.broodmother > 0)))) { + transfers.push('Dairy'); + } else if (((_Slave.lactation > 0) || (_Slave.balls > 0)) || ((V.dairyFeedersUpgrade == 1) && (V.dairyFeedersSetting > 0) && (V.dairySlimMaintainUpgrade == 0))) { + transfers.push(`[[Dairy|Assign][$assignTo = "Dairy", $i = ${_ssi}]]`); /* $i = -1 tells Assign to use _Slave as-is */ + } else { + transfers.push('Dairy') + } + } + + if (V.farmyard != 0) { + if (V.farmyard > V.farmyardSlaves) { + transfers.push(`[[Farmyard|Assign][$assignTo = "Farmyard", $i = ${_ssi}]]`); /* $i = -1 tells Assign to use _Slave as-is */ + } else { + transfers.push('Farmyard'); + } + } + + if (V.spa != 0) { + if (V.spa > V.spaSlaves && ((_Slave.devotion >= -20 || _Slave.fetish == "mindbroken") && (_Slave.health < 20 || _Slave.trust <= 60 || _Slave.devotion <= 60 || _Slave.fetish == "mindbroken" || _Slave.sexualFlaw !== "none" || _Slave.behavioralFlaw !== "none"))) { + transfers.push(`[[Spa|Assign][$assignTo = "Spa", $i = ${_ssi}]]`); /* $i = -1 tells Assign to use _Slave as-is */ + } else { + transfers.push('Spa'); + } + } + + if (V.nursery != 0) { + if (V.nurseryNannies > V.nurserySlaves && (_Slave.devotion > 20 || _Slave.trust > 20 || _Slave.fetish == "mindbroken")) { + transfers.push(`[[Nursery|Assign][$assignTo = "Nursery", $i = ${_ssi}]]`); /* $i = -1 tells Assign to use _Slave as-is */ + } else { + transfers.push('Nursery'); + } + } /* Closes transfer options check */ + + res.push(transfers.join(' | ')); + } /* CLOSES FUCKDOLL CHECK */ + + }/* closes _numFacilities */ + + if ((passageName != 'Main') || (V.Flag !== undefined) || (V.useSlaveSummaryTabs == 0) || (tabName == "all")) { + res.push(`<span id="slave-${slaves[_ssi].ID}"> </span>`); + } + res.push('<br/>'); + if (V.seeImages != 1 || V.seeSummaryImages != 1 || V.imageChoice == 1) { + res.push(' ') + } + + clearSummaryCache(); + res.push(SlaveSummary(_Slave)); + + V.slaves[_ssi] = _Slave; + res.push('</div>'); + + switch (passageName) { + case "Main": + continue; + case "HG Select": + if (setup.HGCareers.includes(_Slave.career) || (_Slave.skillHG >= V.masteredXP)) { + res.push('<br>' + (V.seeImages != 1 || V.seeSummaryImages != 1 || V.imageChoice == 1) ? ' ' : ''); + res.push('@@.lime;Has applicable career experience.@@'); + } + break; + case "Head Girl Suite": + res.push('<br>' + (V.seeImages != 1 || V.seeSummaryImages != 1 || V.imageChoice == 1) ? ' ' : ''); + if (V.Flag == 0) { + res.push(`[[Send her to live with your Head Girl|Assign][$i = ${_ssi}]]`); + } else { + res.push(`[[Bring her out of the Head Girl's suite|Retrieve][$i = ${_ssi}]]`); + } + break; + case "Recruiter Select": + if (setup.recruiterCareers.includes(_Slave.career) || (_Slave.skillRC >= V.masteredXP)) { + res.push('<br>' + (V.seeImages != 1 || V.seeSummaryImages != 1 || V.imageChoice == 1) ? ' ' : ''); + res.push('@@.lime;Has applicable career experience.@@'); + } + break; + case "BG Select": + if (setup.bodyguardCareers.includes(_Slave.career) || (_Slave.skillBG >= V.masteredXP)) { + res.push('<br>' + (V.seeImages != 1 || V.seeSummaryImages != 1 || V.imageChoice == 1) ? ' ' : ''); + res.push('@@.lime;Has applicable career experience.@@'); + } + break; + case "Spa": + res.push('<br>' + (V.seeImages != 1 || V.seeSummaryImages != 1 || V.imageChoice == 1) ? ' ' : ''); + if (V.Flag == 0) { + res.push(`<<link "Send $him to $spaName" "Assign">><<set $i = ${_ssi}>><</link>>`); + } else if (V.Flag == 1) { + res.push(`<<link "Remove ${V.him} from ${V.spaName}" "Retrieve">><<set $i = ${_ssi}>><</link>>`); + } else { + res.push('[[Change or remove Attendant|Attendant Select]]'); + } + break; + case "Attendant Select": + if (setup.attendantCareers.includes(_Slave.career) || (_Slave.skillAT >= V.masteredXP)) { + res.push('<br>' + (V.seeImages != 1 || V.seeSummaryImages != 1 || V.imageChoice == 1) ? ' ' : ''); + res.push('@@.lime;Has applicable career experience.@@'); + } + break; + case "Nursery": + res.push('<br>' + (V.seeImages != 1 || V.seeSummaryImages != 1 || V.imageChoice == 1) ? ' ' : ''); + if (V.Flag == 0) { + res.push(`<<link "Send $him to $nurseryName" "Assign">><<set $i = ${_ssi}>><</link>>`); + } else if (V.Flag == 1) { + res.push(`<<link "Remove $him from $nurseryName" "Retrieve">><<set $i = ${_ssi}>><</link>>`); + } else { + res.push('[[Change or remove Matron|Matron Select]]'); + } + break; + case "Matron Select": + if (setup.matronCareers.includes(_Slave.career) || (_Slave.skillMT >= V.masteredXP)) { + res.push('<br>' + (V.seeImages != 1 || V.seeSummaryImages != 1 || V.imageChoice == 1) ? ' ' : ''); + res.push('@@.lime;Has applicable career experience.@@'); + } + break; + case "Brothel": + res.push('<br>' + (V.seeImages != 1 || V.seeSummaryImages != 1 || V.imageChoice == 1) ? ' ' : ''); + if (V.Flag == 0) { + res.push(`<<link "Send $him to $brothelName" "Assign">><<set $i = ${_ssi}>><</link>>`); + } else if (V.Flag == 1) { + res.push(`<<link "Release $him from $brothelName" "Retrieve">><<set $i = ${_ssi}>><</link>>`); + } else { + res.push('[[Change or remove Madam|Madam Select]]'); + } + break; + case "Madam Select": + if (setup.madamCareers.includes(_Slave.career) || (_Slave.skillMD >= V.masteredXP)) { + res.push('<br>' + (V.seeImages != 1 || V.seeSummaryImages != 1 || V.imageChoice == 1) ? ' ' : ''); + res.push('@@.lime;Has applicable career experience.@@'); + } + break; + case "Club": + res.push('<br>' + (V.seeImages != 1 || V.seeSummaryImages != 1 || V.imageChoice == 1) ? ' ' : ''); + if (V.Flag == 0) { + res.push(`<<link "Send $him to $clubName" "Assign">><<set $i = ${_ssi}>><</link>>`); + } else if (V.Flag == 1) { + res.push(`<<link "Remove $him from $clubName" "Retrieve">><<set $i = ${_ssi}>><</link>>`); + } else { + res.push('[[Change or remove DJ|DJ Select]]'); + } + break; + case "Arcade": + res.push('<br>' + (V.seeImages != 1 || V.seeSummaryImages != 1 || V.imageChoice == 1) ? ' ' : ''); + if (V.Flag == 0) { + res.push(`<<link "Confine $him in $arcadeName" "Assign">><<set $i = ${_ssi}>><</link>>`); + } else { + res.push(`<<link "Release $him from $arcadeName" "Retrieve">><<set $i = ${_ssi}>><</link>>`); + } + break; + case "DJ Select": + if (setup.DJCareers.includes(_Slave.career) || (_Slave.skillDJ >= V.masteredXP)) { + res.push('<br>' + (V.seeImages != 1 || V.seeSummaryImages != 1 || V.imageChoice == 1) ? ' ' : ''); + res.push('@@.lime;Has applicable career experience.@@'); + } + break; + case "Clinic": + res.push('<br>' + (V.seeImages != 1 || V.seeSummaryImages != 1 || V.imageChoice == 1) ? ' ' : ''); + if (V.clinicUpgradeScanner == 1) { + res.push(`@@.cyan;Estimated DNA error value: ${Math.ceil(_Slave.chem / 10)}@@`); + } + if (V.Flag == 0) { + res.push(`<<link "Send $him to $clinicName" "Assign">><<set $i = ${_ssi}>><</link>>`); + } else if (V.Flag == 1) { + res.push(`<<link "Take $him out of $clinicName" "Retrieve">><<set $i = ${_ssi}>><</link>>`); + } else { + res.push('[[Change or remove Nurse|Nurse Select]]'); + } + break; + case "Nurse Select": + if (setup.nurseCareers.includes(_Slave.career) || (_Slave.skillNU >= V.masteredXP)) { + res.push('<br>' + (V.seeImages != 1 || V.seeSummaryImages != 1 || V.imageChoice == 1) ? ' ' : ''); + res.push('@@.lime;Has applicable career experience.@@'); + } + break; + case "Schoolroom": + res.push('<br>' + (V.seeImages != 1 || V.seeSummaryImages != 1 || V.imageChoice == 1) ? ' ' : ''); + if (V.Flag == 0) { + res.push(`<<link "Assign $him to $schoolroomName" "Assign">><<set $i = ${_ssi}>><</link>>`); + } else if (V.Flag == 1) { + res.push(`<<link "Release $him from $schoolroomName" "Retrieve">><<set $i = ${_ssi}>><</link>>`); + } else { + res.push('[[Change or remove Schoolteacher|Schoolteacher Select]]'); + } + break; + case "Schoolteacher Select": + if (setup.schoolteacherCareers.includes(_Slave.career) || (_Slave.skillTE >= V.masteredXP)) { + res.push('<br>' + (V.seeImages != 1 || V.seeSummaryImages != 1 || V.imageChoice == 1) ? ' ' : ''); + res.push('@@.lime;Has applicable career experience.@@'); + } + break; + case "Dairy": + res.push('<br>' + (V.seeImages != 1 || V.seeSummaryImages != 1 || V.imageChoice == 1) ? ' ' : ''); + if (V.Flag == 0) { + res.push(`<<link "Send $him to $dairyName" "Assign">><<set $i = ${_ssi}>><</link>>`); + } else if (V.Flag == 1) { + res.push(`<<link "Release $him from $dairyName" "Retrieve">><<set $i = ${_ssi}>><</link>>`); + } else { + res.push('[[Change or remove Milkmaid|Milkmaid Select]]'); + } + break; + case "Milkmaid Select": + if (setup.milkmaidCareers.includes(_Slave.career) || (_Slave.skillMM >= V.masteredXP)) { + res.push('<br>' + (V.seeImages != 1 || V.seeSummaryImages != 1 || V.imageChoice == 1) ? ' ' : ''); + res.push('@@.lime;Has applicable career experience.@@'); + } + break; + case "Farmyard": + res.push('<br>' + (V.seeImages != 1 || V.seeSummaryImages != 1 || V.imageChoice == 1) ? ' ' : ''); + if (V.Flag == 0) { + res.push(`<<link "Send $him to $farmyardName" "Assign">><<set $i = ${_ssi}>><</link>>`); + } else if (V.Flag == 1) { + res.push(`<<link "Release $him from $farmyardName" "Retrieve">><<set $i = ${_ssi}>><</link>>`); + } else { + res.push('[[Change or remove Farmer|Farmer Select]]'); + } + break; + case "Farmer Select": + if (setup.farmerCareers.includes(_Slave.career) || (_Slave.skillFA >= V.masteredXP)) { + res.push('<br>' + (V.seeImages != 1 || V.seeSummaryImages != 1 || V.imageChoice == 1) ? ' ' : ''); + res.push('@@.lime;Has applicable career experience.@@'); + } + break; + case "Servants' Quarters": + res.push('<br>' + (V.seeImages != 1 || V.seeSummaryImages != 1 || V.imageChoice == 1) ? ' ' : ''); + if (V.Flag == 0) { + res.push(`<<link "Assign $him to $servantsQuartersName" "Assign">><<set $i = ${_ssi}>><</link>>`); + } else if (V.Flag == 1) { + res.push(`<<link "Release $him from $servantsQuartersName" "Retrieve">><<set $i = ${_ssi}>><</link>>`); + } else { + res.push('[[Change or remove Stewardess|Stewardess Select]]'); + } + break; + case "Stewardess Select": + if (setup.stewardessCareers.includes(_Slave.career) || (_Slave.skillST >= V.masteredXP)) { + res.push('<br>' + (V.seeImages != 1 || V.seeSummaryImages != 1 || V.imageChoice == 1) ? ' ' : ''); + res.push('@@.lime;Has applicable career experience.@@'); + } + break; + case "Master Suite": + res.push('<br>' + (V.seeImages != 1 || V.seeSummaryImages != 1 || V.imageChoice == 1) ? ' ' : ''); + if (V.Flag == 0) { + res.push(`<<link "Add $him to $masterSuiteName" "Assign">><<set $i = ${_ssi}>><</link>>`); + } else if (V.Flag == 1) { + res.push(`<<link "Send $him out of $masterSuiteName" "Retrieve">><<set $i = ${_ssi}>><</link>>`); + } else { + res.push('[[Change or remove Concubine|Concubine Select]]'); + } + break; + case "Cellblock": + res.push('<br>' + (V.seeImages != 1 || V.seeSummaryImages != 1 || V.imageChoice == 1) ? ' ' : ''); + if (V.Flag == 0) { + res.push(`<<link "Confine $him in $cellblockName" "Assign">><<set $i = ${_ssi}>><</link>>`); + } else if (V.Flag == 1) { + res.push(`<<link "Release $him from $cellblockName" "Retrieve">><<set $i = ${_ssi}>><</link>>`); + } else { + res.push('[[Change or remove Wardeness|Wardeness Select]]'); + } + break; + case "Wardeness Select": + if (setup.wardenessCareers.includes(_Slave.career) || (_Slave.skillWA >= V.masteredXP)) { + res.push('<br>' + (V.seeImages != 1 || V.seeSummaryImages != 1 || V.imageChoice == 1) ? ' ' : ''); + res.push('@@.lime;Has applicable career experience.@@'); + } + break; + case "New Game Plus": + res.push('<br>' + (V.seeImages != 1 || V.seeSummaryImages != 1 || V.imageChoice == 1) ? ' ' : ''); + if (V.Flag === 0) { + res.push(`<<link "Add to import list" "New Game Plus">> + <<set $slavesToImport += 1,$Flag = 1>> + <<= assignJob($slaves[${_ssi}], "be imported")>> + <</link>>`); + } else { + res.push(`<<link "Remove from import list" "New Game Plus">> + <<set $slavesToImport -= 1,$Flag = 0>> + <<= removeJob($slaves[${_ssi}], $slaves[${_ssi}].assignment)>> + <</link>>`); + } + break; + case "Matchmaking": + res.push('<br>' + (V.seeImages != 1 || V.seeSummaryImages != 1 || V.imageChoice == 1) ? ' ' : ''); + res.push(`[[Match them|Matchmaking][$subSlave = $slaves[${_ssi}]]]`); + break; + case "Dinner Party Preparations": + res.push('<br>' + (V.seeImages != 1 || V.seeSummaryImages != 1 || V.imageChoice == 1) ? ' ' : ''); + res.push(`[[Make her the main course|Dinner Party Execution][$activeSlave = $slaves[${_ssi}]]]`); + break; + } + } + } + console.log("...took: " + (new Date().getTime() - start) + " ms"); + return res.join(""); +} diff --git a/src/js/utilJS.js b/src/js/utilJS.js index 32c4bf36ef0..736d00ce5ab 100644 --- a/src/js/utilJS.js +++ b/src/js/utilJS.js @@ -525,7 +525,7 @@ window.repFormat = function(s) { return `@@.red;-- rep@@`; } else if (weight < 0) { return `@@.red;- rep@@`; - } + } /*return weight;*/ } }; @@ -579,7 +579,7 @@ window.budgetLine = function(category, title) { </td>\ </tr><</if>>`; } - + }; window.massFormat = function(s) { @@ -1382,4 +1382,31 @@ window.opentab = function(evt, tabName) { V.tabChoice[passage().trim().replace(/ |'/g,"")] = tabName; /*The regex strips spaces and " ' " from passage names, making "Servants' Quarters" into "ServantsQuarters" and allowing it to be used as a label in this object. */ document.getElementById(tabName).style.display = "block"; evt.currentTarget.className += " active"; -}; \ No newline at end of file +}; + +/** + * Creates a HTML element with cutom SugarCube attributes which works as a passage link + * + * The result works in the same way as the wiki markup in the SugarCube + * @see https://www.motoslave.net/sugarcube/2/docs/#markup-html-attribute + * @param {string} passage passage name to link to + * @param {string} linkText link text + * @param {string} [setter=''] setter tet (optional) + * @param {string} [elementType='a'] element type (optional) default is 'a'. + * Could be any of 'a', 'audio', img', 'source', 'video' + * @returns {string} element text + * + * @example + * // equal to [[Go to town|Town]] + * App.UI.passageLink("Go to town", "Town") + */ +App.UI.passageLink = function (linkText, passage, setter, elementType) { + if (!elementType) elementType = 'a'; + + let res = `<${elementType} data-passage="${passage}"`; + if (setter) { + res += ` data-setter="${setter}"`; + } + res += `>${linkText}</${elementType}>`; + return res; +}; diff --git a/src/uncategorized/slaveSummary.tw b/src/uncategorized/slaveSummary.tw index 8b9444e8223..6f76429f617 100644 --- a/src/uncategorized/slaveSummary.tw +++ b/src/uncategorized/slaveSummary.tw @@ -1,1011 +1,13 @@ :: Slave Summary [nobr] -<<set setup.passagePreFilters = setup.passagePreFilters || { - "Main": s => (s.assignmentVisible == 1), - "Personal Attention Select": s => (s.assignmentVisible == 1 && s.fuckdoll <= 0), - "Agent Select": s => (s.fuckdoll == 0 && s.devotion > 20 && s.intelligence+s.intelligenceImplant > 15 && s.intelligenceImplant >= 15 && canWalk(s) && canSee(s) && canHear(s) && canTalk(s) && s.broodmother < 2 && (s.breedingMark != 1 || $propOutcome == 0)), - "BG Select": s => (s.assignmentVisible == 1 && s.fuckdoll == 0 && s.devotion > 50 && s.assignment != "guard you" && canWalk(s) && canSee(s) && canHear(s) && (s.breedingMark != 1 || $propOutcome == 0)), - "Recruiter Select": s => (s.assignmentVisible == 1 && s.fuckdoll == 0 && s.devotion > 50 && s.assignment != "recruit girls" && canWalk(s) && canSee(s) && canTalk(s)), - "HG Select": s => (s.assignmentVisible == 1 && s.fuckdoll == 0 && s.devotion > 50 && s.assignment != "be your Head Girl" && canWalk(s) && canHear(s) && canSee(s) && canTalk(s)), - "Head Girl Suite": s => (s.assignmentVisible == 1 && s.fuckdoll <= 0 && ( - ($Flag == 0 && s.assignment != "be your Head Girl" && s.indentureRestrictions <= 0 && (s.breedingMark != 1 || $propOutcome == 0)) - || ($Flag != 0 && s.assignment == "live with your Head Girl"))), - "Subordinate Targeting": s => (s.devotion >= -20 && s.fuckdoll == 0 && $activeSlave.ID != s.ID && ($activeSlave.amp != 1 || s.amp != 1)), - "Spa": s => (s.assignmentVisible == 1 && s.fuckdoll <= 0 && ( - ($Flag == 0 && s.assignment != "rest in the spa") - || ($Flag == 1 && s.assignment == "rest in the spa") - || ($Flag != 0 && $Flag != 1 && s.ID == $Attendant.ID))), - "Attendant Select": s => (s.assignmentVisible == 1 && s.fuckdoll == 0 && s.devotion > 50 && canWalk(s) && canHear(s)), - "Nursery": s => (s.assignmentVisible == 1 && s.fuckdoll <= 0 && (s.devotion > 20 || s.trust > 20) && ( - ($Flag == 0 && s.assignment != "work as a nanny") - || ($Flag == 1 && s.assignment == "work as a nanny") - || ($Flag != 0 && $Flag != 1 && s.ID == $Matron.ID))), - "Matron Select": s => (s.assignmentVisible == 1 && s.fuckdoll == 0 && s.devotion > 50 && canWalk(s) && canHear(s)), - "Brothel": s => (s.assignmentVisible == 1 && s.fuckdoll <= 0 && ( - ($Flag == 0 && s.assignment != "work in the brothel") - || ($Flag == 1 && s.assignment == "work in the brothel") - || ($Flag != 0 && $Flag != 1 && s.ID == $Madam.ID))), - "Madam Select": s => (s.assignmentVisible == 1 && s.fuckdoll == 0 && s.devotion > 50 && s.intelligence+s.intelligenceImplant >= -50 && canWalk(s) && canSee(s) && canHear(s) && (s.breedingMark != 1 || $propOutcome == 0)), - "Club": s => (s.assignmentVisible == 1 && s.fuckdoll <= 0 && ( - ($Flag == 0 && s.assignment != "serve in the club") - || ($Flag == 1 && s.assignment == "serve in the club") - || ($Flag != 0 && $Flag != 1 && s.ID == $DJ.ID))), - "DJ Select": s => (s.assignmentVisible == 1 && s.fuckdoll == 0 && s.devotion > 50 && s.intelligence+s.intelligenceImplant >= -50 && canTalk(s) && canHear(s) && canWalk(s) && (s.breedingMark != 1 || $propOutcome == 0)), - "Clinic": s => (s.assignmentVisible == 1 && s.fuckdoll <= 0 && ( - ($Flag == 0 && s.assignment != "get treatment in the clinic") - || ($Flag == 1 && s.assignment == "get treatment in the clinic") - || ($Flag != 0 && $Flag != 1 && s.ID == $Nurse.ID))), - "Nurse Select": s => (s.assignmentVisible == 1 && s.fuckdoll == 0 && s.devotion > 50 && canWalk(s) && canSee(s)), - "Schoolroom": s => (s.assignmentVisible == 1 && s.fuckdoll <= 0 && ( - ($Flag == 0 && s.fetish != "mindbroken" && s.assignment != "learn in the schoolroom") - || ($Flag == 1 && s.assignment == "learn in the schoolroom") - || ($Flag != 0 && $Flag != 1 && s.ID == $Schoolteacher.ID))), - "Schoolteacher Select": s => (s.assignmentVisible == 1 && s.fuckdoll == 0 && s.devotion > 50 && canTalk(s) && canHear(s) && canSee(s)), - "Dairy": s => (s.assignmentVisible == 1 && s.fuckdoll <= 0 && ( - ($Flag == 0 && s.assignment != "work in the dairy") - || ($Flag == 1 && s.assignment == "work in the dairy") - || ($Flag != 0 && $Flag != 1 && s.ID == $Milkmaid.ID))), - "Milkmaid Select": s => (s.assignmentVisible == 1 && s.fuckdoll == 0 && s.devotion > 20 && canWalk(s) && canSee(s) && canHear(s)), - "Farmyard": s => (s.assignmentVisible == 1 && s.fuckdoll <= 0 && canWalk(s) && ( - ($Flag == 0 && s.assignment != "work as a farmhand") - || ($Flag == 1 && s.assignment == "work as a farmhand") - || ($Flag != 0 && $Flag != 1 && s.ID == $Farmer.ID))), - "Farmer Select": s => (s.assignmentVisible == 1 && s.fuckdoll == 0 && s.devotion > 50 && canWalk(s) && canSee(s) && canHear(s)), - "Servants' Quarters": s => (s.assignmentVisible == 1 && s.fuckdoll <= 0 && ( - ($Flag == 0 && s.assignment != "work as a servant") - || ($Flag == 1 && s.assignment == "work as a servant") - || ($Flag != 0 && $Flag != 1 && s.ID == $Stewardess.ID))), - "Stewardess Select": s => (s.assignmentVisible == 1 && s.fuckdoll == 0 && s.devotion > 50 && s.intelligence+s.intelligenceImplant >= -50 && canWalk(s) && canSee(s) && canHear(s)), - "Master Suite": s => (s.assignmentVisible == 1 && s.fuckdoll <= 0 && ( - ($Flag == 0 && s.assignment != "serve in the master suite") - || ($Flag == 1 && s.assignment == "serve in the master suite") - || ($Flag != 0 && $Flag != 1 && s.ID == $Concubine.ID))), - "Concubine Select": s => (s.assignmentVisible == 1 && s.fuckdoll == 0 && s.devotion > 50 && s.amp != 1), - "Cellblock": s => (s.assignmentVisible == 1 && s.fuckdoll <= 0 && s.fetish != "mindbroken" && ( - ($Flag == 0 && s.assignment != "be confined in the cellblock") - || ($Flag == 1 && s.assignment == "be confined in the cellblock") - || ($Flag != 0 && $Flag != 1 && s.ID == $Wardeness.ID))), - "Wardeness Select": s => (s.assignmentVisible == 1 && s.fuckdoll == 0 && s.devotion > 50 && canWalk(s) && canSee(s) && canHear(s)), - "Arcade": s => (s.assignmentVisible == 1 && ($arcade >= $arcadeSlaves || $arcadeUpgradeFuckdolls == 1) && ( - ($Flag == 0 && s.assignment != "be confined in the arcade") - || ($Flag != 0 && s.assignment == "be confined in the arcade"))), - "Pit": s => (s.assignmentVisible == 1 && s.fuckdoll == 0 && ( - ($Flag == 0 && !$fighterIDs.includes(s.ID) && canWalk(s) && (s.assignment != "guard you") && (s.assignment != "work in the dairy" || $dairyRestraintsSetting < 2)) - || ($Flag != 0 && $fighterIDs.includes(s.ID)))), - "Coursing Association": s => (s.assignmentVisible == 1 && s.fuckdoll == 0 && ( - ($Flag == 0 && canWalk(s) && $Lurcher.ID != s.ID) - || ($Flag != 0 && $Lurcher.ID == s.ID))), - "New Game Plus": s => (($Flag == 0 && s.assignment != "be imported") || ($Flag != 0 && s.assignment == "be imported")), - "Rules Slave Select": s => (($Flag == 0 && !ruleSlaveSelected(s, $currentRule)) || ($Flag != 0 && ruleSlaveSelected(s, $currentRule))), - "Rules Slave Exclude": s => (($Flag == 0 && !ruleSlaveExcluded(s, $currentRule)) || ($Flag != 0 && ruleSlaveExcluded(s, $currentRule))), - "Matchmaking": s => (s.devotion >= 100 && s.relationship == $activeSlave.relationship && s.ID != $activeSlave.ID), - "Dinner Party Preparations": s => (s.assignmentVisible == 1 && s.fuckdoll == 0), -}>> -<<set _Pass = passage(), _SL = $slaves.length, $assignTo = _Pass, _indexed = 0, - _passagePreFilter = (s => s.assignment != "be your agent" && s.assignment != "live with your agent" && (!setup.passagePreFilters.hasOwnProperty(_Pass) || setup.passagePreFilters[_Pass](s))), - _filteredSlaveIdxs = $slaves.map(function(slave, idx) { return _passagePreFilter(slave) ? idx : null; }).filter(function(idx) { return idx !== null; }), - _indexSlavesIdxs = $slaves.map(function(slave, idx) { return _passagePreFilter(slave) ? idx : null; }).filter(function(idx) { return idx !== null; })>> -<<for !_.isUndefined(_ssi = _filteredSlaveIdxs.shift())>> -<<set _Slave = $slaves[_ssi]>> -<<set _slaveName = SlaveFullName(_Slave);>> - -<<capture _ssi>> - -<<if $useSlaveListInPageJSNavigation == 1>> - <<set _Count = _indexSlavesIdxs.length>> - /* Useful for finding weird combinations — usages of this passage that don't yet generate the quick index. - * <<print 'pass/count/indexed/flag::[' + _Pass + '/' + _Count + '/' + _indexed + '/' + $Flag + ']'>> - */ - <<if ((_Count > 1) && (_indexed == 0) && (((_Pass == 'Main') && (ndef $Flag) && (($useSlaveSummaryTabs == 0) || ($slaveAssignmentTab == "all"))) || ($Flag == 1)))>> - <<set _indexed = 1, _counter = 0, _buttons = [], _offset = -50>> - <<if (/Select/i.test(_Pass))>> - <<set _offset = -25>> - <</if>> - <br /> - <<set _tableCount = _tableCount || 0>> - <<set _tableCount++>> - /* - * we want <button data-quick-index="<<= _tableCount>>">... - */ - <<set _buttonAttributes = { 'data-quick-index': _tableCount }>> - <<htag _buttonAttributes 'button'>>Quick Index<</htag>> - /* - * we want <div id="list_index3" class=" hidden">... - */ - <<set _divAttributes = { id: 'list_index' + _tableCount, class: 'hidden'}>> - <<htag _divAttributes>> - <<for !_.isUndefined(_ssii = _indexSlavesIdxs.shift())>> - <<set _IndexSlave = $slaves[_ssii]>> - <<set _indexSlaveName = SlaveFullName(_IndexSlave);>> - <<set _devotionClass = getSlaveDevotionClass(_IndexSlave);>> - <<set _trustClass = getSlaveTrustClass(_IndexSlave);>> - <<set _buttons.push({'data-name': _indexSlaveName, 'data-scroll-to': '#slave-' + _IndexSlave.ID, 'data-scroll-offset': _offset, 'data-devotion': _IndexSlave.devotion, 'data-trust': _IndexSlave.trust, class: _devotionClass + ' ' + _trustClass });>> - <</for>> - <<if !_.isUndefined(_buttons[0])>> - <<set $sortQuickList = $sortQuickList || 'Devotion'>> - //Sorting:// ''<span id="qlSort">$sortQuickList</span>.'' - <<link "Sort by Devotion">> - <<set $sortQuickList = 'Devotion'>> - <<replace "#qlSort">>$sortQuickList<</replace>> - <<script>> - $('#qlWrapper').removeClass('trust').addClass('devotion'); - sortButtonsByDevotion(); - <</script>> - <</link>> | - <<link "Sort by Trust">> - <<set $sortQuickList = 'Trust'>> - <<replace "#qlSort">>$sortQuickList<</replace>> - <<script>> - $('#qlWrapper').removeClass('devotion').addClass('trust'); - sortButtonsByTrust(); - <</script>> - <</link>> - <br/> - <div id="qlWrapper" class="quicklist devotion"> - <<for !_.isUndefined(_buttons[0])>> - <<set _button = _buttons.shift()>> - <<if !_.isUndefined(_button)>> - <<set _buttonSlaveName = _button['data-name'];>> - <<htag _button 'button'>>_buttonSlaveName<</htag>> - <</if>> - <</for>> - </div> - <script> - $("[data-quick-index]").click(function () { - var $this = $(this), which = $this.attr('data-quick-index'); - var $quick = $('div#list_index' + which); - $quick.toggleClass("hidden"); - }); - quickListBuildLinks(); - </script> - <</if>> - <</htag>> - <</if>> -<</if>> -<<switch _Pass>> -<<case "Main">> - - <<if $useSlaveSummaryTabs == 1>> - <<if $slaveAssignmentTab == "overview">> - <<if $showOneSlave == "Head Girl">> - <<if (_Slave.assignment != "be your Head Girl")>><<continue>><</if>> - <<elseif $showOneSlave == "recruit girls">> - <<if (_Slave.assignment != "recruit girls")>><<continue>><</if>> - <<elseif $showOneSlave == "guard you">> - <<if (_Slave.assignment != "guard you")>><<continue>><</if>> - <</if>> - - <<elseif $slaveAssignmentTab == "resting">> - <<if _Slave.assignment != "rest">><<continue>><</if>> - <<elseif $slaveAssignmentTab == "stay confined">> - <<if (_Slave.assignment != "stay confined")>><<continue>><</if>> - <<elseif $slaveAssignmentTab == "take classes">> - <<if (_Slave.assignment != "take classes")>><<continue>><</if>> - <<elseif $slaveAssignmentTab == "please you">> - <<if (_Slave.assignment != "please you")>><<continue>><</if>> - <<elseif $slaveAssignmentTab == "whore">> - <<if (_Slave.assignment != "whore")>><<continue>><</if>> - <<elseif $slaveAssignmentTab == "serve the public">> - <<if (_Slave.assignment != "serve the public")>><<continue>><</if>> - <<elseif $slaveAssignmentTab == "be a servant">> - <<if (_Slave.assignment != "be a servant")>><<continue>><</if>> - <<elseif $slaveAssignmentTab == "get milked">> - <<if (_Slave.assignment != "get milked")>><<continue>><</if>> - <<elseif $slaveAssignmentTab == "work a glory hole">> - <<if (_Slave.assignment != "work a glory hole")>><<continue>><</if>> - <<elseif $slaveAssignmentTab == "be a subordinate slave">> - <<if (_Slave.assignment != "be a subordinate slave")>><<continue>><</if>> - <</if>> - <</if>> - - <<if (_Slave.choosesOwnClothes == 1) && (_Slave.clothes == "choosing her own clothes")>> - <<set _oldDevotion = _Slave.devotion>> - <<set _chosenClothes = saChoosesOwnClothes(_Slave)>> - <<set $slaves[_ssi].devotion = _oldDevotion, _Slave = $slaves[_ssi]>> /* restore devotion value so repeatedly changing clothes isn't an exploit */ - <</if>> - <br style="clear:both" /><<if $lineSeparations == 0>><br><<else>><hr style="margin:0"><</if>><<if ($seeImages == 1) && ($seeSummaryImages == 1)>><div class="imageRef smlImg"><<SlaveArt _Slave 1>></div><</if>> - <<if "be your Head Girl" == _Slave.assignment>>''@@.lightcoral;HG@@'' - <<elseif "recruit girls" == _Slave.assignment>>''@@.lightcoral;RC@@'' - <<elseif "guard you" == _Slave.assignment>>''@@.lightcoral;BG@@'' - <</if>> - <<if Array.isArray($personalAttention) && $personalAttention.findIndex(function(s) { return s.ID == _Slave.ID; }) != -1>>''@@.lightcoral;PA@@''<</if>> - [[_slaveName|Slave Interact][$activeSlave = $slaves[_ssi]]] /* lists their names */ - -<<case "Personal Attention Select">> - <br style="clear:both" /><<if $lineSeparations == 0>><br><<else>><hr style="margin:0"><</if>><<if ($seeImages == 1) && ($seeSummaryImages == 1)>><div class="imageRef smlImg"><<SlaveArt _Slave 1>></div><</if>> - <<link _slaveName>> - <<if !Array.isArray($personalAttention)>> /* first PA target */ - <<set $personalAttention = [{ID: $slaves[_ssi].ID, trainingRegimen: "undecided"}]>> - <<else>> - <<set _pai = $personalAttention.findIndex(function(s) { return s.ID == $slaves[_ssi].ID; })>> - <<if _pai == -1>> /* not already a PA target; add */ - <<set $activeSlave = $slaves[_ssi], $personalAttention.push({ID: $slaves[_ssi].ID, trainingRegimen: "undecided"})>> - <<else>> /* already a PA target; remove */ - <<set $personalAttention.deleteAt(_pai)>> - <<if $personalAttention.length == 0>> - <<set $personalAttention = "sex">> - <</if>> - <</if>> - <</if>> - <<goto "Personal Attention Select">> - <</link>> -<<case "Agent Select">> - <br style="clear:both" /><<if $lineSeparations == 0>><br><<else>><hr style="margin:0"><</if>><<if ($seeImages == 1) && ($seeSummaryImages == 1)>><div class="imageRef smlImg"><<SlaveArt _Slave 1>></div><</if>> - [[_slaveName|Agent Workaround][$i = _ssi]] -<<case "BG Select">> - <br style="clear:both" /><<if $lineSeparations == 0>><br><<else>><hr style="margin:0"><</if>><<if ($seeImages == 1) && ($seeSummaryImages == 1)>><div class="imageRef smlImg"><<SlaveArt _Slave 1>></div><</if>> - [[_slaveName|Bodyguard Workaround][$i = _ssi]] -<<case "Recruiter Select">> - <br style="clear:both" /><<if $lineSeparations == 0>><br><<else>><hr style="margin:0"><</if>><<if ($seeImages == 1) && ($seeSummaryImages == 1)>><div class="imageRef smlImg"><<SlaveArt _Slave 1>></div><</if>> - [[_slaveName|Recruiter Workaround][$i = _ssi]] -<<case "HG Select">> - <br style="clear:both" /><<if $lineSeparations == 0>><br><<else>><hr style="margin:0"><</if>><<if ($seeImages == 1) && ($seeSummaryImages == 1)>><div class="imageRef smlImg"><<SlaveArt _Slave 1>></div><</if>> - [[_slaveName|HG Workaround][$i = _ssi]] -<<case "Head Girl Suite">> -<<if $Flag == 0>> - <br style="clear:both" /><<if $lineSeparations == 0>><br><<else>><hr style="margin:0"><</if>><<if ($seeImages == 1) && ($seeSummaryImages == 1)>><div class="imageRef smlImg"><<SlaveArt _Slave 1>></div><</if>> - [[_slaveName|Slave Interact][$activeSlave = $slaves[_ssi]]] -<<else>> - <br style="clear:both" /><<if $lineSeparations == 0>><br><<else>><hr style="margin:0"><</if>><<if ($seeImages == 1) && ($seeSummaryImages == 1)>><div class="imageRef smlImg"><<SlaveArt _Slave 1>></div><</if>> - [[_slaveName|Slave Interact][$activeSlave = $slaves[_ssi]]] -<</if>> -<<case "Subordinate Targeting">> - <br style="clear:both" /><<if $lineSeparations == 0>><br><<else>><hr style="margin:0"><</if>><<if ($seeImages == 1) && ($seeSummaryImages == 1)>><div class="imageRef smlImg"><<SlaveArt _Slave 1>></div><</if>> - [[_slaveName|Subordinate Targeting][$activeSlave.subTarget = $slaves[_ssi].ID]] -<<case "Spa">> -<<if $Flag == 0>> - <<if $spa <= $spaSlaves>><<continue>><</if>> - <<if (_Slave.health < 20) || (_Slave.trust < 60) || (_Slave.devotion <= 60) || (_Slave.fetish == "mindbroken") || _Slave.sexualFlaw !== "none" || _Slave.behavioralFlaw !== "none">> - <<if _Slave.devotion >= -20 || _Slave.fetish == "mindbroken">> - <br style="clear:both" /><<if $lineSeparations == 0>><br><<else>><hr style="margin:0"><</if>><<if ($seeImages == 1) && ($seeSummaryImages == 1)>><div class="imageRef smlImg"><<SlaveArt _Slave 1>></div><</if>> - [[_slaveName|Slave Interact][$activeSlave = $slaves[_ssi]]] - <<else>> - <br>//_Slave.slaveName cannot be trusted in the spa// - <<continue>> - <</if>> - <<else>> - <br>//_Slave.slaveName cannot benefit from the spa// - <<continue>> - <</if>> -<<elseif $Flag == 1>> - <br style="clear:both" /><<if $lineSeparations == 0>><br><<else>><hr style="margin:0"><</if>><<if ($seeImages == 1) && ($seeSummaryImages == 1)>><div class="imageRef smlImg"><<SlaveArt _Slave 1>></div><</if>> - [[_slaveName|Slave Interact][$activeSlave = $slaves[_ssi]]] -<<else>> - <<if ($seeImages == 1) && ($seeSummaryImages == 1)>><div class="imageRef smlImg"><<SlaveArt _Slave 1>></div><</if>> - [[_slaveName|Slave Interact][$activeSlave = $slaves[_ssi]]] -<</if>> -<<case "Attendant Select">> - <br style="clear:both" /><<if $lineSeparations == 0>><br><<else>><hr style="margin:0"><</if>><<if ($seeImages == 1) && ($seeSummaryImages == 1)>><div class="imageRef smlImg"><<SlaveArt _Slave 1>></div><</if>> - [[_slaveName|Attendant Workaround][$i = _ssi]] -<<case "Nursery">> -<<if $Flag == 0>> - <<if $nurseryNannies <= $nurserySlaves>><<continue>><</if>> - <<if (_Slave.devotion >= -20) || ((_Slave.devotion >= -50) && (_Slave.trust <= 20)) || (_Slave.trust < -20)>> - <br style="clear:both" /><<if $lineSeparations == 0>><br><<else>><hr style="margin:0"><</if>><<if ($seeImages == 1) && ($seeSummaryImages == 1)>><div class="imageRef smlImg"><<SlaveArt _Slave 1>></div><</if>> - [[_slaveName|Slave Interact][$activeSlave = $slaves[_ssi]]] - <<else>> - <br>//_Slave.slaveName must be either more fearful of you or devoted to you// - <<continue>> - <</if>> -<<elseif $Flag == 1>> - <br style="clear:both" /><<if $lineSeparations == 0>><br><<else>><hr style="margin:0"><</if>><<if ($seeImages == 1) && ($seeSummaryImages == 1)>><div class="imageRef smlImg"><<SlaveArt _Slave 1>></div><</if>> - [[_slaveName|Slave Interact][$activeSlave = $slaves[_ssi]]] -<<else>> - <<if ($seeImages == 1) && ($seeSummaryImages == 1)>><div class="imageRef smlImg"><<SlaveArt _Slave 1>></div><</if>> - [[_slaveName|Slave Interact][$activeSlave = $slaves[_ssi]]] -<</if>> -<<case "Matron Select">> - <br style="clear:both" /><<if $lineSeparations == 0>><br><<else>><hr style="margin:0"><</if>><<if ($seeImages == 1) && ($seeSummaryImages == 1)>><div class="imageRef smlImg"><<SlaveArt _Slave 1>></div><</if>> - [[_slaveName|Matron Workaround][$i = _ssi]] -<<case "Brothel">> -<<if $Flag == 0>> - <<if $brothel <= $brothelSlaves>><<continue>><</if>> - <<if (_Slave.breedingMark != 1 || $propOutcome == 0)>> - <<if (_Slave.devotion > 50) || ((_Slave.devotion >= -50) && (_Slave.trust < -20)) || (_Slave.trust < -50) || (_Slave.trust > 50)>> - <br style="clear:both" /><<if $lineSeparations == 0>><br><<else>><hr style="margin:0"><</if>><<if ($seeImages == 1) && ($seeSummaryImages == 1)>><div class="imageRef smlImg"><<SlaveArt _Slave 1>></div><</if>> - [[_slaveName|Slave Interact][$activeSlave = $slaves[_ssi]]] - <<else>> - <br>//_Slave.slaveName must be either more fearful of you or devoted to you// - <<continue>> - <</if>> - <<else>> - <br>//_Slave.slaveName is for private use only// - <<continue>> - <</if>> -<<elseif $Flag == 1>> - <br style="clear:both" /><<if $lineSeparations == 0>><br><<else>><hr style="margin:0"><</if>><<if ($seeImages == 1) && ($seeSummaryImages == 1)>><div class="imageRef smlImg"><<SlaveArt _Slave 1>></div><</if>> - [[_slaveName|Slave Interact][$activeSlave = $slaves[_ssi]]] -<<else>> - <<if ($seeImages == 1) && ($seeSummaryImages == 1)>><div class="imageRef smlImg"><<SlaveArt _Slave 1>></div><</if>> - [[_slaveName|Slave Interact][$activeSlave = $slaves[_ssi]]] -<</if>> -<<case "Madam Select">> - <br style="clear:both" /><<if $lineSeparations == 0>><br><<else>><hr style="margin:0"><</if>><<if ($seeImages == 1) && ($seeSummaryImages == 1)>><div class="imageRef smlImg"><<SlaveArt _Slave 1>></div><</if>> - [[_slaveName|Madam Workaround][$i = _ssi]] -<<case "Club">> -<<if $Flag == 0>> - <<if $club <= $clubSlaves>><<continue>><</if>> - <<if (_Slave.breedingMark != 1 || $propOutcome == 0)>> - <<if (_Slave.devotion > 50) || ((_Slave.devotion >= -50) && (_Slave.trust < -20)) || (_Slave.trust < -50) || (_Slave.trust > 50)>> - <br style="clear:both" /><<if $lineSeparations == 0>><br><<else>><hr style="margin:0"><</if>><<if ($seeImages == 1) && ($seeSummaryImages == 1)>><div class="imageRef smlImg"><<SlaveArt _Slave 1>></div><</if>> - [[_slaveName|Slave Interact][$activeSlave = $slaves[_ssi]]] - <<else>> - <br>//_Slave.slaveName must be either more fearful of you or devoted to you// - <<continue>> - <</if>> - <<else>> - <br>//_Slave.slaveName is for private use only// - <<continue>> - <</if>> -<<elseif $Flag == 1>> - <br style="clear:both" /><<if $lineSeparations == 0>><br><<else>><hr style="margin:0"><</if>><<if ($seeImages == 1) && ($seeSummaryImages == 1)>><div class="imageRef smlImg"><<SlaveArt _Slave 1>></div><</if>> - [[_slaveName|Slave Interact][$activeSlave = $slaves[_ssi]]] -<<else>> - <br style="clear:both" /><<if $lineSeparations == 0>><br><<else>><hr style="margin:0"><</if>><<if ($seeImages == 1) && ($seeSummaryImages == 1)>><div class="imageRef smlImg"><<SlaveArt _Slave 1>></div><</if>> - [[_slaveName|Slave Interact][$activeSlave = $slaves[_ssi]]] -<</if>> -<<case "DJ Select">> - <br style="clear:both" /><<if $lineSeparations == 0>><br><<else>><hr style="margin:0"><</if>><<if ($seeImages == 1) && ($seeSummaryImages == 1)>><div class="imageRef smlImg"><<SlaveArt _Slave 1>></div><</if>> - [[_slaveName|DJ Workaround][$i = _ssi]] -<<case "Clinic">> -<<if $Flag == 0>> - <<if $clinic <= $clinicSlaves>><<continue>><</if>> - <<if (_Slave.health < 20) || ($Nurse != 0 && ((_Slave.chem > 15 && $clinicUpgradeFilters == 1) || ($bellyImplants == 1 && _Slave.bellyImplant > -1) || (_Slave.pregKnown == 1 && ($clinicSpeedGestation >= 0 || _Slave.pregControl == "speed up")) || (_Slave.pregAdaptation*1000 < _Slave.bellyPreg || _Slave.preg > _Slave.pregData.normalBirth/1.33)))>> - <br style="clear:both" /><<if $lineSeparations == 0>><br><<else>><hr style="margin:0"><</if>><<if ($seeImages == 1) && ($seeSummaryImages == 1)>><div class="imageRef smlImg"><<SlaveArt _Slave 1>></div><</if>> - [[_slaveName|Slave Interact][$activeSlave = $slaves[_ssi]]] - <<else>> - <br>//_Slave.slaveName cannot benefit from the clinic// - <<continue>> - <</if>> -<<elseif $Flag == 1>> - <br style="clear:both" /><<if $lineSeparations == 0>><br><<else>><hr style="margin:0"><</if>><<if ($seeImages == 1) && ($seeSummaryImages == 1)>><div class="imageRef smlImg"><<SlaveArt _Slave 1>></div><</if>> - [[_slaveName|Slave Interact][$activeSlave = $slaves[_ssi]]] -<<else>> - <br style="clear:both" /><<if $lineSeparations == 0>><br><<else>><hr style="margin:0"><</if>><<if ($seeImages == 1) && ($seeSummaryImages == 1)>><div class="imageRef smlImg"><<SlaveArt _Slave 1>></div><</if>> - [[_slaveName|Slave Interact][$activeSlave = $slaves[_ssi]]] -<</if>> -<<case "Nurse Select">> - <br style="clear:both" /><<if $lineSeparations == 0>><br><<else>><hr style="margin:0"><</if>><<if ($seeImages == 1) && ($seeSummaryImages == 1)>><div class="imageRef smlImg"><<SlaveArt _Slave 1>></div><</if>> - [[_slaveName|Nurse Workaround][$i = _ssi]] -<<case "Schoolroom">> -<<if $Flag == 0>> - <<if $schoolroom <= $schoolroomSlaves>><<continue>><</if>> - <<if (_Slave.devotion >= -20) || ((_Slave.devotion >= -50) && (_Slave.trust < -20)) || (_Slave.trust < -50)>> - <<if (_Slave.intelligenceImplant < 30) || (_Slave.voice != 0 && _Slave.accent+$schoolroomUpgradeLanguage > 2) || (_Slave.oralSkill <= 10+$schoolroomUpgradeSkills*20) || (_Slave.whoreSkill <= 10+$schoolroomUpgradeSkills*20) || (_Slave.entertainSkill <= 10+$schoolroomUpgradeSkills*20) || (_Slave.analSkill < 10+$schoolroomUpgradeSkills*20) || ((_Slave.vagina >= 0) && (_Slave.vaginalSkill < 10+$schoolroomUpgradeSkills*20))>> - <br style="clear:both" /><<if $lineSeparations == 0>><br><<else>><hr style="margin:0"><</if>><<if ($seeImages == 1) && ($seeSummaryImages == 1)>><div class="imageRef smlImg"><<SlaveArt _Slave 1>></div><</if>> - [[_slaveName|Slave Interact][$activeSlave = $slaves[_ssi]]] - <<else>> - <br>//_Slave.slaveName already has a basic education// - <<continue>> - <</if>> - <<else>> - <br>//_Slave.slaveName is too resistant to learn// - <<continue>> - <</if>> -<<elseif $Flag == 1>> - <br style="clear:both" /><<if $lineSeparations == 0>><br><<else>><hr style="margin:0"><</if>><<if ($seeImages == 1) && ($seeSummaryImages == 1)>><div class="imageRef smlImg"><<SlaveArt _Slave 1>></div><</if>> - [[_slaveName|Slave Interact][$activeSlave = $slaves[_ssi]]] -<<else>> - <br style="clear:both" /><<if $lineSeparations == 0>><br><<else>><hr style="margin:0"><</if>><<if ($seeImages == 1) && ($seeSummaryImages == 1)>><div class="imageRef smlImg"><<SlaveArt _Slave 1>></div><</if>> - [[_slaveName|Slave Interact][$activeSlave = $slaves[_ssi]]] -<</if>> -<<case "Schoolteacher Select">> - <br style="clear:both" /><<if $lineSeparations == 0>><br><<else>><hr style="margin:0"><</if>><<if ($seeImages == 1) && ($seeSummaryImages == 1)>><div class="imageRef smlImg"><<SlaveArt _Slave 1>></div><</if>> - [[_slaveName|Schoolteacher Workaround][$i = _ssi]] -<<case "Dairy">> -<<if $Flag == 0>> - <<set _dairySeed = $bioreactorsXY+$bioreactorsXX+$bioreactorsHerm+$bioreactorsBarren>> - <<if _Slave.assignment == "work in the dairy">><<continue>><</if>> - <<if $dairy <= $dairySlaves+_dairySeed>><<continue>><</if>> - <<if (_Slave.indentureRestrictions > 0) && ($dairyRestraintsSetting > 1)>> - <br>//_Slave.slaveName's indenture forbids extractive Dairy service.// - <<continue>> - <<elseif (_Slave.indentureRestrictions > 1) && ($dairyRestraintsSetting > 0)>> - <br>//_Slave.slaveName's indenture allows only free range milking.// - <<continue>> - <<elseif _Slave.breedingMark == 1 && $propOutcome == 1 && $dairyRestraintsSetting > 0>> - <br>//_Slave.slaveName may only be a free range cow// - <<continue>> - <<elseif ($dairyPregSetting > 0) && ((_Slave.bellyImplant != -1) || (_Slave.broodmother != 0))>> - <br>//_Slave.slaveName's womb cannot accommodate current machine settings// - <<continue>> - <<else>> - <<if (_Slave.lactation > 0) || (_Slave.balls > 0) || (($dairySlimMaintainUpgrade == 0 || $dairySlimMaintain == 0) && (_Slave.boobs > 300 || _Slave.balls == 0 || $dairyImplantsSetting == 1) && $dairyImplantsSetting != 2)>> - <<if (_Slave.devotion > 20) || ((_Slave.devotion >= -50) && (_Slave.trust < -20)) || (_Slave.trust < -50) || (_Slave.amp == 1) || ($dairyRestraintsUpgrade == 1)>> - <<if ($dairyStimulatorsSetting < 2) || (_Slave.anus > 2) || ($dairyPrepUpgrade == 1)>> - <<if ($dairyPregSetting < 2) || (_Slave.vagina > 2) || (_Slave.ovaries == 0) || ($dairyPrepUpgrade == 1)>> - <br style="clear:both" /><<if $lineSeparations == 0>><br><<else>><hr style="margin:0"><</if>><<if ($seeImages == 1) && ($seeSummaryImages == 1)>><div class="imageRef smlImg"><<SlaveArt _Slave 1>></div><</if>> - [[_slaveName|Slave Interact][$activeSlave = $slaves[_ssi]]] - <<else>> - <br>//_Slave.slaveName's vagina cannot accommodate current machine settings// - <<continue>> - <</if>> - <<else>> - <br>//_Slave.slaveName's anus cannot accommodate current machine settings// - <<continue>> - <</if>> - <<else>> - <br>//_Slave.slaveName must be obedient in order to be milked here// - <<continue>> - <</if>> - <<elseif (($dairySlimMaintainUpgrade == 1 && $dairySlimMaintain == 1) || ($dairyImplantsSetting == 2) || (_Slave.boobs <= 300 && _Slave.balls > 0 && ($dairyImplantsSetting == 0 || $dairyImplantsSetting == 3)))>> - <br>//_Slave.slaveName is not lactating<<if $seeDicks > 0>> or producing semen<</if>>, and <<print $dairyName>>'s current settings forbid the automatic implantation of lactation inducing drugs or manual stimulation to induce it, so she cannot be a cow// - <<continue>> - <<else>> - <br>//_Slave.slaveName is not lactating<<if $seeDicks > 0>> or producing semen<</if>> and cannot be a cow// - <<continue>> - <</if>> - <</if>> -<<elseif $Flag == 1>> - <br style="clear:both" /><<if $lineSeparations == 0>><br><<else>><hr style="margin:0"><</if>><<if ($seeImages == 1) && ($seeSummaryImages == 1)>><div class="imageRef smlImg"><<SlaveArt _Slave 1>></div><</if>> - [[_slaveName|Slave Interact][$activeSlave = $slaves[_ssi]]] -<<else>> - <br style="clear:both" /><<if $lineSeparations == 0>><br><<else>><hr style="margin:0"><</if>><<if ($seeImages == 1) && ($seeSummaryImages == 1)>><div class="imageRef smlImg"><<SlaveArt _Slave 1>></div><</if>> - [[_slaveName|Slave Interact][$activeSlave = $slaves[_ssi]]] -<</if>> -<<case "Milkmaid Select">> - <br style="clear:both" /><<if $lineSeparations == 0>><br><<else>><hr style="margin:0"><</if>><<if ($seeImages == 1) && ($seeSummaryImages == 1)>><div class="imageRef smlImg"><<SlaveArt _Slave 1>></div><</if>> - [[_slaveName|Milkmaid Workaround][$i = _ssi]] -<<case "Farmyard">> -<<if $Flag == 0>> - <<if _Slave.assignment == ("work as a farmhand")>><<continue>><</if>> - <<if $farmyard <= $farmyardSlaves>><<continue>><</if>> - <br style="clear:both" /><<if $lineSeparations == 0>><br><<else>><hr style="margin:0"><</if>><<if ($seeImages == 1) && ($seeSummaryImages == 1)>><div class="imageRef smlImg"><<SlaveArt _Slave 1>></div><</if>> - [[_slaveName|Slave Interact][$activeSlave = $slaves[_ssi]]] -<<elseif $Flag == 1>> - <br style="clear:both" /><<if $lineSeparations == 0>><br><<else>><hr style="margin:0"><</if>><<if ($seeImages == 1) && ($seeSummaryImages == 1)>><div class="imageRef smlImg"><<SlaveArt _Slave 1>></div><</if>> - [[_slaveName|Slave Interact][$activeSlave = $slaves[_ssi]]] -<<else>> - <br style="clear:both" /><<if $lineSeparations == 0>><br><<else>><hr style="margin:0"><</if>><<if ($seeImages == 1) && ($seeSummaryImages == 1)>><div class="imageRef smlImg"><<SlaveArt _Slave 1>></div><</if>> - [[_slaveName|Slave Interact][$activeSlave = $slaves[_ssi]]] -<</if>> -<<case "Farmer Select">> - <br style="clear:both" /><<if $lineSeparations == 0>><br><<else>><hr style="margin:0"><</if>><<if ($seeImages == 1) && ($seeSummaryImages == 1)>><div class="imageRef smlImg"><<SlaveArt _Slave 1>></div><</if>> - [[_slaveName|Farmer Workaround][$i = _ssi]] -<<case "Servants' Quarters">> -<<if $Flag == 0>> - <<if $servantsQuarters <= $servantsQuartersSlaves>><<continue>><</if>> - <<if (_Slave.devotion >= -20) || ((_Slave.devotion >= -50) && (_Slave.trust <= 20)) || (_Slave.trust < -20)>> - <br style="clear:both" /><<if $lineSeparations == 0>><br><<else>><hr style="margin:0"><</if>><<if ($seeImages == 1) && ($seeSummaryImages == 1)>><div class="imageRef smlImg"><<SlaveArt _Slave 1>></div><</if>> - [[_slaveName|Slave Interact][$activeSlave = $slaves[_ssi]]] - <<else>> - <br>//_Slave.slaveName must be either more fearful of you or devoted to you// - <<continue>> - <</if>> -<<elseif $Flag == 1>> - <br style="clear:both" /><<if $lineSeparations == 0>><br><<else>><hr style="margin:0"><</if>><<if ($seeImages == 1) && ($seeSummaryImages == 1)>><div class="imageRef smlImg"><<SlaveArt _Slave 1>></div><</if>> - [[_slaveName|Slave Interact][$activeSlave = $slaves[_ssi]]] -<<else>> - <br style="clear:both" /><<if $lineSeparations == 0>><br><<else>><hr style="margin:0"><</if>><<if ($seeImages == 1) && ($seeSummaryImages == 1)>><div class="imageRef smlImg"><<SlaveArt _Slave 1>></div><</if>> - [[_slaveName|Slave Interact][$activeSlave = $slaves[_ssi]]] -<</if>> -<<case "Stewardess Select">> - <br style="clear:both" /><<if $lineSeparations == 0>><br><<else>><hr style="margin:0"><</if>><<if ($seeImages == 1) && ($seeSummaryImages == 1)>><div class="imageRef smlImg"><<SlaveArt _Slave 1>></div><</if>> - [[_slaveName|Stewardess Workaround][$i = _ssi]] -<<case "Master Suite">> -<<if $Flag == 0>> - <<if $masterSuite <= $masterSuiteSlaves>><<continue>><</if>> - <<if (_Slave.devotion > 20) || ((_Slave.devotion >= -50) && (_Slave.trust < -20)) || (_Slave.trust < -50)>> - <br style="clear:both" /><<if $lineSeparations == 0>><br><<else>><hr style="margin:0"><</if>><<if ($seeImages == 1) && ($seeSummaryImages == 1)>><div class="imageRef smlImg"><<SlaveArt _Slave 1>></div><</if>> - [[_slaveName|Slave Interact][$activeSlave = $slaves[_ssi]]] - <<else>> - <br>//_Slave.slaveName is not sufficiently broken for the master suite// - <<continue>> - <</if>> -<<elseif $Flag == 1>> - <br style="clear:both" /><<if $lineSeparations == 0>><br><<else>><hr style="margin:0"><</if>><<if ($seeImages == 1) && ($seeSummaryImages == 1)>><div class="imageRef smlImg"><<SlaveArt _Slave 1>></div><</if>> - [[_slaveName|Slave Interact][$activeSlave = $slaves[_ssi]]] -<<else>> - <br style="clear:both" /><<if $lineSeparations == 0>><br><<else>><hr style="margin:0"><</if>><<if ($seeImages == 1) && ($seeSummaryImages == 1)>><div class="imageRef smlImg"><<SlaveArt _Slave 1>></div><</if>> - [[_slaveName|Slave Interact][$activeSlave = $slaves[_ssi]]] -<</if>> -<<case "Concubine Select">> - <br style="clear:both" /><<if $lineSeparations == 0>><br><<else>><hr style="margin:0"><</if>><<if ($seeImages == 1) && ($seeSummaryImages == 1)>><div class="imageRef smlImg"><<SlaveArt _Slave 1>></div><</if>> - [[_slaveName|Concubine Workaround][$i = _ssi]] -<<case "Cellblock">> -<<if _Slave.assignmentVisible != 1>><<continue>><</if>> -<<if $Flag == 0>> - <<if $cellblock <= $cellblockSlaves>><<continue>><</if>> - <<if (_Slave.devotion < -20 && _Slave.trust >= -20) || (_Slave.devotion < -50 && _Slave.trust >= -50)>> - <br style="clear:both" /><<if $lineSeparations == 0>><br><<else>><hr style="margin:0"><</if>><<if ($seeImages == 1) && ($seeSummaryImages == 1)>><div class="imageRef smlImg"><<SlaveArt _Slave 1>></div><</if>> - [[_slaveName|Slave Interact][$activeSlave = $slaves[_ssi]]] - <<else>> - <br>//_Slave.slaveName is sufficiently broken in so that the cellblock would have no effect// - <<continue>> - <</if>> -<<elseif $Flag == 1>> - <br style="clear:both" /><<if $lineSeparations == 0>><br><<else>><hr style="margin:0"><</if>><<if ($seeImages == 1) && ($seeSummaryImages == 1)>><div class="imageRef smlImg"><<SlaveArt _Slave 1>></div><</if>> - [[_slaveName|Slave Interact][$activeSlave = $slaves[_ssi]]] -<<else>> - <br style="clear:both" /><<if $lineSeparations == 0>><br><<else>><hr style="margin:0"><</if>><<if ($seeImages == 1) && ($seeSummaryImages == 1)>><div class="imageRef smlImg"><<SlaveArt _Slave 1>></div><</if>> - [[_slaveName|Slave Interact][$activeSlave = $slaves[_ssi]]] -<</if>> -<<case "Wardeness Select">> - <br style="clear:both" /><<if $lineSeparations == 0>><br><<else>><hr style="margin:0"><</if>><<if ($seeImages == 1) && ($seeSummaryImages == 1)>><div class="imageRef smlImg"><<SlaveArt _Slave 1>></div><</if>> - [[_slaveName|Wardeness Workaround][$i = _ssi]] -<<case "Arcade">> -<<if $Flag == 0>> - <<if _Slave.assignment == "be confined in the arcade">><<continue>><</if>> - <<if $arcade <= $arcadeSlaves && $arcadeUpgradeFuckdolls != 1>><<continue>><</if>> - <<if (_Slave.breedingMark != 1 || $propOutcome == 0)>> - <<if (_Slave.indentureRestrictions <= 0)>> - <br style="clear:both" /><<if $lineSeparations == 0>><br><<else>><hr style="margin:0"><</if>><<if ($seeImages == 1) && ($seeSummaryImages == 1)>><div class="imageRef smlImg"><<SlaveArt _Slave 1>></div><</if>> - [[_slaveName|Slave Interact][$activeSlave = $slaves[_ssi]]] - <<else>> - <br>//_Slave.slaveName's indenture forbids arcade service.// - <<continue>> - <</if>> - <<else>> - <br>//_Slave.slaveName is for private use only// - <<continue>> - <</if>> -<<else>> - <br style="clear:both" /><<if $lineSeparations == 0>><br><<else>><hr style="margin:0"><</if>><<if ($seeImages == 1) && ($seeSummaryImages == 1)>><div class="imageRef smlImg"><<SlaveArt _Slave 1>></div><</if>> - [[_slaveName|Slave Interact][$activeSlave = $slaves[_ssi]]] -<</if>> -<<case "Pit">> -<<if $Flag == 0>> - <<if (_Slave.indentureRestrictions > 0) && ($pitLethal == 1)>> - <br>//_Slave.slaveName's indenture forbids lethal fights.// - <<continue>> - <<elseif (_Slave.indentureRestrictions > 1)>> - <br>//_Slave.slaveName's indenture forbids fighting.// - <<continue>> - <<elseif _Slave.breedingMark == 1 && $propOutcome == 1>> - <br>//_Slave.slaveName may not participate in combat// - <<continue>> - <<else>> - <br style="clear:both" /><<if $lineSeparations == 0>><br><<else>><hr style="margin:0"><</if>><<if ($seeImages == 1) && ($seeSummaryImages == 1)>><div class="imageRef smlImg"><<SlaveArt _Slave 1>></div><</if>> - [[_slaveName|Assign][$i = _ssi]] - <</if>> -<<else>> - <br style="clear:both" /><<if $lineSeparations == 0>><br><<else>><hr style="margin:0"><</if>><<if ($seeImages == 1) && ($seeSummaryImages == 1)>><div class="imageRef smlImg"><<SlaveArt _Slave 1>></div><</if>> - [[_slaveName|Retrieve][$i = _ssi]] -<</if>> -<<case "Coursing Association">> -<<if $Flag == 0>> - <br style="clear:both" /><<if $lineSeparations == 0>><br><<else>><hr style="margin:0"><</if>><<if ($seeImages == 1) && ($seeSummaryImages == 1)>><div class="imageRef smlImg"><<SlaveArt _Slave 1>></div><</if>> - [[_slaveName|Assign][$i = _ssi]] -<<else>> - <br style="clear:both" /><<if $lineSeparations == 0>><br><<else>><hr style="margin:0"><</if>><<if ($seeImages == 1) && ($seeSummaryImages == 1)>><div class="imageRef smlImg"><<SlaveArt _Slave 1>></div><</if>> - [[_slaveName|Retrieve][$i = _ssi]] -<</if>> -<<case "New Game Plus">> -<<if $Flag == 0>> - <br>__''@@.pink;_Slave.slaveName@@''__ -<<else>> - <br>__''@@.pink;_Slave.slaveName@@''__ -<</if>> -<<case "Rules Slave Select">> -<<if $Flag == 0>> - <br>__'' - [[_slaveName|Rules Slave Select Workaround][$activeSlave = $slaves[_ssi]]]''__ -<<else>> - <br>__'' - [[_slaveName|Rules Slave Deselect Workaround][$activeSlave = $slaves[_ssi]]]''__ -<</if>> -<<case "Rules Slave Exclude">> -<<if $Flag == 0>> - <br>__'' - [[_slaveName|Rules Slave Exclude Workaround][$activeSlave = $slaves[_ssi]]]''__ -<<else>> - <br>__'' - [[_slaveName|Rules Slave NoExclude Workaround][$activeSlave = $slaves[_ssi]]]''__ -<</if>> -<<case "Matchmaking">> - <br style="clear:both" /><<if $lineSeparations == 0>><br><<else>><hr style="margin:0"><</if>><<if ($seeImages == 1) && ($seeSummaryImages == 1)>><div class="imageRef smlImg"><<SlaveArt _Slave 1>></div><</if>> - [[_slaveName|Slave Interact][$activeSlave = $slaves[_ssi]]] -<<case "Dinner Party Preparations">> - <br style="clear:both" /><<if $lineSeparations == 0>><br><<else>><hr style="margin:0"><</if>><<if ($seeImages == 1) && ($seeSummaryImages == 1)>><div class="imageRef smlImg"><<SlaveArt _Slave 1>></div><</if>> - [[_slaveName|Slave Interact][$activeSlave = $slaves[_ssi]]] -<</switch>> - -<<run SlaveStatClamp(_Slave)>> - -<<set _Slave.trust = Math.trunc(_Slave.trust), _Slave.devotion = Math.trunc(_Slave.devotion), _Slave.health = Math.trunc(_Slave.health)>> - -<<set $slaves[_ssi] = _Slave>> - -will -<<if (_Slave.assignment == "rest") && (_Slave.health >= -20)>> - ''__@@.lawngreen;rest.@@__'' -<<elseif (_Slave.assignment == "stay confined") && ((_Slave.devotion > 20) || ((_Slave.trust < -20) && (_Slave.devotion >= -20)) || ((_Slave.trust < -50) && (_Slave.devotion >= -50)))>> - ''__@@.lawngreen;stay confined.@@__''<<if _Slave.sentence > 0>> (_Slave.sentence weeks)<</if>> -<<else>> - <<if _Slave.choosesOwnAssignment == 1>>choose her own job<<else>>_Slave.assignment<<if _Slave.sentence > 0>> (_Slave.sentence weeks)<</if>><</if>>. -<</if>> - -<<if ($displayAssignments == 1) && (_Pass == "Main") && (_Slave.ID != $HeadGirl.ID) && (_Slave.ID != $Recruiter.ID) && (_Slave.ID != $Bodyguard.ID)>> - <<if _Slave.assignment != "rest">> - <<link "Rest" "Main">><<= removeJob($slaves[_ssi], $slaves[_ssi].assignment)>><</link>> - <<else>> - Rest - <</if>> - <<if _Slave.assignment != "please you">> - | <<link "Fucktoy" "Main">><<= assignJob($slaves[_ssi], "please you")>><</link>> - <<else>> - | Fucktoy - <</if>> - <<if _Slave.indentureRestrictions <= 0 && (_Slave.breedingMark != 1 || $propOutcome == 0)>> - <<if _Slave.assignment != "work a glory hole">> - | <<link "Gloryhole" "Main">><<= assignJob($slaves[_ssi], "work a glory hole")>><</link>> - <<else>> - | Hole - <</if>> - <</if>> - <<if _Slave.fuckdoll == 0>> /* NON-FUCKDOLL ASSIGNMENTS */ - <<if (_Slave.assignment != "take classes")>> - <<if (_Slave.intelligenceImplant < 15) && ((_Slave.devotion >= -20) || ((_Slave.trust < -20) && (_Slave.devotion >= -50)) || (_Slave.trust < -50)) && (_Slave.fetish != "mindbroken")>> - | <<link "Classes" "Main">><<= assignJob($slaves[_ssi], "take classes")>><</link>> - <</if>> - <<else>> - | Classes - <</if>> - <<if (_Slave.assignment != "be a servant")>> - <<if ((_Slave.devotion >= -20) || ((_Slave.trust < -20) && (_Slave.devotion >= -50)) || (_Slave.trust < -50)) && canWalk(_Slave) && canSee(_Slave)>> - | <<link "House Servant" "Main">><<= assignJob($slaves[_ssi], "be a servant")>><</link>> - <</if>> - <<else>> - | House Servant - <</if>> - <<if (_Slave.assignment != "whore") && (_Slave.breedingMark != 1 || $propOutcome == 0)>> - | <<link "Whore" "Main">><<= assignJob($slaves[_ssi], "whore")>><</link>> - <<else>> - | Whore - <</if>> - <<if (_Slave.assignment != "serve the public") && (_Slave.breedingMark != 1 || $propOutcome == 0)>> - | <<link "Public Servant" "Main">><<= assignJob($slaves[_ssi], "serve the public")>><</link>> - <<else>> - | Public Servant - <</if>> - <<if (_Slave.lactation > 0) || (_Slave.balls > 0)>> - <<if (_Slave.assignment != "get milked")>> - | <<link "Milked" "Main">><<= assignJob($slaves[_ssi], "get milked")>><</link>> - <<else>> - | Milked - <</if>> - <</if>> - <<if (_Slave.assignment != "stay confined")>> - | <<link "Confinement" "Main">><<= assignJob($slaves[_ssi], "stay confined")>><</link>> - <<else>> - | Confinement - <</if>> - <<if (_Slave.assignment != "choose her own job")>> - | <<link "Let _Slave.object choose" "Main">><<= assignJob($slaves[_ssi], "choose her own job")>><</link>> - <<else>> - | Let _Slave.object choose - <</if>> - <</if>> /* CLOSES FUCKDOLL CHECK */ -<</if>> - -<<set _numFacilities = $brothel+$club+$dairy+$farmyard+$servantsQuarters+$masterSuite+$spa+$clinic+$schoolroom+$cellblock+$arcade+$HGSuite>> - -<<if _numFacilities > 0>> - - <<if _Pass == "Main" || _Pass == "Head Girl Suite" || _Pass == "Spa" || _Pass == "Brothel" || _Pass == "Club" || _Pass == "Arcade" || _Pass == "Clinic" || _Pass == "Schoolroom" || _Pass == "Dairy" || _Pass == "Farmyard" || _Pass == "Servants' Quarters" || _Pass == "Master Suite" || _Pass == "Cellblock" >> - <<set $returnTo=_Pass >> - - <br>Transfer to: - - <<if _Slave.assignment != "rest" && _Slave.assignment != "please you" && _Slave.assignment != "take classes" && _Slave.assignment != "be a servant" && _Slave.assignment != "whore" && _Slave.assignment != "serve the public" && _Slave.assignment != "get milked" && _Slave.assignment != "stay confined">> - <<link "Penthouse" "Main">><<= removeJob($slaves[_ssi], $slaves[_ssi].assignment)>><</link>> | - <<else>> - Penthouse | - <</if>> - - <<if $arcade != 0>> - <<if $arcade > $arcadeSlaves && (_Slave.indentureRestrictions <= 0) && (_Slave.breedingMark != 1 || $propOutcome == 0)>> - [[Arcade|Assign][$assignTo = "Arcade", $i = _ssi]] /* $i = -1 tells Assign to use _Slave as-is */ - <<else>>Arcade<</if>> - <<if _numFacilities-- > 1>>|<</if>> - <</if>> - - <<if _Slave.fuckdoll == 0>> /* NON-FUCKDOLL FACILITIES */ - - <<if $clinic != 0>> - <<if $clinic > $clinicSlaves && (_Slave.health < 20 || ($Nurse != 0 && ((_Slave.chem > 15 && $clinicUpgradeFilters == 1) || ($bellyImplants == 1 && _Slave.bellyImplant > -1) || (_Slave.pregKnown == 1 && ($clinicSpeedGestation >= 0 || _Slave.pregControl == "speed up")) || (_Slave.pregAdaptation*1000 < _Slave.bellyPreg || _Slave.preg > _Slave.pregData.normalBirth/1.33))))>> - [[Clinic|Assign][$assignTo = "Clinic", $i = _ssi]] /* $i = -1 tells Assign to use _Slave as-is */ - <<else>>Clinic<</if>> - <<if _numFacilities-- > 1>>|<</if>> - <</if>> - - <<if $masterSuite != 0>> - <<if $masterSuite > $masterSuiteSlaves && ((_Slave.devotion > 20) || ((_Slave.devotion >= -50) && (_Slave.trust < -20)) || (_Slave.trust < -50))>> - [[Master Suite|Assign][$assignTo = "Master Suite", $i = _ssi]] /* $i = -1 tells Assign to use _Slave as-is */ - <<else>>Master Suite<</if>> - <<if _numFacilities-- > 1>>|<</if>> - <</if>> - - <<if $cellblock != 0>> - <<if $cellblock > $cellblockSlaves && ((_Slave.devotion < -20 && _Slave.trust >= -20) || (_Slave.devotion < -50 && _Slave.trust >= -50))>> - [[Cellblock|Assign][$assignTo = "Cellblock", $i = _ssi]] /* $i = -1 tells Assign to use _Slave as-is */ - <<else>>Cellblock<</if>> - <<if _numFacilities-- > 1>>|<</if>> - <</if>> - - <<if $schoolroom != 0>> - <<if $schoolroom > $schoolroomSlaves && (_Slave.fetish != "mindbroken" && (_Slave.devotion >= -20 || (_Slave.devotion >= -50 && _Slave.trust < -20) || _Slave.trust < -50) && ((_Slave.intelligenceImplant < 30) || (_Slave.voice != 0 && _Slave.accent+$schoolroomUpgradeLanguage > 2) || (_Slave.oralSkill <= 10+$schoolroomUpgradeSkills*20) || (_Slave.whoreSkill <= 10+$schoolroomUpgradeSkills*20) || (_Slave.entertainSkill <= 10+$schoolroomUpgradeSkills*20) || (_Slave.analSkill < 10+$schoolroomUpgradeSkills*20) || (_Slave.vagina >= 0 && _Slave.vaginalSkill < 10+$schoolroomUpgradeSkills*20)))>> - [[Schoolroom|Assign][$assignTo = "Schoolroom", $i = _ssi]] /* $i = -1 tells Assign to use _Slave as-is */ - <<else>>Schoolroom<</if>> - <<if _numFacilities-- > 1>>|<</if>> - <</if>> - - <<if $servantsQuarters != 0>> - <<if $servantsQuarters > $servantsQuartersSlaves && (canWalk(_Slave) && canSee(_Slave) && (_Slave.devotion >= -20 || (_Slave.devotion >= -50 && _Slave.trust <= 20) || _Slave.trust < -20))>> - [[Servants' Quarters|Assign][$assignTo = "Servants' Quarters", $i = _ssi]] /* $i = -1 tells Assign to use _Slave as-is */ - <<else>>Servants' Quarters<</if>> - <<if _numFacilities-- > 1>>|<</if>> - <</if>> - - <<if $brothel != 0>> - <<if $brothel > $brothelSlaves && (((_Slave.devotion > 50) || ((_Slave.devotion >= -50) && (_Slave.trust < -20)) || (_Slave.trust < -50) || (_Slave.trust > 50)) && (_Slave.breedingMark != 1 || $propOutcome == 0))>> - [[Brothel|Assign][$assignTo = "Brothel", $i = _ssi]] /* $i = -1 tells Assign to use _Slave as-is */ - <<else>>Brothel<</if>> - <<if _numFacilities-- > 1>>|<</if>> - <</if>> - - <<if $club != 0>> - <<if $club > $clubSlaves && (((_Slave.devotion > 50) || ((_Slave.devotion >= -50) && (_Slave.trust < -20)) || (_Slave.trust < -50) || (_Slave.trust > 50)) && (_Slave.breedingMark != 1 || $propOutcome == 0))>> - [[Club|Assign][$assignTo = "Club", $i = _ssi]] /* $i = -1 tells Assign to use _Slave as-is */ - <<else>>Club<</if>> - <<if _numFacilities-- > 1>>|<</if>> - <</if>> - - <<if $dairy != 0>> - <<set _dairySeed = $bioreactorsXY+$bioreactorsXX+$bioreactorsHerm+$bioreactorsBarren>> - <<if $dairy <= $dairySlaves+_dairySeed>> - Dairy - <<elseif (((_Slave.indentureRestrictions > 0) && ($dairyRestraintsSetting > 1)) || ((_Slave.indentureRestrictions > 1) && ($dairyRestraintsSetting > 0)) || (_Slave.breedingMark == 1 && $propOutcome == 1 && $dairyRestraintsSetting > 0) || (($dairyPregSetting > 0) && ((_Slave.bellyImplant != -1) || (_Slave.broodmother > 0))))>> - Dairy - <<elseif ((_Slave.lactation > 0) || (_Slave.balls > 0)) || (($dairyFeedersUpgrade == 1) && ($dairyFeedersSetting > 0) && ($dairySlimMaintainUpgrade == 0))>> - [[Dairy|Assign][$assignTo = "Dairy", $i = _ssi]] /* $i = -1 tells Assign to use _Slave as-is */ - <<else>>Dairy<</if>> - <<if _numFacilities-- > 1>>|<</if>> - <</if>> - - <<if $farmyard != 0>> - <<if $farmyard > $farmyardSlaves>> - [[Farmyard|Assign][$assignTo = "Farmyard", $i = _ssi]] /* $i = -1 tells Assign to use _Slave as-is */ - <<else>>Farmyard<</if>> - <<if _numFacilities-- > 1>>|<</if>> - <</if>> - - <<if $spa != 0>> - <<if $spa > $spaSlaves && ((_Slave.devotion >= -20 || _Slave.fetish == "mindbroken") && (_Slave.health < 20 || _Slave.trust <= 60 || _Slave.devotion <= 60 || _Slave.fetish == "mindbroken" || _Slave.sexualFlaw !== "none" || _Slave.behavioralFlaw !== "none"))>> - [[Spa|Assign][$assignTo = "Spa", $i = _ssi]] /* $i = -1 tells Assign to use _Slave as-is */ - <<else>>Spa<</if>> - <<if _numFacilities-- > 1>>|<</if>> - <</if>> - - <<if $nursery != 0>> - <<if $nurseryNannies > $nurserySlaves && (_Slave.devotion > 20 || _Slave.trust > 20 || _Slave.fetish == "mindbroken")>> - [[Nursery|Assign][$assignTo = "Nursery", $i = _ssi]] /* $i = -1 tells Assign to use _Slave as-is */ - <<else>>Nursery<</if>> - <</if>> - - <</if>> /* Closes transfer options check */ - - <</if>> /* CLOSES FUCKDOLL CHECK */ - -<</if>> /* closes _numFacilities */ - -<<if ((_Pass != 'Main') || (def $Flag) || ($useSlaveSummaryTabs == 0) || ($slaveAssignmentTab == "all"))>> - <<print '<span id="slave-' + $slaves[_ssi].ID + '"> </span>'>> -<</if>> -<br/> -<<if $seeImages != 1 || $seeSummaryImages != 1 || $imageChoice == 1>> <</if>> - -<<run clearSummaryCache()>> -<<= SlaveSummary(_Slave)>> - -<<set $slaves[_ssi] = _Slave>> - - -<<switch _Pass>> -<<case "Main">> - <<continue>> -<<case "HG Select">> - <<if setup.HGCareers.includes(_Slave.career) || (_Slave.skillHG >= $masteredXP)>> - <br><<if $seeImages != 1 || $seeSummaryImages != 1 || $imageChoice == 1>> <</if>>@@.lime;Has applicable career experience.@@ - <</if>> -<<case "Head Girl Suite">> - <br><<if $seeImages != 1 || $seeSummaryImages != 1 || $imageChoice == 1>> <</if>> - <<if $Flag == 0>> - [[Send her to live with your Head Girl|Assign][$i = _ssi]] - <<else>> - [[Bring her out of the Head Girl's suite|Retrieve][$i = _ssi]] - <<break>> - <</if>> -<<case "Recruiter Select">> - <<if setup.recruiterCareers.includes(_Slave.career) || (_Slave.skillRC >= $masteredXP)>> - <br><<if $seeImages != 1 || $seeSummaryImages != 1 || $imageChoice == 1>> <</if>>@@.lime;Has applicable career experience.@@ - <</if>> -<<case "BG Select">> - <<if setup.bodyguardCareers.includes(_Slave.career) || (_Slave.skillBG >= $masteredXP)>> - <br><<if $seeImages != 1 || $seeSummaryImages != 1 || $imageChoice == 1>> <</if>>@@.lime;Has applicable career experience.@@ - <</if>> -<<case "Spa">> - <br><<if $seeImages != 1 || $seeSummaryImages != 1 || $imageChoice == 1>> <</if>> - <<if $Flag == 0>> - <<link "Send $him to $spaName" "Assign">><<set $i = _ssi>><</link>> - <<elseif $Flag == 1>> - <<link "Remove $him from $spaName" "Retrieve">><<set $i = _ssi>><</link>> - <<else>> - [[Change or remove Attendant|Attendant Select]] - <<break>> - <</if>> -<<case "Attendant Select">> - <<if setup.attendantCareers.includes(_Slave.career) || (_Slave.skillAT >= $masteredXP)>> - <br><<if $seeImages != 1 || $seeSummaryImages != 1 || $imageChoice == 1>> <</if>>@@.lime;Has applicable career experience.@@ - <</if>> -<<case "Nursery">> - <br><<if $seeImages != 1 || $seeSummaryImages != 1 || $imageChoice == 1>> <</if>> - <<if $Flag == 0>> - <<link "Send $him to $nurseryName" "Assign">><<set $i = _ssi>><</link>> - <<elseif $Flag == 1>> - <<link "Remove $him from $nurseryName" "Retrieve">><<set $i = _ssi>><</link>> - <<else>> - [[Change or remove Matron|Matron Select]] - <<break>> - <</if>> -<<case "Matron Select">> - <<if setup.matronCareers.includes(_Slave.career) || (_Slave.skillMT >= $masteredXP)>> - <br><<if $seeImages != 1 || $seeSummaryImages != 1 || $imageChoice == 1>> <</if>>@@.lime;Has applicable career experience.@@ - <</if>> -<<case "Brothel">> - <br><<if $seeImages != 1 || $seeSummaryImages != 1 || $imageChoice == 1>> <</if>> - <<if $Flag == 0>> - <<link "Send $him to $brothelName" "Assign">><<set $i = _ssi>><</link>> - <<elseif $Flag == 1>> - <<link "Release $him from $brothelName" "Retrieve">><<set $i = _ssi>><</link>> - <<else>> - [[Change or remove Madam|Madam Select]] - <<break>> - <</if>> -<<case "Madam Select">> - <<if setup.madamCareers.includes(_Slave.career) || (_Slave.skillMD >= $masteredXP)>> - <br><<if $seeImages != 1 || $seeSummaryImages != 1 || $imageChoice == 1>> <</if>>@@.lime;Has applicable career experience.@@ - <</if>> -<<case "Club">> - <br><<if $seeImages != 1 || $seeSummaryImages != 1 || $imageChoice == 1>> <</if>> - <<if $Flag == 0>> - <<link "Send $him to $clubName" "Assign">><<set $i = _ssi>><</link>> - <<elseif $Flag == 1>> - <<link "Remove $him from $clubName" "Retrieve">><<set $i = _ssi>><</link>> - <<else>> - [[Change or remove DJ|DJ Select]] - <<break>> - <</if>> -<<case "Arcade">> - <br><<if $seeImages != 1 || $seeSummaryImages != 1 || $imageChoice == 1>> <</if>> - <<if $Flag == 0>> - <<link "Confine $him in $arcadeName" "Assign">><<set $i = _ssi>><</link>> - <<else>> - <<link "Release $him from $arcadeName" "Retrieve">><<set $i = _ssi>><</link>> - <</if>> -<<case "DJ Select">> - <<if setup.DJCareers.includes(_Slave.career) || (_Slave.skillDJ >= $masteredXP)>> - <br><<if $seeImages != 1 || $seeSummaryImages != 1 || $imageChoice == 1>> <</if>>@@.lime;Has applicable career experience.@@ - <</if>> -<<case "Clinic">> - <br><<if $seeImages != 1 || $seeSummaryImages != 1 || $imageChoice == 1>> <</if>> - <<if $clinicUpgradeScanner == 1>> - @@.cyan;Estimated DNA error value: <<print Math.ceil(_Slave.chem/10)>>@@ - <</if>> - <<if $Flag == 0>> - <<link "Send $him to $clinicName" "Assign">><<set $i = _ssi>><</link>> - <<elseif $Flag == 1>> - <<link "Take $him out of $clinicName" "Retrieve">><<set $i = _ssi>><</link>> - <<else>> - [[Change or remove Nurse|Nurse Select]] - <<break>> - <</if>> -<<case "Nurse Select">> - <<if setup.nurseCareers.includes(_Slave.career) || (_Slave.skillNU >= $masteredXP)>> - <br><<if $seeImages != 1 || $seeSummaryImages != 1 || $imageChoice == 1>> <</if>>@@.lime;Has applicable career experience.@@ - <</if>> -<<case "Schoolroom">> - <br><<if $seeImages != 1 || $seeSummaryImages != 1 || $imageChoice == 1>> <</if>> - <<if $Flag == 0>> - <<link "Assign $him to $schoolroomName" "Assign">><<set $i = _ssi>><</link>> - <<elseif $Flag == 1>> - <<link "Release $him from $schoolroomName" "Retrieve">><<set $i = _ssi>><</link>> - <<else>> - [[Change or remove Schoolteacher|Schoolteacher Select]] - <<break>> - <</if>> -<<case "Schoolteacher Select">> - <<if setup.schoolteacherCareers.includes(_Slave.career) || (_Slave.skillTE >= $masteredXP)>> - <br><<if $seeImages != 1 || $seeSummaryImages != 1 || $imageChoice == 1>> <</if>>@@.lime;Has applicable career experience.@@ - <</if>> -<<case "Dairy">> - <br><<if $seeImages != 1 || $seeSummaryImages != 1 || $imageChoice == 1>> <</if>> - <<if $Flag == 0>> - <<link "Send $him to $dairyName" "Assign">><<set $i = _ssi>><</link>> - <<elseif $Flag == 1>> - <<link "Release $him from $dairyName" "Retrieve">><<set $i = _ssi>><</link>> - <<else>> - [[Change or remove Milkmaid|Milkmaid Select]] - <<break>> - <</if>> -<<case "Milkmaid Select">> - <<if setup.milkmaidCareers.includes(_Slave.career) || (_Slave.skillMM >= $masteredXP)>> - <br><<if $seeImages != 1 || $seeSummaryImages != 1 || $imageChoice == 1>> <</if>>@@.lime;Has applicable career experience.@@ - <</if>> -<<case "Farmyard">> - <br><<if $seeImages != 1 || $seeSummaryImages != 1 || $imageChoice == 1>> <</if>> - <<if $Flag == 0>> - <<link "Send $him to $farmyardName" "Assign">><<set $i = _ssi>><</link>> - <<elseif $Flag == 1>> - <<link "Release $him from $farmyardName" "Retrieve">><<set $i = _ssi>><</link>> - <<else>> - [[Change or remove Farmer|Farmer Select]] - <<break>> - <</if>> -<<case "Farmer Select">> - <<if setup.farmerCareers.includes(_Slave.career) || (_Slave.skillFA >= $masteredXP)>> - <br><<if $seeImages != 1 || $seeSummaryImages != 1 || $imageChoice == 1>> <</if>>@@.lime;Has applicable career experience.@@ - <</if>> -<<case "Servants' Quarters">> - <br><<if $seeImages != 1 || $seeSummaryImages != 1 || $imageChoice == 1>> <</if>> - <<if $Flag == 0>> - <<link "Assign $him to $servantsQuartersName" "Assign">><<set $i = _ssi>><</link>> - <<elseif $Flag == 1>> - <<link "Release $him from $servantsQuartersName" "Retrieve">><<set $i = _ssi>><</link>> - <<else>> - [[Change or remove Stewardess|Stewardess Select]] - <<break>> - <</if>> -<<case "Stewardess Select">> - <<if setup.stewardessCareers.includes(_Slave.career) || (_Slave.skillST >= $masteredXP)>> - <br><<if $seeImages != 1 || $seeSummaryImages != 1 || $imageChoice == 1>> <</if>>@@.lime;Has applicable career experience.@@ - <</if>> -<<case "Master Suite">> -<br><<if $seeImages != 1 || $seeSummaryImages != 1 || $imageChoice == 1>> <</if>> - <<if $Flag == 0>> - <<link "Add $him to $masterSuiteName" "Assign">><<set $i = _ssi>><</link>> - <<elseif $Flag == 1>> - <<link "Send $him out of $masterSuiteName" "Retrieve">><<set $i = _ssi>><</link>> - <<else>> - [[Change or remove Concubine|Concubine Select]] - <<break>> - <</if>> -<<case "Cellblock">> - <br><<if $seeImages != 1 || $seeSummaryImages != 1 || $imageChoice == 1>> <</if>> - <<if $Flag == 0>> - <<link "Confine $him in $cellblockName" "Assign">><<set $i = _ssi>><</link>> - <<elseif $Flag == 1>> - <<link "Release $him from $cellblockName" "Retrieve">><<set $i = _ssi>><</link>> - <<else>> - [[Change or remove Wardeness|Wardeness Select]] - <<break>> - <</if>> -<<case "Wardeness Select">> - <<if setup.wardenessCareers.includes(_Slave.career) || (_Slave.skillWA >= $masteredXP)>> - <br><<if $seeImages != 1 || $seeSummaryImages != 1 || $imageChoice == 1>> <</if>>@@.lime;Has applicable career experience.@@ - <</if>> -<<case "New Game Plus">> - <br><<if $seeImages != 1 || $seeSummaryImages != 1 || $imageChoice == 1>> <</if>> - <<if $Flag === 0>> - <<link "Add to import list" "New Game Plus">> - <<set $slavesToImport += 1,$Flag = 1>> - <<= assignJob($slaves[_ssi], "be imported")>> - <</link>> -<<else>> - <<link "Remove from import list" "New Game Plus">> - <<set $slavesToImport -= 1,$Flag = 0>> - <<= removeJob($slaves[_ssi], $slaves[_ssi].assignment)>> - <</link>> -<</if>> -<<case "Matchmaking">> - <br><<if $seeImages != 1 || $seeSummaryImages != 1 || $imageChoice == 1>> <</if>> - [[Match them|Matchmaking][$subSlave = $slaves[_ssi]]] -<<case "Dinner Party Preparations">> - <br><<if $seeImages != 1 || $seeSummaryImages != 1 || $imageChoice == 1>> <</if>> - [[Make her the main course|Dinner Party Execution][$activeSlave = $slaves[_ssi]]] -<</switch>> - -<</capture>> - -<</for>> +<<print App.UI.slaveSummaryList(passage())>> + +<<run $(document).one(':passagedisplay', function() { + $("[data-quick-index]").click(function () { + let which = this.attributes["data-quick-index"].value; + let quick = $("div#list_index" + which); + quick.toggleClass("hidden"); + }); + quickListBuildLinks(); +});>> <<set $activeSlave = 0, _Slave = 0>> -- GitLab