diff --git a/js/003-data/gameVariableData.js b/js/003-data/gameVariableData.js index 1382eb00f66d173abd84817eb7e91f54ab64edfb..54f95fcb23a59dd64b17bf5c8813fd0e445833ee 100644 --- a/js/003-data/gameVariableData.js +++ b/js/003-data/gameVariableData.js @@ -329,32 +329,6 @@ App.Data.resetOnNGPlus = { assignmentRecords: {}, marrying: [], // array of slave being married this week organs: [], - /** @type {number[]} */ - ArcadeiIDs: [], - /** @type {number[]} */ - BrothiIDs: [], - /** @type {number[]} */ - CellBiIDs: [], - /** @type {number[]} */ - CliniciIDs: [], - /** @type {number[]} */ - ClubiIDs: [], - /** @type {number[]} */ - DairyiIDs: [], - /** @type {number[]} */ - FarmyardiIDs: [], - /** @type {number[]} */ - HGSuiteiIDs: [], - /** @type {number[]} */ - MastSiIDs: [], - /** @type {number[]} */ - SchlRiIDs: [], - /** @type {number[]} */ - ServQiIDs: [], - /** @type {number[]} */ - SpaiIDs: [], - /** @type {number[]} */ - NurseryiIDs: [], corp: App.Data.CorpInitData, dividendTimer: 0, personalShares: 0, diff --git a/src/002-config/Serializable.js b/src/002-config/Serializable.js index 8bad01a68b2146f4c16853f58da166558a2103cf..16ce68b8cb970d595693990ed0ebbb1a59818814 100644 --- a/src/002-config/Serializable.js +++ b/src/002-config/Serializable.js @@ -3,8 +3,6 @@ * * All subclasses HAVE to implement get className(), _cleanUpConfigScheme() and clone(), * in the SAME WAY they are implemented here. - * - * @type {App.Entity.Serializable} */ App.Entity.Serializable = class { /** diff --git a/src/002-config/fc-version.js b/src/002-config/fc-version.js index 29e758ebb74fc57968a4e1450ef65dd189769808..1293db3e986a6e5023ee66f8f1ecccae094b444b 100644 --- a/src/002-config/fc-version.js +++ b/src/002-config/fc-version.js @@ -1,7 +1,7 @@ App.Version = { base: "0.10.7.1", // The vanilla version the mod is based off of, this should never be changed. pmod: "3.5.0", - release: 1070, + release: 1071, }; /* Use release as save version */ diff --git a/src/004-base/000-proxies.js b/src/004-base/000-proxies.js index 0adc240f5092d2c275eb341feb41e8ec3ce7b193..d28b2503a69bc3e04547a4efc47ff3ff24ac24d7 100644 --- a/src/004-base/000-proxies.js +++ b/src/004-base/000-proxies.js @@ -122,8 +122,3 @@ globalThis.runWithCheatProxy = function(callback) { globalThis.storyProxy = null; } }; - -Object.defineProperty(App, "activeSlave", { - get: () => V.activeSlave, - set: (slave) => { V.activeSlave = slave; } -}); diff --git a/src/004-base/facility.js b/src/004-base/facility.js index 1ca29008502fd1c447d80f93ba746d23374859cf..58becb3182f3de261ed7a1f6a70dc9a27744c257 100644 --- a/src/004-base/facility.js +++ b/src/004-base/facility.js @@ -274,6 +274,16 @@ App.Entity.Facilities.Facility = class { return res !== undefined ? res : 'the ' + this.genericName; } + get nameCaps() { + const res = V[this.desc.baseName + "NameCaps"]; + return res ? res : this.name.replace("the ", "The "); + } + + get UIName() { + const nameCaps = this.nameCaps; + return nameCaps === "The " + this.genericName ? this.genericName : nameCaps; + } + /** Facility generic name ("Brothel", "Schoolroom", etc.) * @returns {string} */ get genericName() { @@ -320,8 +330,29 @@ App.Entity.Facilities.Facility = class { return this.jobs.reduce((acc, job) => { return acc + job.employeesIDs().size; }, 0); } + /** + * @returns {number} count of non slave occupants (e.g. bioreactors in the dairy) + */ + get nonEmployeeOccupantsCount() { + return 0; + } + + /** + * @returns {number} total count of facility places taken by employees and other beings (e.g. bioreactors in the dairy) + */ + get totalOccupants() { + return this.hostedSlaves + this.nonEmployeeOccupantsCount; + } + get hasEmployees() { + return this.jobs.some(j => j.employeesIDs().size > 0); + } + get hasFreeSpace() { - return this.capacity > this.hostedSlaves; + return this.capacity > this.totalOccupants; + } + + get freeSpace() { + return this.capacity > 0 ? this.capacity - this.totalOccupants : 0; } /** @@ -350,9 +381,15 @@ App.Entity.Facilities.Facility = class { job = job || this.desc.defaultJob; const j = this.job(job); if (j === undefined) { - console.log(`Can't find job ${job} at ${this.name}.`); // eslint-disable-line no-console + if (this.jobs.length === 0) { + const err = `${this.genericName} facility has no jobs for slaves`; + console.warn(err); + return [err]; + } else { + console.warn(`Can't find job ${job} at ${this.name}.`); // eslint-disable-line no-console + } } - // if there are more than one jobs at this facility, test them too + // if there are more than one job at this facility, test them too if (Object.keys(this.desc.jobs).length > 1 && this.isHosted(slave)) { return [`${slave.slaveName} is already assigned to ${slave.assignment} at ${this.name}.`]; } diff --git a/src/arcologyBuilding/base.js b/src/arcologyBuilding/base.js index 0fb3408564c523fd5aa67e1b53b66ce603ea2d19..8f1e33500bb6a3c598bf8d6eb0cf54eaed64ddc6 100644 --- a/src/arcologyBuilding/base.js +++ b/src/arcologyBuilding/base.js @@ -54,6 +54,25 @@ App.Arcology.defaultBuilding = function(terrain = "default") { */ App.Arcology.sectionOrder = ["fountain", "penthouse", "spire", "shops", "ravine-markets", "apartments", "markets", "manufacturing"]; +/** + * @param {App.Entity.Facilities.Facility} facility + * @param {string} [passageName] + * @param {string} [statsStr] + * @return {Node} + */ +App.Arcology.facilityCellContent = function(facility, passageName, statsStr) { + const res = document.createDocumentFragment(); + res.append(App.UI.DOM.passageLink(facility.UIName, passageName || facility.genericName)); + const stats = document.createElement("span"); + stats.style.whiteSpace = "nowrap"; + stats.textContent = statsStr ? statsStr : ` (${facility.employeesIDs().size}/${facility.capacity})`; + if (facility.manager && facility.manager.currentEmployee) { + stats.textContent += ", L"; + } + res.append(stats); + return res; +}; + App.Arcology.Section = class extends App.Entity.Serializable { /** * @param {string} id unique ID diff --git a/src/arcologyBuilding/manufacturing.js b/src/arcologyBuilding/manufacturing.js index 8c71a05c843f916fb572e887916d555481d8438a..2130b2e24cc081d3c6ac92f4c0e42634cdaa5bbe 100644 --- a/src/arcologyBuilding/manufacturing.js +++ b/src/arcologyBuilding/manufacturing.js @@ -49,22 +49,11 @@ App.Arcology.Cell.Manufacturing = class extends App.Arcology.Cell.BaseCell { */ cellContent(path) { if (this.type === "Dairy") { - const fragment = document.createDocumentFragment(); - fragment.append(App.UI.DOM.passageLink(dairyUIName(), "Dairy"), - ` (${V.DairyiIDs.length}${V.bioreactorsXY + V.bioreactorsXX + V.bioreactorsHerm + V.bioreactorsBarren > 0 ? "+" : ""}/${V.dairy})`); - if (V.Milkmaid) { - fragment.append(",L"); - } - return fragment; + return App.Arcology.facilityCellContent(App.Entity.facilities.dairy, null, + ` (${App.Entity.facilities.dairy.employeesIDs().size}${V.bioreactorsXY + V.bioreactorsXX + V.bioreactorsHerm + V.bioreactorsBarren > 0 ? "+" : ""}/${App.Entity.facilities.dairy.capacity})`); } if (this.type === "Farmyard") { - const fragment = document.createDocumentFragment(); - fragment.append(App.UI.DOM.passageLink("Farmyard", "Farmyard"), - ` (${V.FarmyardiIDs.length}/${V.farmyard})`); - if (V.Farmer) { - fragment.append(",L"); - } - return fragment; + return App.Arcology.facilityCellContent(App.Entity.facilities.farmyard); } switch (this.type) { case "Manufacturing": diff --git a/src/arcologyBuilding/markets.js b/src/arcologyBuilding/markets.js index 6028c0618f8cf31ff89962dd2b175a9bcf1b4bbf..0210f6ff8b62d4b6cb56881d2e9158a8918b613a 100644 --- a/src/arcologyBuilding/markets.js +++ b/src/arcologyBuilding/markets.js @@ -42,15 +42,13 @@ App.Arcology.Cell.Market = class extends App.Arcology.Cell.BaseCell { */ cellContent(path) { if (this.type === "Arcade") { - const fragment = document.createDocumentFragment(); - fragment.append(App.UI.DOM.passageLink(arcadeUIName(), "Arcade"), - ` (${V.ArcadeiIDs.length}/${V.arcade})`); - return fragment; + return App.Arcology.facilityCellContent(App.Entity.facilities.arcade); } if (this.type === "Pit") { + const pit = App.Entity.facilities.pit; const fragment = document.createDocumentFragment(); - fragment.append(App.UI.DOM.passageLink(pitUIName(), "Pit"), - `(${V.fighterIDs.length})`); + fragment.append(App.UI.DOM.passageLink(pit.UIName, "Pit"), + `(${pit.employeesIDs().size})`); return fragment; } switch (this.type) { diff --git a/src/arcologyBuilding/penthouse.js b/src/arcologyBuilding/penthouse.js index 819e4b71992cb04d315855b77896f958583d0d88..945dad029aad83ee2d3f5043e0de247dfc0370b0 100644 --- a/src/arcologyBuilding/penthouse.js +++ b/src/arcologyBuilding/penthouse.js @@ -36,16 +36,27 @@ App.Arcology.Cell.Penthouse = class extends App.Arcology.Cell.BaseCell { let wrapper = getWrapper(fragment); - if (V.masterSuite) { - wrapper.append(createFacilityDiv(App.UI.DOM.passageLink(masterSuiteUIName(), "Master Suite"), - `(${V.MastSiIDs.length}/${V.masterSuite}${V.Concubine ? ", C" : ""})`)); + const fcs = App.Entity.facilities; + + /** + * @param {App.Entity.Facilities.Facility} facility + * @param {string} [passageName] + * @param {string} [leaderAbbr] + */ + function addFacility(facility, passageName, leaderAbbr = 'L') { + if (facility.established) { + wrapper.append(createFacilityDiv(App.UI.DOM.passageLink(facility.UIName, passageName || facility.genericName), + `(${facility.employeesIDs().size}/${facility.capacity}${facility.manager.employeesIDs().size > 0 ? `, ${leaderAbbr}` : ""})`)); + } } - if (V.HGSuite) { - const link = App.UI.DOM.passageLink(headGirlSuiteUIName(), "Head Girl Suite"); + addFacility(fcs.masterSuite, fcs.masterSuite.genericName, "C"); + + if (fcs.headGirlSuite.established) { + const link = App.UI.DOM.passageLink(fcs.headGirlSuite.UIName, "Head Girl Suite"); if (V.HeadGirl !== 0) { - wrapper.append(createFacilityDiv(link, `(HG${V.HGSuiteiIDs.length > 0 ? ", 1" : ""})`)); + wrapper.append(createFacilityDiv(link, `(HG${fcs.headGirlSuite.employeesIDs().size > 0 ? ", 1" : ""})`)); } else { wrapper.append(createFacilityDiv(link)); } @@ -61,39 +72,23 @@ App.Arcology.Cell.Penthouse = class extends App.Arcology.Cell.BaseCell { } } - if (V.servantsQuarters) { - wrapper.append(createFacilityDiv(App.UI.DOM.passageLink(servantQuartersUIName(), "Servants' Quarters"), - `(${V.ServQiIDs.length}/${V.servantsQuarters}${V.Stewardess ? ", L" : ""})`)); - } + addFacility(fcs.servantsQuarters); + addFacility(fcs.spa); - if (V.spa) { - wrapper.append(createFacilityDiv(App.UI.DOM.passageLink(spaUIName(), "Spa"), - `(${V.SpaiIDs.length}/${V.spa}${S.Attendant ? ", L" : ""})`)); + if (fcs.nursery.established) { + const n = fcs.nursery; + wrapper.append(createFacilityDiv(App.UI.DOM.passageLink(n.UIName, "Nursery"), + `(${numberWithPluralOne(n.capacity - V.nurseryBabies, "empty room")}, ${n.employeesIDs().size}/${V.nurseryNannies}${V.Matron ? ", L" : ""})`)); } - if (V.nursery) { - wrapper.append(createFacilityDiv(App.UI.DOM.passageLink(nurseryUIName(), "Nursery"), - `(${numberWithPluralOne(V.nursery - V.nurseryBabies, "empty room")}, ${V.NurseryiIDs.length}/${V.nurseryNannies}${V.Matron ? ", L" : ""})`)); - } - - if (V.clinic) { - wrapper.append(createFacilityDiv(App.UI.DOM.passageLink(clinicUIName(), "Clinic"), - `(${V.CliniciIDs.length}/${V.clinic}${V.Nurse ? ", L" : ""})`)); - } - - if (V.schoolroom) { - wrapper.append(createFacilityDiv(App.UI.DOM.passageLink(schoolRoomUIName(), "Schoolroom"), - `(${V.SchlRiIDs.length}/${V.schoolroom}${V.Schoolteacher ? ", L" : ""})`)); - } - - if (V.cellblock) { - wrapper.append(createFacilityDiv(App.UI.DOM.passageLink(cellblockUIName(), "Cellblock"), - `(${V.CellBiIDs.length}/${V.cellblock}${V.Wardeness ? ", L" : ""})`)); - } + addFacility(fcs.clinic); + addFacility(fcs.schoolroom); + addFacility(fcs.cellblock); if (V.incubator) { - const link = App.UI.DOM.passageLink(incubatorUIName(), "Incubator"); - const desc = `(${numberWithPluralOne(V.incubator - V.tanks.length, "empty tank")})`; + const inc = App.Entity.facilities.incubator; + const link = App.UI.DOM.passageLink(inc.UIName, "Incubator"); + const desc = `(${numberWithPluralOne(inc.capacity - V.tanks.length, "empty tank")})`; if (V.readySlaves > 0) { wrapper.append(createFacilityDiv(link, desc, App.UI.DOM.makeElement("span", "[!]", "noteworthy"))); diff --git a/src/arcologyBuilding/shops.js b/src/arcologyBuilding/shops.js index 96d6b106b784a637a681ac02408e27022e0345b1..6ba963794dca7d41a670451e86b419a2bb6a543b 100644 --- a/src/arcologyBuilding/shops.js +++ b/src/arcologyBuilding/shops.js @@ -38,22 +38,9 @@ App.Arcology.Cell.Shop = class extends App.Arcology.Cell.BaseCell { */ cellContent(path) { if (this.type === "Brothel") { - const fragment = document.createDocumentFragment(); - fragment.append( - App.UI.DOM.passageLink(brothelUIName(), "Brothel"), - ` (${V.BrothiIDs.length}/${V.brothel})`); - if (V.Madam) { - fragment.append(",L"); - } - return fragment; + return App.Arcology.facilityCellContent(App.Entity.facilities.brothel); } else if (this.type === "Club") { - const fragment = document.createDocumentFragment(); - fragment.append(App.UI.DOM.passageLink(clubUIName(), "Club"), - ` (${V.ClubiIDs.length}/${V.club})`); - if (V.DJ) { - fragment.append(",L"); - } - return fragment; + return App.Arcology.facilityCellContent(App.Entity.facilities.club); } else { return App.Arcology.getCellLink(path, this.type); } diff --git a/src/data/backwardsCompatibility/backwardsCompatibility.js b/src/data/backwardsCompatibility/backwardsCompatibility.js index e0cc74cc4b22c4f932cd36df641f1cfcf0ad14de..75ad567df681ed06f0a4869ed8673bb0b1ee391f 100644 --- a/src/data/backwardsCompatibility/backwardsCompatibility.js +++ b/src/data/backwardsCompatibility/backwardsCompatibility.js @@ -1170,6 +1170,7 @@ App.Update.slaveVariables = function(node) { V.slaves[bci] = Slave; } + V.slaveIndices = slaves2indices(); node.append(`Done!`); }; diff --git a/src/data/backwardsCompatibility/datatypeCleanup.js b/src/data/backwardsCompatibility/datatypeCleanup.js index a8374bc26de5f26850d183e837ef86a644f6e8cc..c08fd9325c4e8f783d7e131888154c81c562239a 100644 --- a/src/data/backwardsCompatibility/datatypeCleanup.js +++ b/src/data/backwardsCompatibility/datatypeCleanup.js @@ -2011,7 +2011,6 @@ globalThis.FacilityDatatypeCleanup = (function() { function FacilityDatatypeCleanup() { /* common variables */ - FacilityIDArrayCleanup(); FutureSocieties.DecorationCleanup(); FacilityNameCleanup(); /* facility specific variables */ @@ -2036,35 +2035,6 @@ globalThis.FacilityDatatypeCleanup = (function() { replaceSlaveStateWithId("Stud"); } - function FacilityIDArrayCleanup() { - function helperFunction(facilityIDArray) { - if (!Array.isArray(facilityIDArray)) { - return []; - } else if (typeof facilityIDArray[0] === "object") { - return facilityIDArray.map(a => a.ID); - } else { - const si = V.slaveIndices; - return facilityIDArray.filter(id => si.hasOwnProperty(id)); - } - } - - V.slaveIndices = slaves2indices(); - - V.BrothiIDs = helperFunction(V.BrothiIDs); - V.DairyiIDs = helperFunction(V.DairyiIDs); - V.ClubiIDs = helperFunction(V.ClubiIDs); - V.ServQiIDs = helperFunction(V.ServQiIDs); - V.SchlRiIDs = helperFunction(V.SchlRiIDs); - V.SpaiIDs = helperFunction(V.SpaiIDs); - V.CliniciIDs = helperFunction(V.CliniciIDs); - V.ArcadeiIDs = helperFunction(V.ArcadeiIDs); - V.CellBiIDs = helperFunction(V.CellBiIDs); - V.MastSiIDs = helperFunction(V.MastSiIDs); - V.HGSuiteiIDs = helperFunction(V.HGSuiteiIDs); - V.NurseryiIDs = helperFunction(V.NurseryiIDs); - V.FarmyardiIDs = helperFunction(V.FarmyardiIDs); - } - function FacilityNameCleanup() { V.arcologies[0].name = V.arcologies[0].name || "Arcology X-4"; V.brothelName = V.brothelName || "the Brothel"; diff --git a/src/endWeek/healthFunctions.js b/src/endWeek/healthFunctions.js index e912ced12c6856464456098f7851d72c1d550476..48ee559311dbc89d872029efb18817a11986db10 100644 --- a/src/endWeek/healthFunctions.js +++ b/src/endWeek/healthFunctions.js @@ -215,7 +215,7 @@ globalThis.nurseEffectiveness = function(slave) { const clinicScreening = 1; // Assumes the clinic is set to screening all slaves to improve their chances of staying healthy. Turning it off would allow the nurse to focus on just her patients in the clinic -- TODO if (V.Nurse !== 0) { const nurseSkill = setup.nurseCareers.includes(V.Nurse.career) ? 200 : V.Nurse.skill.nurse; - let nurseEffectiveness = Math.trunc((nurseSkill * clinicUpgrade / Math.max((V.CliniciIDs.length * 10 + (V.slaves.length * 2) * clinicScreening), 1)) * 20); + let nurseEffectiveness = Math.trunc((nurseSkill * clinicUpgrade / Math.max((App.Entity.facilities.clinic.employeesIDs().size * 10 + (V.slaves.length * 2) * clinicScreening), 1)) * 20); if (H.illness > 1 && slave.assignment === Job.CLINIC) { if (nurseEffectiveness < 20) { return nurseEffectiveness; diff --git a/src/endWeek/saInflation.js b/src/endWeek/saInflation.js index 41200196345695e8b7c001f6e7967d734874ba13..780937d0670cf0dcd3cfdfa2c5018a7c3c4c3d38 100644 --- a/src/endWeek/saInflation.js +++ b/src/endWeek/saInflation.js @@ -26,7 +26,7 @@ App.SlaveAssignment.inflation = (function() { gigantomastiaMod = slave.geneticQuirks.gigantomastia === 2 ? (slave.geneticQuirks.macromastia === 2 ? 3 : 2) : 1; rearLipedemaMod = slave.geneticQuirks.rearLipedema === 2 ? 2 : 0; rearLipedemaDivider = rearLipedemaMod === 0 ? 1 : rearLipedemaMod; - dairyL = V.DairyiIDs.length; + dairyL = App.Entity.facilities.dairy.employeesIDs().size; dupeTextFlag = 0; if (slave.inflationMethod === 3) { diff --git a/src/endWeek/saRules_old.js b/src/endWeek/saRules_old.js index 55a6355bc9e6a8946db1594d5fbc7d6498ab464b..43d0f3b6308d8838f8a0aa052217f6b37240ba86 100644 --- a/src/endWeek/saRules_old.js +++ b/src/endWeek/saRules_old.js @@ -292,14 +292,14 @@ if (!V.universalRulesConsent) { if (slave.devotion <= 20) { if (slave.trust > -10) { - if (V.NurseryiIDs.length > 2) { + if (App.Entity.facilities.nursery.employeesIDs().size > 2) { r += `Under the rules, ${he} finds ${himself} constantly molested by other slaves, and lives ${his} life constantly <span class="gold">afraid. </span>`; } else { r += `Under the rules, ${he} is free game for other slaves to molest, and lives ${his} life constantly <span class="gold">afraid</span> of the day another slave grabs ${him} from under the water. `; } slave.trust -= 2; } else { - if (V.NurseryiIDs.length > 2) { + if (App.Entity.facilities.nursery.employeesIDs().size > 2) { r += `Under the rules, ${he} finds ${himself} constantly molested by other slaves, but ${he}'s already in such constant terror it doesn't seriously affect ${him}. `; } else { r += `Under the rules, ${he} will someday find ${himself} constantly molested by other slaves, but ${he}'s already in such constant terror it that it doesn't cross ${his} mind. `; @@ -307,20 +307,20 @@ } } else if (release.slaves === 1) { if (slave.energy > 95) { - if (V.NurseryiIDs.length > 2) { + if (App.Entity.facilities.nursery.employeesIDs().size > 2) { r += `Under the rules, ${he}'s allowed to demand that other slaves get ${him} off, and ${he} <span class="hotpink">adores</span> you for providing plentiful outlets for ${his} nymphomania. `; } else { r += `Under the rules, ${he}'s allowed to demand that other slaves get ${him} off, and ${he} <span class="hotpink">eagerly awaits</span> the day ${V.Matron ? `more of your slaves join ${him} in ${V.nurseryName} ` : `you assign more nurses to ${V.nurseryName} to help ${him} relieve ${his} ${slave.balls ? `swollen balls` : `tension`}`}. `; // TODO: } } else if (slave.fetishKnown && slave.fetishStrength > 60) { if (slave.fetish === "sadist") { - if (V.NurseryiIDs.length > 2) { + if (App.Entity.facilities.nursery.employeesIDs().sizeh > 2) { r += `Under the rules, ${he}'s allowed to sexually abuse other slaves, and ${he} <span class="hotpink">adores</span> you for providing a whole nursery of slaves for ${him} to rape. `; } else { r += `Under the rules, ${he}'s allowed to sexually abuse other slaves, and ${he} <span class="hotpink">eagerly awaits</span> the day ${V.Matron ? `more of your slaves join ${him} in ${V.nurseryName}` : `you assign more nurses to ${V.nurseryName} to help ${him} unwind`}. `; } } else if (slave.fetish === "dom") { - if (V.NurseryiIDs.length > 2) { + if (App.Entity.facilities.nursery.employeesIDs().size > 2) { r += `Under the rules, ${he}'s allowed to force other slaves to have sex with ${him}, and ${he} <span class="hotpink">adores</span> you for providing a whole nursery of slaves for ${him} to dominate. `; } else { r += `Under the rules, ${he}'s allowed to force other slaves to have sex with ${him}, and ${he} <span class="hotpink">eagerly awaits</span> the day ${V.Matron ? `more of your slaves join ${him} in ${V.nurseryName}` : `you assign more nurses to ${V.nurseryName} to help ${him} unwind`}. `; @@ -331,7 +331,7 @@ } } else { if (slave.devotion <= 20 && slave.devotion > -20) { - if (V.NurseryiIDs.length > 2) { + if (App.Entity.facilities.nursery.employeesIDs().size > 2) { r += `Since ${he}'s low in the slave hierarchy, <span class="mediumaquamarine">${he} knows</span> that the rule that slaves must get consent before having sex with ${him} are all that protect ${him} from abuse. `; } else { r += `Since ${he}'s low in the slave hierarchy, <span class="mediumaquamarine">${he} knows</span> that the rule that slaves must get consent before having sex with ${him} are all that protect ${him} from abuse. Well, that and the fact ${V.nurseryName} is ${V.Matron ? `mostly frequented by other slaveowners' stock` : `${his} little private sanctuary`}. `; diff --git a/src/facilities/ads.js b/src/facilities/ads.js index 92b8cbd6e304be0e0e0ecf0d39930b2604492204..63def7e87a51661064f5821c76ac63bb851929cb 100644 --- a/src/facilities/ads.js +++ b/src/facilities/ads.js @@ -252,27 +252,16 @@ App.Ads.report = function(building, preview) { } let r = ``; - let ids; - if (building === "brothel") { - ids = "BrothiIDs"; - } else { - ids = (capFirstChar(building) + "iIDs"); - } - - const DL = V[ids].length; + /** @type {App.Entity.Facilities.Facility} */ + const facility = App.Entity.facilities[building]; + const DL = facility.employeesIDs().size; let adMgr = new App.Ads.AdManager(building); - for (let dI = 0; dI < DL; dI++) { - adMgr.tallySlave(V.slaves[V.slaveIndices[V[ids][dI]]]); - } - if (building === "brothel") { - if (V.Madam !== 0) { - adMgr.tallySlave(V.Madam); - } - } else if (building === "club") { - if (V.DJ !== 0) { - adMgr.tallySlave(V.DJ); - } + facility.employees().forEach(s => { + adMgr.tallySlave(s); + }); + if (facility.manager.currentEmployee) { + adMgr.tallySlave(facility.manager.currentEmployee); } let adCampaign = { diff --git a/src/facilities/dairy/dairyFramework.js b/src/facilities/dairy/dairyFramework.js index d2aa6a0af2894c84f8f21ca0693066e6fac8f348..b30c40cbca0f608ba12d2935a154e3ca36b0e70a 100644 --- a/src/facilities/dairy/dairyFramework.js +++ b/src/facilities/dairy/dairyFramework.js @@ -87,9 +87,9 @@ App.Entity.Facilities.Dairy = class extends App.Entity.Facilities.SingleJobFacil }); } - get hasFreeSpace() { - const dairySeed = V.bioreactorsXY + V.bioreactorsXX + V.bioreactorsHerm + V.bioreactorsBarren; - return this.capacity > this.hostedSlaves + dairySeed; + /** @override */ + get nonEmployeeOccupantsCount() { + return V.bioreactorsXY + V.bioreactorsXX + V.bioreactorsHerm + V.bioreactorsBarren; } }; diff --git a/src/facilities/farmyard/farmyard.tw b/src/facilities/farmyard/farmyard.tw index 943d081a97d5b7b82468a02a54a06508383d1a46..680ebf931323b75835f49250a7bde998cf36c507 100644 --- a/src/facilities/farmyard/farmyard.tw +++ b/src/facilities/farmyard/farmyard.tw @@ -10,7 +10,7 @@ <<set $farmyardNameCaps = $farmyardName.replace("the ", "The ")>> <</if>> -<<set _CL = $canines.length, _HL = $hooved.length, _FL = $felines.length, _FyL = $FarmyardiIDs.length>> +<<set _CL = $canines.length, _HL = $hooved.length, _FL = $felines.length, _FyL = App.Entity.facilities.farmyard.employeesIDs().size>> <p class="scene-intro"> $farmyardNameCaps is an oasis of growth in the midst of the jungle of steel and concrete that is $arcologies[0].name. Animals are kept in pens, tended to by your slaves, while <<if $farmyardUpgrade.hydroponics == 1>>rows of hydroponics equipment<<else>>makeshift fields<</if>> grow crops. <<switch $farmyardDecoration>> diff --git a/src/facilities/farmyard/farmyardReport.tw b/src/facilities/farmyard/farmyardReport.tw index e66a15a72ca353a7aaedb1ab0fdaa693cc206971..7fd9c29e8ec350591586763b79efa5a5d6dfa048 100644 --- a/src/facilities/farmyard/farmyardReport.tw +++ b/src/facilities/farmyard/farmyardReport.tw @@ -3,8 +3,8 @@ <span id="farmyardstats"> </span> -<<SlaveIDSort $FarmyardiIDs>> -<<set _DL = $FarmyardiIDs.length, _SL = $slaves.length, $FarmerCashBonus = 0, _FLsFetish = 0, _profits = 0, _foodWeek = 0>> +<<set _slaves = App.Utils.sortedEmployees(App.Entity.facilities.farmyard)>> +<<set _DL = _slaves.length, _SL = $slaves.length, $FarmerCashBonus = 0, _FLsFetish = 0, _profits = 0, _foodWeek = 0>> <<set $FarmerDevotionBonus = 1, $FarmerDevotionThreshold = 45, $FarmerTrustBonus = 1, $FarmerTrustThreshold = 35, $FarmerHealthBonus = 0>> /*<<set $legendaryWombID = 0>> TODO: will the Farmyard have a legendary womb system? */ @@ -101,29 +101,30 @@ <<set $FarmerCashBonus += 0.05>> <</if>> - <<for _dI = 0; _dI < _DL; _dI++>> - <<set $i = $slaveIndices[$FarmyardiIDs[_dI]]>> - <<setLocalPronouns $slaves[$i]>> - <<setLocalPronouns $Farmer 2>> - <<if $Farmer.rivalryTarget == $slaves[$i].ID>> + <<setLocalPronouns $Farmer 2>> + + <<for _slave range _slaves>> + <<set $i = $slaveIndices[_slave.ID]>> + <<setLocalPronouns _slave>> + <<if $Farmer.rivalryTarget == _slave.ID>> _He2 forces _his2 <<print rivalryTerm($Farmer)>> to service all the slaves in $farmyardName. /* TODO: not sure about this */ - <<set $slaves[$i].devotion -= 2, $slaves[$i].trust -= 2>> - <<if canDoVaginal($slaves[$i])>> - <<run seX($slaves[$i], "vaginal", "public", "penetrative", 10)>> + <<set _slave.devotion -= 2, _slave.trust -= 2>> + <<if canDoVaginal(_slave)>> + <<run seX(_slave, "vaginal", "public", "penetrative", 10)>> <</if>> - <<if canDoAnal($slaves[$i])>> - <<run seX($slaves[$i], "anal", "public", "penetrative", 10)>> + <<if canDoAnal(_slave)>> + <<run seX(_slave, "anal", "public", "penetrative", 10)>> <</if>> - <<run seX($slaves[$i], "oral", "public", "penetrative", 10)>> + <<run seX(_slave, "oral", "public", "penetrative", 10)>> <<if random(1,100) > 65>> - <<set $slaves[_FLs].rivalry++, $Farmer.rivalry++, $slaves[$i].rivalry++>> + <<set $slaves[_FLs].rivalry++, $Farmer.rivalry++, _slave.rivalry++>> <</if>> - <<elseif $Farmer.relationshipTarget == $slaves[$i].ID>> - _He2 dotes over _his2 <<print relationshipTerm($Farmer)>>, $slaves[$i].slaveName, making sure $he isn't worked too hard, but unfortunately manages to get in the way of $his work. - <<set $slaves[$i].devotion++, $FarmerCashBonus -= 0.05>> - <<elseif areRelated($Farmer, $slaves[$i])>> - _He2 pays special attention to _his2 <<print relativeTerm($Farmer.ID,$slaves[$i].ID)>>, $slaves[$i].slaveName, making sure $he is treated well and showing off $his skills. /* TODO: does this need rewriting? */ - <<set $slaves[$i].trust++, $FarmerCashBonus += 0.05>> + <<elseif $Farmer.relationshipTarget == _slave.ID>> + _He2 dotes over _his2 <<print relationshipTerm($Farmer)>>, _slave.slaveName, making sure $he isn't worked too hard, but unfortunately manages to get in the way of $his work. + <<set _slave.devotion++, $FarmerCashBonus -= 0.05>> + <<elseif areRelated($Farmer, _slave)>> + _He2 pays special attention to _his2 <<print relativeTerm($Farmer.ID,_slave.ID)>>, _slave.slaveName, making sure $he is treated well and showing off $his skills. /* TODO: does this need rewriting? */ + <<set _slave.trust++, $FarmerCashBonus += 0.05>> <</if>> <</for>> @@ -132,7 +133,7 @@ <<set $slavesGettingHelp = 0>> <<if $universalRulesFacilityWork == 1>> <<for $i = 0; $i < _SL; $i++>> - <<if ($slaves[$i].assignment == "farmhand")>> + <<if (_slave.assignment == "farmhand")>> <<set $slavesGettingHelp++>> <</if>> <</for>> @@ -195,40 +196,40 @@ <<if (_DL > 0)>> <<set _oldCash = $cash, _oldFood = $food>> - <<for _dI = 0; _dI < _DL; _dI++>> - <<set $i = $slaveIndices[$FarmyardiIDs[_dI]]>> - <<setLocalPronouns $slaves[$i]>> + <<for _slave range _slaves>> + <<set $i = $slaveIndices[_slave.ID]>> + <<setLocalPronouns _slave>> /* Perform facility based rule changes */ <<switch $farmyardDecoration>> <<case "Degradationist" "standard">> /* TODO: add the rest of the FS */ - <<set $slaves[$i].rules.living = "spare">> + <<set _slave.rules.living = "spare">> <<case "Roman Revivalist">> - <<set $slaves[$i].rules.living = "luxurious">> + <<set _slave.rules.living = "luxurious">> <<default>> - <<set $slaves[$i].rules.living = "normal">> + <<set _slave.rules.living = "normal">> <</switch>> /* TODO: should FS with "spare" living rules cause some minor health damage and devotion / trust loss? */ - <<if ($slaves[$i].health.condition < -80)>> - <<run improveCondition($slaves[$i], 20)>> - <<elseif $slaves[$i].health.condition < -40>> - <<run improveCondition($slaves[$i], 15)>> - <<elseif $slaves[$i].health.condition < 0>> - <<run improveCondition($slaves[$i], 10)>> - <<elseif $slaves[$i].health.condition < 90>> - <<run improveCondition($slaves[$i], 7)>> + <<if (_slave.health.condition < -80)>> + <<run improveCondition(_slave, 20)>> + <<elseif _slave.health.condition < -40>> + <<run improveCondition(_slave, 15)>> + <<elseif _slave.health.condition < 0>> + <<run improveCondition(_slave, 10)>> + <<elseif _slave.health.condition < 90>> + <<run improveCondition(_slave, 7)>> <</if>> - <<if ($slaves[$i].devotion <= 20) && ($slaves[$i].trust >= -20)>> - <<set $slaves[$i].devotion -= 5, $slaves[$i].trust -= 5>> - <<elseif ($slaves[$i].devotion < 45)>> - <<set $slaves[$i].devotion += 4>> - <<elseif ($slaves[$i].devotion > 50)>> - <<set $slaves[$i].devotion -= 4>> + <<if (_slave.devotion <= 20) && (_slave.trust >= -20)>> + <<set _slave.devotion -= 5, _slave.trust -= 5>> + <<elseif (_slave.devotion < 45)>> + <<set _slave.devotion += 4>> + <<elseif (_slave.devotion > 50)>> + <<set _slave.devotion -= 4>> <</if>> - <<if ($slaves[$i].trust < 30)>> - <<set $slaves[$i].trust += 5>> + <<if (_slave.trust < 30)>> + <<set _slave.trust += 5>> <</if>> - <<if $slaves[$i].energy > 40 && $slaves[$i].energy < 95>> - <<set $slaves[$i].energy++>> + <<if _slave.energy > 40 && _slave.energy < 95>> + <<set _slave.energy++>> <</if>> <<if $showEWD != 0>> @@ -236,42 +237,42 @@ /* 000-250-006 */ <<if $seeImages && $seeReportImages>> <div class="imageRef tinyImg"> - <<= SlaveArt($slaves[$i], 0, 0)>> + <<= SlaveArt(_slave, 0, 0)>> </div> <</if>> /* 000-250-006 */ - <span class='slave-name'><<= SlaveFullName($slaves[$i])>></span> - <<if $slaves[$i].choosesOwnAssignment == 2>> + <span class='slave-name'><<= SlaveFullName(_slave)>></span> + <<if _slave.choosesOwnAssignment == 2>> <<include "SA chooses own job">> <<else>> is working out of $farmyardName. <</if>> - <br> $He <<= App.SlaveAssignment.workTheFarm($slaves[$i])>> + <br> $He <<= App.SlaveAssignment.workTheFarm(_slave)>> <br> - <<= App.SlaveAssignment.choosesOwnClothes($slaves[$i])>> + <<= App.SlaveAssignment.choosesOwnClothes(_slave)>> <<include "SA rules">> <<include "SA diet">> <<include "SA long term effects">> - <<= App.SlaveAssignment.drugs($slaves[$i])>> + <<= App.SlaveAssignment.drugs(_slave)>> <<include "SA relationships">> <<include "SA rivalries">> <br><<include "SA devotion">> <<else>> <<silently>> <<include "SA chooses own job">> - <<run App.SlaveAssignment.workTheFarm($slaves[$i])>> - <<run App.SlaveAssignment.choosesOwnClothes($slaves[$i])>> + <<run App.SlaveAssignment.workTheFarm(_slave)>> + <<run App.SlaveAssignment.choosesOwnClothes(_slave)>> <<include "SA rules">> <<include "SA diet">> <<include "SA long term effects">> - <<run App.SlaveAssignment.drugs($slaves[$i])>> + <<run App.SlaveAssignment.drugs(_slave)>> <<include "SA relationships">> <<include "SA rivalries">> <<include "SA devotion">> <</silently>> <</if>> <span id="showProfits"> - <<set _incomeStats = getSlaveStatisticData($slaves[$i], $slaves[$i].assignment === Job.FARMYARD ? $facility.farmyard : undefined)>> + <<set _incomeStats = getSlaveStatisticData(_slave, _slave.assignment === Job.FARMYARD ? $facility.farmyard : undefined)>> <<set _profits += _incomeStats.income>> </span> diff --git a/src/facilities/farmyard/farmyardWidgets.js b/src/facilities/farmyard/farmyardWidgets.js index ffc73869fd1edac93645b8bccfe5fd533e464e76..c14d77c0ee1a5921845b31ece154cf251bb146c8 100644 --- a/src/facilities/farmyard/farmyardWidgets.js +++ b/src/facilities/farmyard/farmyardWidgets.js @@ -4,7 +4,7 @@ App.Facilities.Farmyard.farmyardReport = () => { const slaves = V.slaves, Farmer = V.Farmer, - FL = V.FarmyardiIDs.length; + FL = App.Entity.facilities.farmyard.employeesIDs().size; let t = ``, @@ -122,18 +122,16 @@ App.Facilities.Farmyard.farmyardReport = () => { }; - const farmerRelationshipSlaves = (length, Farmer) => { - for (let i = length; i--;) { - const - s = V.slaveIndices[V.FarmyardiIDs[i]], - slave = V.slaves[s], - p = getPronouns(Farmer); + /** @param {App.Entity.SlaveState} Farmer */ + function farmerRelationshipSlaves(Farmer) { + const p = getPronouns(Farmer); + for (const slave of App.Utils.sortedEmployees(App.Entity.facilities.farmyard)) { let t = ``; if (Farmer.rivalryTarget === slave.ID) { t += `${p.He} forces ${p.his} ${rivalryTerm(Farmer)} to service all the slaves in ${V.farmyardName}. `; // TODO: not sure about this - slave.devotion -= 2; slaves.trust -= 2; + slave.devotion -= 2; slave.trust -= 2; if (canDoVaginal(slave)) { seX(slave, 'vaginal', 'public', 'penetrative', 10); } @@ -148,13 +146,13 @@ App.Facilities.Farmyard.farmyardReport = () => { t += `${p.He} dotes over ${p.his} ${relationshipTerm(Farmer)}, ${slave.slaveName}, making sure ${he} isn't worked too hard, but unfortunately manages to get in the way of ${his} work. `; slave.devotion++; } else if (areRelated(Farmer, slave)) { - t += `${p.He} pays special attention to ${p.his} ${relativeTerm(Farmer.ID, slave.ID)}, ${slave.slaveName}, making sure ${he} is treated well and showing off ${his} skills. `; + t += `${p.He} pays special attention to ${p.his} ${relativeTerm(Farmer, slave)}, ${slave.slaveName}, making sure ${he} is treated well and showing off ${his} skills. `; slave.trust++; } return t; } - }; + } const farmerWorks = slave => { let @@ -405,9 +403,6 @@ App.Facilities.Farmyard.farmyardReport = () => { const farmyardStatsDisplay = () => `<<FarmyardStatistics 0>><<timed 50ms>><<replace #farmyardstats>><<FarmyardStatistics 1>><</replace>><</timed>>`; t += `<span id="farmyardstats"></span>`; - SlaveSort.IDs(V.FarmyardiIDs); // TODO: not sure if I called this correctly - - // MAIN LOOP @@ -429,7 +424,7 @@ App.Facilities.Farmyard.farmyardReport = () => { t += farmerIntelligence(Farmer); t += farmerDick(Farmer); t += farmerSmell(Farmer); - t += farmerRelationshipSlaves(FL, Farmer); + t += farmerRelationshipSlaves(Farmer); t += farmerWorks(Farmer); } @@ -443,9 +438,8 @@ App.Facilities.Farmyard.farmyardReport = () => { let oldCash = V.cash, oldFood = V.food; - for (let i = FL; i--;) { - V.i = V.slaveIndices[V.FarmyardiIDs[i]]; - const slave = slaves[V.i]; + for (const slave of App.Utils.sortedEmployees(App.Entity.facilities.farmyard)) { + V.i = V.slaveIndices[slave.ID]; ({ he, him, his, hers, himself, girl, He, His, loli diff --git a/src/facilities/nursery/nursery.tw b/src/facilities/nursery/nursery.tw index 57fd9578edac1a0ca8a6dc35faf9184da6b0b9d5..25a9c31733733c934c8323f1a26fbf5bb4e4558a 100644 --- a/src/facilities/nursery/nursery.tw +++ b/src/facilities/nursery/nursery.tw @@ -8,7 +8,7 @@ <<set $nurseryNameCaps = $nurseryName.replace("the ", "The ")>> <</if>> -<<set $readyChildren = 0, $nurseryBabies = $cribs.length, $freeCribs = $nursery - $nurseryBabies, _NL = $NurseryiIDs.length, _SL = $slaves.length, _eligibility = 0, $reservedChildren = FetusGlobalReserveCount("incubator"), $reservedChildrenNursery = FetusGlobalReserveCount("nursery")>> +<<set $readyChildren = 0, $nurseryBabies = $cribs.length, $freeCribs = $nursery - $nurseryBabies, _NL = App.Entity.facilities.nursery.employeesIDs().size, _SL = $slaves.length, _eligibility = 0, $reservedChildren = FetusGlobalReserveCount("incubator"), $reservedChildrenNursery = FetusGlobalReserveCount("nursery")>> <p class=scene-intro"> $nurseryNameCaps <<switch $nurseryDecoration>> diff --git a/src/facilities/nursery/nurseryWidgets.js b/src/facilities/nursery/nurseryWidgets.js index d33e5cbd3a39c8112fa0e4005f0b0e0b87093369..c1a0a5648a758e79457385fd55d7db4412bb568b 100644 --- a/src/facilities/nursery/nurseryWidgets.js +++ b/src/facilities/nursery/nurseryWidgets.js @@ -17668,7 +17668,7 @@ App.Facilities.Nursery.childrenReport = function childrenReport() { const Matron = V.Matron, - NL = V.NurseryiIDs.length, + NL = App.Entity.facilities.nursery.employeesIDs().size, CL = V.cribs.length; let @@ -17800,10 +17800,7 @@ App.Facilities.Nursery.childrenReport = function childrenReport() { } if (NL > 0) { - for (let j = 0; j < NL; j++) { - const - slave = getSlave(V.NurseryiIDs[j]); - + for (const slave of App.Utils.sortedEmployees(App.Entity.facilities.nursery)) { if (slave.fetish !== "none") { if (chance > 85) { if (child.fetish === "none") { @@ -17904,28 +17901,31 @@ App.Facilities.Nursery.childrenReport = function childrenReport() { if (NL > 0) { let - averageIntelligence, - averageIntelligenceImplant; + averageIntelligence = 0, + averageIntelligenceImplant = 0; - for (let j = 0; j < NL; j++) { - averageIntelligence += V.slaves[V.slaveIndices[NurseryiIDs[j]]].intelligence; - averageIntelligenceImplant += V.slaves[V.slaveIndices[NurseryiIDs[j]]].intelligenceImplant; + const nannies = App.Entity.facilities.nursery.employees(); + for (const nanny of nannies) { + averageIntelligence += nanny.intelligence; + averageIntelligenceImplant += nanny.intelligenceImplant; } + const firstNanny = nannies[0]; + averageIntelligence = averageIntelligence / NL; averageIntelligenceImplant = averageIntelligenceImplant / NL; if (averageIntelligence + averageIntelligenceImplant > 65) { - r += `${NL > 1 ? `The nannies are mostly` : `${V.slaves[V.slaveIndices[NurseryiIDs[j]]].slaveName} is`} very intelligent and well educated and are able to teach ${CL > 1 ? `the children` : child.slaveName} very effectively. `; + r += `${NL > 1 ? `The nannies are mostly` : `${firstNanny.slaveName} is`} very intelligent and well educated and are able to teach ${CL > 1 ? `the children` : child.slaveName} very effectively. `; child.intelligenceImplant += 3; } else if (averageIntelligence > 50) { - r += `${NL > 1 ? `The nannies are mostly` : `${V.slaves[V.slaveIndices[NurseryiIDs[j]]].slaveName} is`} very intelligent and able to teach ${CL > 1 ? `the children` : child.slaveName} quite effectively. `; + r += `${NL > 1 ? `The nannies are mostly` : `${firstNanny.slaveName} is`} very intelligent and able to teach ${CL > 1 ? `the children` : child.slaveName} quite effectively. `; child.intelligenceImplant += 2; } else if (averageIntelligenceImplant > 25) { - r += `${NL > 1 ? `The nannies are mostly` : `${V.slaves[V.slaveIndices[NurseryiIDs[j]]].slaveName} is`} very well educated and able to teach ${CL > 1 ? `the children` : child.slaveName} quite effectively. `; + r += `${NL > 1 ? `The nannies are mostly` : `${firstNanny.slaveName} is`} very well educated and able to teach ${CL > 1 ? `the children` : child.slaveName} quite effectively. `; child.intelligenceImplant += 2; } else if (averageIntelligenceImplant > 15) { - r += `${NL > 1 ? `The nannies are mostly` : `${V.slaves[V.slaveIndices[NurseryiIDs[j]]].slaveName} is`} well educated and able to teach ${CL > 1 ? `the children` : child.slaveName} fairly effectively. `; + r += `${NL > 1 ? `The nannies are mostly` : `${firstNanny.slaveName} is`} well educated and able to teach ${CL > 1 ? `the children` : child.slaveName} fairly effectively. `; child.intelligenceImplant++; } } @@ -18007,6 +18007,7 @@ App.Facilities.Nursery.childrenReport = function childrenReport() { // TODO: rework these entirely if (Matron || NL) { if (V.nurseryWeight) { + const firstNanny = NL > 0 ? App.Entity.facilities.nursery.employees()[0] : null; r += `<br>`; if (V.nurseryWeightSetting === 1) { if (child.weight < 200) { @@ -18016,10 +18017,10 @@ App.Facilities.Nursery.childrenReport = function childrenReport() { } else if (V.nurseryWeightSetting === 2) { if (child.weight > 10) { child.weight--; - r += `${Matron ? Matron.slaveName : NL > 1 ? `A nanny` : V.slaves[V.slaveIndices[NurseryiIDs[j]]].slaveName} notices ${he} is overweight and <span class="green">decreases the amount of food ${he} eats.</span> `; + r += `${Matron ? Matron.slaveName : NL > 1 ? `A nanny` : firstNanny.slaveName} notices ${he} is overweight and <span class="green">decreases the amount of food ${he} eats.</span> `; } else if (child.weight <= -10) { child.weight++; - r += `${Matron ? Matron.slaveName : NL > 1 ? `A nanny` : V.slaves[V.slaveIndices[NurseryiIDs[j]]].slaveName} notices ${he} is underweight and <span class="green">increases the amount of food ${he} eats.</span> `; + r += `${Matron ? Matron.slaveName : NL > 1 ? `A nanny` : firstNanny.slaveName} notices ${he} is underweight and <span class="green">increases the amount of food ${he} eats.</span> `; } else { r += `${He} is <span class="lime">currently a healthy weight;</span> efforts will be made to maintain it. `; } @@ -18043,11 +18044,11 @@ App.Facilities.Nursery.childrenReport = function childrenReport() { if (child.muscles < 100) { child.muscles += 5; } - r += `${Matron ? Matron : NL > 1 ? `A nanny` : V.slaves[V.slaveIndices[NurseryiIDs[j]]].slaveName} notices ${he} is overly muscular and <span class="green">decreases ${his} steroid dosage.</span> `; + r += `${Matron ? Matron : NL > 1 ? `A nanny` : firstNanny.slaveName} notices ${he} is overly muscular and <span class="green">decreases ${his} steroid dosage.</span> `; } else if (V.nurseryMusclesSetting === 1) { if (child.muscles > 10) { child.muscles--; - r += `${Matron ? Matron : NL > 1 ? `A nanny` : V.slaves[V.slaveIndices[NurseryiIDs[j]]].slaveName} notices ${he} is weak and <span class="green">increases ${his} steroid dosage.</span> `; + r += `${Matron ? Matron : NL > 1 ? `A nanny` : firstNanny.slaveName} notices ${he} is weak and <span class="green">increases ${his} steroid dosage.</span> `; } else if (child.muscles < -10) { child.muscles++; r += `${He} has <span class="lime">a healthy musculature;</span> efforts will be made to maintain it. `; @@ -18086,7 +18087,7 @@ App.Facilities.Nursery.nurseryReport = function nurseryReport() { arcology = V.arcologies[0]; let - NL = V.NurseryiIDs.length, + NL = App.Utils.jobForAssignment(Job.NURSERY).employeesIDs().size, healthBonus = 0, trustBonus = 0, idleBonus = 0, @@ -18243,10 +18244,7 @@ App.Facilities.Nursery.nurseryReport = function nurseryReport() { } } - for (let dI = 0; dI < NL; dI++) { - const - slave = getSlave(V.NurseryiIDs[dI]); - + for (const slave of App.Utils.sortedEmployees(App.Utils.jobForAssignment(Job.NURSERY))) { V.i = V.slaveIndices[slave.ID]; slave.devotion += devBonus, slave.trust += trustBonus; diff --git a/src/facilities/penthouse/penthouseFramework.js b/src/facilities/penthouse/penthouseFramework.js index f0b464b060039792bebb9b156ac7d67eabd71254..eda7ec72303d74df837974a4a3859671b8083872 100644 --- a/src/facilities/penthouse/penthouseFramework.js +++ b/src/facilities/penthouse/penthouseFramework.js @@ -1,6 +1,6 @@ App.Data.Facilities.penthouse = { - baseName: "", + baseName: "penthouse", genericName: "Penthouse", jobs: { rest: { @@ -182,7 +182,7 @@ App.Entity.Facilities.Penthouse = class extends App.Entity.Facilities.Facility { } /** Facility slave capacity - * @returns {number} */ + * @returns {number} */ get capacity() { return V.dormitory; } diff --git a/src/facilities/pit/pitFramework.js b/src/facilities/pit/pitFramework.js index f0d6be5a636bb9ebc5f4b572381eb5c6609ae12a..bac95c22fe173666f8675c8b6d08b0f79941cb4e 100644 --- a/src/facilities/pit/pitFramework.js +++ b/src/facilities/pit/pitFramework.js @@ -32,10 +32,6 @@ App.Entity.Facilities.PitFighterJob = class extends App.Entity.Facilities.Facili } return r; } - - isEmployed(slave) { - return this.employeesIds().includes(slave.ID); - } }; App.Entity.Facilities.Pit = class extends App.Entity.Facilities.SingleJobFacility { diff --git a/src/gui/storyCaption.tw b/src/gui/storyCaption.tw index 22a5317b56705546419fce7af09f10170a2efe5b..2df3634e36094469d20f45724e3e0eef6069ae91 100644 --- a/src/gui/storyCaption.tw +++ b/src/gui/storyCaption.tw @@ -313,12 +313,13 @@ <</if>> <<if _Pass == "Main" && $newModelUI == 0>> + <<set _L = App.Utils.countFacilityWorkers()>> <<if ($HGSuite)>> <br> <<link "$HGSuiteNameCaps""Head Girl Suite">><</link>> <<if $abbreviateSidebar == 2>> - <<if $HeadGirl != 0>>(HG<<if $HGSuiteiIDs.length > 0>>, 1)<<else>>)<</if>><</if>> + <<if $HeadGirl != 0>>(HG<<if _L.HGSuite > 0>>, 1)<<else>>)<</if>><</if>> <<else>> - <<if $HeadGirl != 0>>(HG<<if $HGSuiteiIDs.length > 0>> and slave<<else>>)<</if>><</if>> + <<if $HeadGirl != 0>>(HG<<if _L.HGSuite > 0>> and slave<<else>>)<</if>><</if>> <</if>> <</if>> <<if ($dojo > 1)>> @@ -331,103 +332,103 @@ <<if ($brothel)>> <br> <<link "$brothelNameCaps""Brothel">><</link>> <<if $abbreviateSidebar == 2>> - ($BrothiIDs.length/<<= $brothel>> whores<<if $Madam>>, madam<</if>>) + (_L.brothel/<<= $brothel>> whores<<if $Madam>>, madam<</if>>) <<else>> - ($BrothiIDs.length/<<= $brothel>><<if $Madam>>, L<</if>>) + (_L.brothel/<<= $brothel>><<if $Madam>>, L<</if>>) <</if>> <</if>> <<if ($club)>> <br> <<link "$clubNameCaps""Club">><</link>> <<if $abbreviateSidebar == 2>> - ($ClubiIDs.length/<<= $club>> sluts<<if $DJ>>, DJ<</if>>) + (_L.club/<<= $club>> sluts<<if $DJ>>, DJ<</if>>) <<else>> - ($ClubiIDs.length/<<= $club>><<if $DJ>>, L<</if>>) + (_L.club/<<= $club>><<if $DJ>>, L<</if>>) <</if>> <</if>> <<if ($arcade)>> <br> <<link "$arcadeNameCaps""Arcade">><</link>> <<if $abbreviateSidebar == 2>> - ($ArcadeiIDs.length/<<= $arcade>> inmates) + (_L.arcade/<<= $arcade>> inmates) <<else>> - ($ArcadeiIDs.length/<<= $arcade>>) + (_L.arcade/<<= $arcade>>) <</if>> <</if>> <<if ($dairy)>> <br> <<link "$dairyNameCaps""Dairy">><</link>> <<set _SCapT9 = $bioreactorsXY+$bioreactorsXX+$bioreactorsHerm+$bioreactorsBarren>> <<if $abbreviateSidebar == 2>> - ($DairyiIDs.length<<if _SCapT9>>+_SCapT9<</if>>/<<= $dairy>> cows<<if $Milkmaid>>, milkmaid<</if>>) + (_L.dairy<<if _SCapT9>>+_SCapT9<</if>>/<<= $dairy>> cows<<if $Milkmaid>>, milkmaid<</if>>) <<else>> - ($DairyiIDs.length<<if _SCapT9>>+_SCapT9<</if>>/<<= $dairy>><<if $Milkmaid>>, L<</if>>) + (_L.dairy<<if _SCapT9>>+_SCapT9<</if>>/<<= $dairy>><<if $Milkmaid>>, L<</if>>) <</if>> <</if>> <<if ($farmyard)>> <br> <<link "$farmyardNameCaps""Farmyard">><</link>> <<if $abbreviateSidebar == 2>> - ($FarmyardiIDs.length/$farmyard farmhands<<if $Farmer>>, farmer<</if>>) + (_L.farmyard/$farmyard farmhands<<if $Farmer>>, farmer<</if>>) <<else>> - ($FarmyardiIDs.length/$farmyard<<if $Farmer>>, L<</if>>) + (_L.farmyard/$farmyard<<if $Farmer>>, L<</if>>) <</if>> <</if>> <<if ($servantsQuarters)>> <br> <<link "$servantsQuartersNameCaps""Servants' Quarters">><</link>> <<if $abbreviateSidebar == 2>> - ($ServQiIDs.length/$servantsQuarters servants<<if $Stewardess>>, stewardess<</if>>) + (_L.servantsQuarters/$servantsQuarters servants<<if $Stewardess>>, stewardess<</if>>) <<else>> - ($ServQiIDs.length/$servantsQuarters<<if $Stewardess>>, L<</if>>) + (_L.servantsQuarters/$servantsQuarters<<if $Stewardess>>, L<</if>>) <</if>> <</if>> <<if ($masterSuite)>> <br> <<link "$masterSuiteNameCaps""Master Suite">><</link>> <<if $abbreviateSidebar == 2>> - ($MastSiIDs.length/$masterSuite <<if $MastSiIDs.length != 1>>fucktoys<<else>>fucktoy<</if>><<if $Concubine>>, Concubine<</if>>) + (_L.masterSuite/$masterSuite <<if _L.masterSuite != 1>>fucktoys<<else>>fucktoy<</if>><<if $Concubine>>, Concubine<</if>>) <<else>> - ($MastSiIDs.length/$masterSuite<<if $Concubine>>, C<</if>>) + (_L.masterSuite/$masterSuite<<if $Concubine>>, C<</if>>) <</if>> <</if>> <<if ($schoolroom)>> <br> <<link "$schoolroomNameCaps""Schoolroom">><</link>> <<if $abbreviateSidebar == 2>> - ($SchlRiIDs.length/$schoolroom <<if $SchlRiIDs.length != 1>>students<<else>>student<</if>><<if $Schoolteacher>>, schoolteacher<</if>>) + (_L.schoolroom/$schoolroom <<if _L.schoolroom != 1>>students<<else>>student<</if>><<if $Schoolteacher>>, schoolteacher<</if>>) <<else>> - ($SchlRiIDs.length/$schoolroom<<if $Schoolteacher>>, L<</if>>) + (_L.schoolroom/$schoolroom<<if $Schoolteacher>>, L<</if>>) <</if>> <</if>> <<if ($spa)>> <br> <<link "$spaNameCaps""Spa">><</link>> <<if $abbreviateSidebar == 2>> - ($SpaiIDs.length/$spa <<if $SpaiIDs.length != 1>>bathers<<else>>bathing<</if>><<if _S.Attendant>>, attendant<</if>>) + (_L.spa/$spa <<if _L.spa != 1>>bathers<<else>>bathing<</if>><<if _S.Attendant>>, attendant<</if>>) <<else>> - ($SpaiIDs.length/$spa<<if _S.Attendant>>, L<</if>>) + (_L.spa/$spa<<if _S.Attendant>>, L<</if>>) <</if>> <</if>> <<if ($nursery)>> <br> <<link "$nurseryNameCaps""Nursery">><</link>> <<if $abbreviateSidebar == 2>> - (<<if $nursery-$nurseryBabies == 0>>No empty rooms<<elseif $nursery-$nurseryBabies == 1>>1 empty room<<else>><<= $nursery-$nurseryBabies>> empty rooms<</if>>, $NurseryiIDs.length/$nurseryNannies <<if $NurseryiIDs.length != 1>>nannies<<else>>nanny<</if>><<if $Matron>>, attendant<</if>>) + (<<if $nursery-$nurseryBabies == 0>>No empty rooms<<elseif $nursery-$nurseryBabies == 1>>1 empty room<<else>><<= $nursery-$nurseryBabies>> empty rooms<</if>>, _L.nursery/$nurseryNannies <<if _L.nursery != 1>>nannies<<else>>nanny<</if>><<if $Matron>>, attendant<</if>>) <<else>> - ($nurseryBabies/$nursery, $NurseryiIDs.length/$nurseryNannies<<if $Matron>>, L<</if>>) + ($nurseryBabies/$nursery, _L.nursery/$nurseryNannies<<if $Matron>>, L<</if>>) <</if>> <</if>> <<if ($clinic)>> <br> <<link "$clinicNameCaps""Clinic">><</link>> <<if $abbreviateSidebar == 2>> - ($CliniciIDs.length/$clinic <<if $CliniciIDs.length != 1>>patients<<else>>patient<</if>><<if $Nurse>>, nurse<</if>>) + (_L.clinic/$clinic <<if _L.clinic != 1>>patients<<else>>patient<</if>><<if $Nurse>>, nurse<</if>>) <<else>> - ($CliniciIDs.length/$clinic<<if $Nurse>>, L<</if>>) + (_L.clinic/$clinic<<if $Nurse>>, L<</if>>) <</if>> <</if>> <<if ($cellblock)>> <br> <<link "$cellblockNameCaps""Cellblock">><</link>> <<if $abbreviateSidebar == 2>> - ($CellBiIDs.length/$cellblock <<if $CellBiIDs.length != 1>>prisoners<<else>>prisoner<</if>><<if $Wardeness>>, wardeness<</if>>) + (_L.cellblock/$cellblock <<if _L.cellblock != 1>>prisoners<<else>>prisoner<</if>><<if $Wardeness>>, wardeness<</if>>) <<else>> - ($CellBiIDs.length/$cellblock<<if $Wardeness>>, L<</if>>) + (_L.cellblock/$cellblock<<if $Wardeness>>, L<</if>>) <</if>> <</if>> diff --git a/src/js/assignJS.js b/src/js/assignJS.js index 4a6da40cbfc55890ba8c2db785077418d7475bd9..73511017d46162f64bf08ef1e8e1c036f34e8802 100644 --- a/src/js/assignJS.js +++ b/src/js/assignJS.js @@ -13,9 +13,12 @@ globalThis.assignJob = function(slave, job) { // handle non-exclusive pseudo-assignments as special cases if (job === Job.PIT) { V.fighterIDs.push(slave.ID); + V.JobIDMap[this.Job.PIT].add(slave.ID); return r; } else if (job === Job.LURCHER) { V.LurcherID = slave.ID; + V.JobIDMap[this.Job.LURCHER].clear(); + V.JobIDMap[this.Job.LURCHER].add(slave.ID); return r; } @@ -77,7 +80,6 @@ globalThis.assignJob = function(slave, job) { case Job.ARCADE.toLowerCase(): case "arcade": slave.assignment = Job.ARCADE; - V.ArcadeiIDs.push(slave.ID); if (slave.clothes !== "a fuckdoll suit") { slave.clothes = "no clothing"; } @@ -89,7 +91,6 @@ globalThis.assignJob = function(slave, job) { case Job.BROTHEL.toLowerCase(): case "brothel": slave.assignment = Job.BROTHEL; - V.BrothiIDs.push(slave.ID); switch (V.brothelDecoration) { case "Degradationist": case "standard": @@ -104,7 +105,6 @@ globalThis.assignJob = function(slave, job) { case Job.CELLBLOCK.toLowerCase(): case "cellblock": slave.assignment = Job.CELLBLOCK; - V.CellBiIDs.push(slave.ID); switch (V.cellblockDecoration) { case "Paternalist": slave.rules.living = "normal"; @@ -118,7 +118,6 @@ globalThis.assignJob = function(slave, job) { case Job.CLINIC.toLowerCase(): case "clinic": slave.assignment = Job.CLINIC; - V.CliniciIDs.push(slave.ID); switch (V.clinicDecoration) { case "Repopulation Focus": case "Eugenics": @@ -154,14 +153,12 @@ globalThis.assignJob = function(slave, job) { case Job.CLUB.toLowerCase(): case "club": slave.assignment = Job.CLUB; - V.ClubiIDs.push(slave.ID); slave.rules.living = "normal"; break; case Job.DAIRY.toLowerCase(): case "dairy": slave.assignment = Job.DAIRY; - V.DairyiIDs.push(slave.ID); switch (V.dairyDecoration) { case "Roman Revivalist": case "Aztec Revivalist": @@ -184,7 +181,6 @@ globalThis.assignJob = function(slave, job) { case Job.FARMYARD.toLowerCase(): case "farmyard": slave.assignment = Job.FARMYARD; - V.FarmyardiIDs.push(slave.ID); switch (V.farmyardDecoration) { case "Aztec Revivalist": case "Chinese Revivalist": @@ -210,7 +206,6 @@ globalThis.assignJob = function(slave, job) { case "head girl suite": case "hgsuite": slave.assignment = Job.HEADGIRLSUITE; - V.HGSuiteiIDs.push(slave.ID); slave.rules.living = "luxurious"; break; @@ -218,7 +213,6 @@ globalThis.assignJob = function(slave, job) { case "master suite": case "mastersuite": slave.assignment = Job.MASTERSUITE; - V.MastSiIDs.push(slave.ID); if (V.masterSuiteUpgradeLuxury > 0) { slave.rules.living = "luxurious"; } else { @@ -229,7 +223,6 @@ globalThis.assignJob = function(slave, job) { case Job.SCHOOL.toLowerCase(): case "schoolroom": slave.assignment = Job.SCHOOL; - V.SchlRiIDs.push(slave.ID); slave.rules.living = "normal"; break; @@ -237,7 +230,6 @@ globalThis.assignJob = function(slave, job) { case "servants' quarters": case "servantsquarters": slave.assignment = Job.QUARTER; - V.ServQiIDs.push(slave.ID); switch (V.servantsQuartersDecoration) { case "Roman Revivalist": case "Aztec Revivalist": @@ -275,7 +267,6 @@ globalThis.assignJob = function(slave, job) { case Job.SPA.toLowerCase(): case "spa": slave.assignment = Job.SPA; - V.SpaiIDs.push(slave.ID); switch (V.spaDecoration) { case "Chattel Religionist": case "Chinese Revivalist": @@ -293,78 +284,77 @@ globalThis.assignJob = function(slave, job) { case Job.NURSERY.toLowerCase(): case "nursery": slave.assignment = Job.NURSERY; - V.NurseryiIDs.push(slave.ID); slave.rules.living = "normal"; break; case Job.ATTENDANT.toLowerCase(): uniqueJob("Attendant"); - slave.assignment = job; + slave.assignment = Job.ATTENDANT; slave.rules.living = "luxurious"; break; case Job.MATRON.toLowerCase(): uniqueJob("Matron"); - slave.assignment = job; + slave.assignment = Job.MATRON; slave.rules.living = "luxurious"; break; case Job.DJ.toLowerCase(): uniqueJob("DJ"); - slave.assignment = job; + slave.assignment = Job.DJ; slave.rules.living = "luxurious"; break; case Job.MADAM.toLowerCase(): uniqueJob("Madam"); - slave.assignment = job; + slave.assignment = Job.MADAM; slave.rules.living = "luxurious"; break; case Job.MILKMAID.toLowerCase(): uniqueJob("Milkmaid"); - slave.assignment = job; + slave.assignment = Job.MILKMAID; slave.rules.living = "luxurious"; break; case Job.FARMER.toLowerCase(): uniqueJob("Farmer"); - slave.assignment = job; + slave.assignment = Job.FARMER; slave.rules.living = "luxurious"; break; case Job.NURSE.toLowerCase(): uniqueJob("Nurse"); - slave.assignment = job; + slave.assignment = Job.NURSE; slave.rules.living = "luxurious"; break; case Job.TEACHER.toLowerCase(): uniqueJob("Schoolteacher"); - slave.assignment = job; + slave.assignment = Job.TEACHER; slave.rules.living = "luxurious"; break; case Job.STEWARD.toLowerCase(): uniqueJob("Stewardess"); - slave.assignment = job; + slave.assignment = Job.STEWARD; slave.rules.living = "luxurious"; break; case Job.WARDEN.toLowerCase(): uniqueJob("Wardeness"); - slave.assignment = job; + slave.assignment = Job.WARDEN; slave.rules.living = "luxurious"; break; case Job.RECRUITER: uniqueJob("Recruiter"); - slave.assignment = job; + slave.assignment = Job.RECRUITER; break; case Job.CONCUBINE.toLowerCase(): uniqueJob("Concubine"); - slave.assignment = job; + slave.assignment = Job.CONCUBINE; if (V.masterSuiteUpgradeLuxury > 0) { slave.rules.living = "luxurious"; } else { @@ -374,7 +364,7 @@ globalThis.assignJob = function(slave, job) { case Job.HEADGIRL.toLowerCase(): uniqueJob("HeadGirl"); - slave.assignment = job; + slave.assignment = Job.HEADGIRL; if (V.HGSuite === 1) { slave.rules.living = "luxurious"; } @@ -383,7 +373,7 @@ globalThis.assignJob = function(slave, job) { case Job.BODYGUARD.toLowerCase(): uniqueJob("Bodyguard"); - slave.assignment = job; + slave.assignment = Job.BODYGUARD; if (V.dojo > 1) { slave.rules.living = "luxurious"; } @@ -412,6 +402,8 @@ globalThis.assignJob = function(slave, job) { break; } + V.JobIDMap[slave.assignment].add(slave.ID); + if (!assignmentVisible(slave) && Array.isArray(V.personalAttention)) { if (V.personalAttention.deleteWith(s => s.ID === slave.ID).length > 0) { if (V.personalAttention.length === 0) { @@ -428,7 +420,7 @@ globalThis.assignJob = function(slave, job) { } } } - V.JobIDArray = makeJobIdMap(); + // maybe recreate it each time? V.JobIDArray = makeJobIdMap(); if (idx >= 0) { V.slaves[idx] = slave; } return r; @@ -478,9 +470,17 @@ globalThis.removeJob = function(slave, assignment, saveRecord = false) { if (assignment === Job.PIT) { V.fighterIDs.delete(slave.ID); + V.JobIDMap[Job.PIT].delete(slave.ID); } else if (assignment === Job.LURCHER) { V.LurcherID = 0; + V.JobIDMap[Job.LURCHER].delete(slave.ID); } else { + if (V.JobIDMap.hasOwnProperty(assignment)) { + V.JobIDMap[assignment].delete(slave.ID); + } else { + V.JobIDMap[slave.assignment].delete(slave.ID); + } + if (V.HeadGirl !== 0 && slave.ID === V.HeadGirl.ID) { V.HeadGirl = 0; } else if (V.Recruiter !== 0 && slave.ID === V.Recruiter.ID) { @@ -519,13 +519,11 @@ globalThis.removeJob = function(slave, assignment, saveRecord = false) { case Job.ARCADE.toLowerCase(): case "arcade": slave.assignment = Job.GLORYHOLE; - V.ArcadeiIDs.delete(slave.ID); break; case Job.BROTHEL.toLowerCase(): case "brothel": slave.assignment = Job.WHORE; - V.BrothiIDs.delete(slave.ID); break; case Job.CELLBLOCK.toLowerCase(): @@ -537,70 +535,59 @@ globalThis.removeJob = function(slave, assignment, saveRecord = false) { slave.inflationMethod = 0; SetBellySize(slave); } - V.CellBiIDs.delete(slave.ID); break; case Job.CLINIC.toLowerCase(): case "clinic": slave.assignment = Job.REST; - V.CliniciIDs.delete(slave.ID); break; case Job.CLUB.toLowerCase(): case "club": slave.assignment = Job.PUBLIC; - V.ClubiIDs.delete(slave.ID); break; case Job.DAIRY.toLowerCase(): case "dairy": slave.assignment = Job.MILKED; - V.DairyiIDs.delete(slave.ID); break; case Job.FARMYARD.toLowerCase(): case "farmyard": slave.assignment = Job.REST; - V.FarmyardiIDs.delete(slave.ID); break; case Job.SCHOOL.toLowerCase(): case "schoolroom": slave.assignment = Job.REST; - V.SchlRiIDs.delete(slave.ID); break; case Job.SPA.toLowerCase(): case "spa": slave.assignment = Job.REST; - V.SpaiIDs.delete(slave.ID); break; case Job.QUARTER.toLowerCase(): case "servants' quarters": case "servantsquarters": slave.assignment = Job.HOUSE; - V.ServQiIDs.delete(slave.ID); break; case Job.MASTERSUITE.toLowerCase(): case "master suite": case "mastersuite": slave.assignment = Job.FUCKTOY; - V.MastSiIDs.delete(slave.ID); break; case "live with your head girl": case "head girl suite": case "hgsuite": slave.assignment = Job.REST; - V.HGSuiteiIDs.delete(slave.ID); break; case Job.NURSERY: case "nursery": slave.assignment = Job.REST; - V.NurseryiIDs.delete(slave.ID); break; case "be your head girl": @@ -658,6 +645,8 @@ globalThis.removeJob = function(slave, assignment, saveRecord = false) { break; } + V.JobIDMap[slave.assignment].add(slave.ID); + if (slave.rules.living === "luxurious" && !assignmentVisible(slave)) { slave.rules.living = "normal"; } @@ -666,7 +655,7 @@ globalThis.removeJob = function(slave, assignment, saveRecord = false) { slave.sentence = 0; slave.subTarget = 0; } - V.JobIDArray = makeJobIdMap(); + // reset it each time? V.JobIDArray = makeJobIdMap(); if (idx >= 0) { V.slaves[idx] = slave; } @@ -812,7 +801,7 @@ App.UI.jobLinks = function() { const slave = slaveStateById(ID); for (const f of facilitiesOrder) { - if (!f.established) { continue; } + if (!f.established || f.jobs.length === 0) { continue; } const rejects = f.canHostSlave(slave); if (rejects.length === 0) { transfers.push(f.transferLink(ID, undefined, passage())); @@ -866,7 +855,7 @@ App.UI.jobLinks = function() { const slave = slaveStateById(ID); for (const f of facilitiesOrder) { - if (!f.established) { continue; } + if (!f.established || f.jobs.length === 0) { continue; } const rejects = f.canHostSlave(slave); if (rejects.length === 0) { transfers.push(f.transferLinkElement(ID, undefined, passage(), callback)); diff --git a/src/js/economyJS.js b/src/js/economyJS.js index 42395682832263d843fd9c660fae760103903ee9..388048944d013aa03906e100e5bf699ca5b463c7 100644 --- a/src/js/economyJS.js +++ b/src/js/economyJS.js @@ -286,11 +286,12 @@ globalThis.calculateCosts = (function() { loopCosts += getSlaveCost(slave); } const reducibleUpkeep = Math.trunc(loopCosts * 0.2); - V.ServQiIDs.forEach(ID => { - number += getSlaveMinorCosts(V.slaves[V.slaveIndices[ID]]); + App.Utils.jobForAssignment(Job.QUARTER).employees().forEach( s => { + number += getSlaveMinorCosts(s); }); - V.JobIDMap[Job.HOUSE].forEach(ID => { - number += getSlaveMinorCosts(V.slaves[V.slaveIndices[ID]]); + + App.Utils.jobForAssignment(Job.HOUSE).employees().forEach(s => { + number += getSlaveMinorCosts(s); }); if (V.slaves.length > number) { loopCosts -= Math.trunc(reducibleUpkeep / V.slaves.length * number); @@ -307,11 +308,11 @@ globalThis.calculateCosts = (function() { let loopCosts = 0; // Figure out how many slaves are effectively getting their upkeep reduced by 20% - V.ServQiIDs.forEach(ID => { - numberServed += getSlaveMinorCosts(V.slaves[V.slaveIndices[ID]]); + App.Utils.jobForAssignment(Job.QUARTER).employees().forEach(s => { + numberServed += getSlaveMinorCosts(s); }); - V.JobIDMap[Job.HOUSE].forEach(ID => { - numberServed += getSlaveMinorCosts(V.slaves[V.slaveIndices[ID]]); + App.Utils.jobForAssignment(Job.HOUSE).employees().forEach(s => { + numberServed += getSlaveMinorCosts(s); }); /* Implement a system that calculates and subtracts slave upkeep per assignment @@ -462,22 +463,22 @@ globalThis.calculateCosts = (function() { // Calculate the servant reduction and credit them for it const reducibleUpkeep = Math.trunc(loopCosts * 0.2); - V.ServQiIDs.forEach(ID => { + App.Utils.jobForAssignment(Job.QUARTER).employees().forEach(s => { if (V.slaves.length > numberServed) { - slaveCostMinor = Math.trunc(reducibleUpkeep / V.slaves.length * getSlaveMinorCosts(V.slaves[V.slaveIndices[ID]])); - cashX(Math.abs(slaveCostMinor), "slaveAssignmentQuarter", V.slaves[V.slaveIndices[ID]]); + slaveCostMinor = Math.trunc(reducibleUpkeep / V.slaves.length * getSlaveMinorCosts(s)); + cashX(Math.abs(slaveCostMinor), "slaveAssignmentQuarter", s); } else { - slaveCostMinor = Math.trunc(reducibleUpkeep / numberServed * getSlaveMinorCosts(V.slaves[V.slaveIndices[ID]])); - cashX(Math.abs(slaveCostMinor), "slaveAssignmentQuarter", V.slaves[V.slaveIndices[ID]]); + slaveCostMinor = Math.trunc(reducibleUpkeep / numberServed * getSlaveMinorCosts(s)); + cashX(Math.abs(slaveCostMinor), "slaveAssignmentQuarter", s); } }); - V.JobIDMap[Job.HOUSE].forEach(ID => { + App.Utils.jobForAssignment(Job.HOUSE).employees().forEach(s => { if (V.slaves.length > numberServed) { - slaveCostMinor = Math.trunc(reducibleUpkeep / V.slaves.length * getSlaveMinorCosts(V.slaves[V.slaveIndices[ID]])); - cashX(Math.abs(slaveCostMinor), "slaveAssignmentHouse", V.slaves[V.slaveIndices[ID]]); + slaveCostMinor = Math.trunc(reducibleUpkeep / V.slaves.length * getSlaveMinorCosts(s)); + cashX(Math.abs(slaveCostMinor), "slaveAssignmentHouse", s); } else { - slaveCostMinor = Math.trunc(reducibleUpkeep / numberServed * getSlaveMinorCosts(V.slaves[V.slaveIndices[ID]])); - cashX(Math.abs(slaveCostMinor), "slaveAssignmentHouse", V.slaves[V.slaveIndices[ID]]); + slaveCostMinor = Math.trunc(reducibleUpkeep / numberServed * getSlaveMinorCosts(s)); + cashX(Math.abs(slaveCostMinor), "slaveAssignmentHouse", s); } }); // nothing to return, cashX already billed. @@ -1409,9 +1410,9 @@ globalThis.slaveJobValues = function(lowerClassSexDemandRef, middleClassSexDeman let brothelSpots; let toTheClubTotal = 0; let toTheBrothelTotal = 0; - const AL = V.ArcadeiIDs.length; - const CL = V.ClubiIDs.length; - const BL = V.BrothiIDs.length; + const AL = App.Entity.facilities.arcade.employeesIDs().size; + const CL = App.Entity.facilities.club.employeesIDs().size; + const BL = App.Entity.facilities.brothel.employeesIDs().size; V.clubSlavesGettingHelp = 0; V.brothelSlavesGettingHelp = 0; @@ -1566,37 +1567,36 @@ globalThis.slaveJobValues = function(lowerClassSexDemandRef, middleClassSexDeman // $His turgid dick helps $him manage the bitches. V.MadamCashBonus += 0.05; } - for (let dI = 0; dI < BL; dI++) { - let i = V.slaveIndices[V.BrothiIDs[dI]]; - if (V.Madam.relationshipTarget === V.slaves[i].ID) { + for (const slave of App.Entity.facilities.brothel.employees()) { + if (V.Madam.relationshipTarget === slave.ID) { V.MadamCashBonus -= 0.05; - } else if (areRelated(V.Madam, V.slaves[i])) { + } else if (areRelated(V.Madam, slave)) { V.MadamCashBonus += 0.05; } - if (V.slaves[i].prestigeDesc === "$He is a famed Free Cities whore, and commands top prices.") { + if (slave.prestigeDesc === "$He is a famed Free Cities whore, and commands top prices.") { V.MadamCashBonus += 0.15; - } else if (V.slaves[i].prestigeDesc === "$He is a famed Free Cities slut, and can please anyone.") { + } else if (slave.prestigeDesc === "$He is a famed Free Cities slut, and can please anyone.") { V.MadamCashBonus += 0.15; - } else if (V.slaves[i].prestigeDesc === "$He is remembered for winning best in show as a dairy cow.") { + } else if (slave.prestigeDesc === "$He is remembered for winning best in show as a dairy cow.") { if (V.arcologies[0].FSPhysicalIdealist !== "unset") { - if (V.slaves[i].muscles > 60 && V.slaves[i].weight < 30 && V.slaves[i].lactation > 0 && V.slaves[i].boobs - V.slaves[i].boobsImplant > 6000) { + if (slave.muscles > 60 && slave.weight < 30 && slave.lactation > 0 && slave.boobs - slave.boobsImplant > 6000) { V.MadamCashBonus += 0.15; } - } else if (V.slaves[i].lactation > 0 && V.slaves[i].boobs - V.slaves[i].boobsImplant > 6000) { + } else if (V.slaves[i].lactation > 0 && slave.boobs - slave.boobsImplant > 6000) { V.MadamCashBonus += 0.10; } - } else if (V.slaves[i].prestigeDesc === "$He is remembered for winning best in show as a cockmilker.") { + } else if (slave.prestigeDesc === "$He is remembered for winning best in show as a cockmilker.") { if (V.arcologies[0].FSGenderFundamentalist !== "unset") { - if (V.slaves[i].balls === 0 && V.slaves[i].dick === 0 && V.slaves[i].vagina > -1) { /* this needs review - doesn't fit right. An XY slave would be expected to be masculine. */ + if (slave.balls === 0 && slave.dick === 0 && slave.vagina > -1) { /* this needs review - doesn't fit right. An XY slave would be expected to be masculine. */ V.MadamCashBonus += 0.20; } - } else if ((V.slaves[i].balls > 5 && V.slaves[i].dick !== 0) || (V.slaves[i].balls > 4 && V.slaves[i].dick !== 0 && V.slaves[i].prostate > 1)) { + } else if ((slave.balls > 5 && slave.dick !== 0) || (slave.balls > 4 && slave.dick !== 0 && slave.prostate > 1)) { V.MadamCashBonus += 0.15; } - } else if (V.slaves[i].prestigeDesc === "$He is remembered for winning best in show as a breeder.") { - if (canGetPregnant(V.slaves[i])) { + } else if (slave.prestigeDesc === "$He is remembered for winning best in show as a breeder.") { + if (canGetPregnant(slave)) { V.MadamCashBonus += 0.15; - } else if (isPreg(V.slaves[i]) && V.slaves[i].bellyPreg >= 5000) { + } else if (isPreg(slave) && slave.bellyPreg >= 5000) { V.madamCashBonus += 0.1; } } @@ -1613,28 +1613,26 @@ globalThis.slaveJobValues = function(lowerClassSexDemandRef, middleClassSexDeman } // Glory hole slaves adding to 'arcade' - V.JobIDMap[Job.GLORYHOLE].forEach(ID => { - const s = V.slaves[V.slaveIndices[ID]]; + App.Utils.jobForAssignment(Job.GLORYHOLE).employees().forEach(s => { s.sexAmount = Math.trunc(restEffects(s, 20) * ((normalRandInt(600, 20) + (4 - s.anus) * 10 + (4 - s.vagina) * 10 + Math.trunc(s.health.condition / 2)) * 0.75)); tiredFucks(s); slaveJobValues.arcade += s.sexAmount; }); // Arcade slaves adding to 'arcade' - V.ArcadeiIDs.forEach(ID => { - const s = V.slaves[V.slaveIndices[ID]]; + App.Utils.jobForAssignment(Job.ARCADE).employees().forEach(s => { s.sexAmount = (normalRandInt(600, 20) + (4 - (s.anus - 2 * V.arcadeUpgradeInjectors)) * 10 + (4 - (s.vagina - 2 * V.arcadeUpgradeInjectors)) * 10 + Math.trunc(s.health.condition / 2)); slaveJobValues.arcade += s.sexAmount; }); // Public sluts adding to 'club' - V.JobIDMap[Job.PUBLIC].forEach(ID => { - SJVClub(V.slaves[V.slaveIndices[ID]]); + App.Utils.jobForAssignment(Job.PUBLIC).employees().forEach(s => { + SJVClub(s); }); // Club sluts adding to 'club' - V.ClubiIDs.forEach(ID => { - SJVClub(V.slaves[V.slaveIndices[ID]]); + App.Utils.jobForAssignment(Job.CLUB).employees().forEach(s => { + SJVClub(s); }); // Saturation penalty for public servants. Even the most beautiful slaves lose some of their shine if they have too much competition. @@ -1643,13 +1641,13 @@ globalThis.slaveJobValues = function(lowerClassSexDemandRef, middleClassSexDeman } // Street whores adding to 'brothel' - V.JobIDMap[Job.WHORE].forEach(ID => { - SJVBrothel(V.slaves[V.slaveIndices[ID]]); + App.Utils.jobForAssignment(Job.WHORE).employees().forEach(s => { + SJVBrothel(s); }); // Brothel whores adding to 'brothel' - V.BrothiIDs.forEach(ID => { - SJVBrothel(V.slaves[V.slaveIndices[ID]], lowerClassSexDemandRef, middleClassSexDemandRef, upperClassSexDemandRef, topClassSexDemandRef); + App.Utils.jobForAssignment(Job.BROTHEL).employees().forEach(s => { + SJVBrothel(s, lowerClassSexDemandRef, middleClassSexDemandRef, upperClassSexDemandRef, topClassSexDemandRef); }); function SJVClub(s) { diff --git a/src/js/eventSelectionJS.js b/src/js/eventSelectionJS.js index d3b9a47b908298531f64a84b811750b705320d16..d78a79f5bb789ec126f89799655b89b154e601d3 100644 --- a/src/js/eventSelectionJS.js +++ b/src/js/eventSelectionJS.js @@ -750,7 +750,7 @@ globalThis.generateRandomEventPoolStandard = function(eventSlave) { if (eventSlave.fetish === "sadist") { if (eventSlave.fetishStrength > 20) { - if (V.ArcadeiIDs.length > 0) { + if (App.Entity.facilities.arcade.established) { if (eventSlave.trust >= -20) { if (eventSlave.devotion > 50) { if (eventSlave.belly < 300000) { @@ -2186,7 +2186,7 @@ globalThis.generateRandomEventPoolServant = function(eventSlave) { if (eventSlave.fetish === "sadist") { if (eventSlave.fetishStrength > 20) { - if (V.ArcadeiIDs.length > 0) { + if (App.Entity.facilities.arcade.established) { if (eventSlave.trust >= -20) { if (eventSlave.devotion > 50) { if (eventSlave.belly < 300000) { diff --git a/src/js/facilityUINaming.js b/src/js/facilityUINaming.js deleted file mode 100644 index 890755833a6db80f8162fc274b287049844e3d95..0000000000000000000000000000000000000000 --- a/src/js/facilityUINaming.js +++ /dev/null @@ -1,97 +0,0 @@ -/** - * @returns {string} - */ -globalThis.masterSuiteUIName = function() { - return V.masterSuiteNameCaps === "The Master Suite" ? "Master Suite" : V.masterSuiteNameCaps; -}; - -/** - * @returns {string} - */ -globalThis.headGirlSuiteUIName = function() { - return V.HGSuiteNameCaps === "The Head Girl Suite" ? "Head Girl Suite" : V.HGSuiteNameCaps; -}; - -/** - * @returns {string} - */ -globalThis.servantQuartersUIName = function() { - return V.servantsQuartersNameCaps === "The Servants' Quarters" ? "Servants' Quarters" : V.servantsQuartersNameCaps; -}; - -/** - * @returns {string} - */ -globalThis.spaUIName = function() { - return V.spaNameCaps === "The Spa" ? "Spa" : V.spaNameCaps; -}; - -/** - * @returns {string} - */ -globalThis.nurseryUIName = function() { - return V.nurseryNameCaps === "The Nursery" ? "Nursery" : V.nurseryNameCaps; -}; - -/** - * @returns {string} - */ -globalThis.clinicUIName = function() { - return V.clinicNameCaps === "The Clinic" ? "Clinic" : V.clinicNameCaps; -}; - -/** - * @returns {string} - */ -globalThis.schoolRoomUIName = function() { - return V.schoolroomNameCaps === "The Schoolroom" ? "Schoolroom" : V.schoolroomNameCaps; -}; - -/** - * @returns {string} - */ -globalThis.cellblockUIName = function() { - return V.cellblockNameCaps === "The Cellblock" ? "Cellblock" : V.cellblockNameCaps; -}; - -/** - * @returns {string} - */ -globalThis.incubatorUIName = function() { - return V.incubatorNameCaps === "The Incubator" ? "Incubator" : V.incubatorNameCaps; -}; - -/** - * @returns {string} - */ -globalThis.clubUIName = function() { - return V.clubNameCaps === "The Club" ? "Club" : V.clubNameCaps; -}; - -/** - * @returns {string} - */ -globalThis.brothelUIName = function() { - return V.brothelNameCaps === "The Brothel" ? "Brothel" : V.brothelNameCaps; -}; - -/** - * @returns {string} - */ -globalThis.pitUIName = function() { - return V.pitNameCaps === "The Pit" ? "Pit" : V.pitNameCaps; -}; - -/** - * @returns {string} - */ -globalThis.arcadeUIName = function() { - return V.arcadeNameCaps === "The Arcade" ? "Arcade" : V.arcadeNameCaps; -}; - -/** - * @returns {string} - */ -globalThis.dairyUIName = function() { - return V.dairyNameCaps === "The Dairy" ? "Dairy" : V.dairyNameCaps; -}; diff --git a/src/js/utilsFC.js b/src/js/utilsFC.js index a3ba9217eb5b8197bc334e6876b69a9b0d26f935..017e3f57dcf64afd86f9f6efd4f60c07b624e6f6 100644 --- a/src/js/utilsFC.js +++ b/src/js/utilsFC.js @@ -2913,3 +2913,37 @@ globalThis.penthouseCensus = function() { V.roomsPopulation = penthouseSlaves.filter(occupiesRoom).length; V.dormitoryPopulation = penthouseSlaves.filter(s => s.rules.living !== "luxurious").length; }; + +/** + * @param {App.Entity.Facilities.Job|App.Entity.Facilities.Facility} jobOrFacility job or facility object + * @returns {App.Entity.SlaveState[]} array of slaves employed at the job or facility, sorted in accordance to user choice + */ +App.Utils.sortedEmployees = function(jobOrFacility) { + const emploees = jobOrFacility.employees(); + SlaveSort.slaves(emploees); + return emploees; +}; + +/** + * @param {Array<string|App.Entity.Facilities.Facility>} [facilities] + * @param {Object.<string, string>} [mapping] Optional mapping for the property names in the result object. Keys + * are the standard facility names, values are the desired names. + * @returns {Object.<string, number>} + */ +App.Utils.countFacilityWorkers = function(facilities = null, mapping = {}) { + facilities = facilities || Object.values(App.Entity.facilities); + /** @type {App.Entity.Facilities.Facility[]} */ + const fObjects = facilities.map(f => typeof f === "string" ? App.Entity.facilities[f] : f); + return fObjects.reduce((acc, cur) => { + acc[mapping[cur.desc.baseName] || cur.desc.baseName] = cur.employeesIDs().size; return acc; + }, {}); +}; + +/** + * @param {string[]} [assignments] array of assignment strings. The default is to count for all assignments + * @returns {Object.<string, number>} + */ +App.Utils.countAssignmentWorkers = function(assignments) { + assignments = assignments || Object.values(Job); + return assignments.reduce((acc, cur) => { acc[cur] = V.JobIDMap[cur].size; return acc; }, {}); +}; diff --git a/src/player/fSelf.tw b/src/player/fSelf.tw index 1cf6d7b0c8fa01e227c894639f5ddb11a1838bf7..86fe2c1482823e3b1381d8b2d7cb7a13870e99a6 100644 --- a/src/player/fSelf.tw +++ b/src/player/fSelf.tw @@ -3,11 +3,9 @@ <<set $nextButton = "Back", $nextLink = "Main">> <<set _CumSources = []>> -<<SlaveIDSort $DairyiIDs>> -<<for _fs = 0; _fs < $DairyiIDs.length; _fs++>> - <<set _cumTarget = $slaveIndices[$DairyiIDs[_fs]]>> - <<if $slaves[_cumTarget].balls > 0 && $slaves[_cumTarget].ballType == "human" && $slaves[_cumTarget].vasectomy != 1>> - <<set _CumSources.push($DairyiIDs[_fs])>> +<<for _slave range App.Entity.facilities.dairy.employees()>> + <<if _slave.balls > 0 && _slave.ballType == "human" && _slave.vasectomy != 1>> + <<set _CumSources.push(_slave.ID)>> <</if>> <</for>> <<if $arcologies[0].FSPastoralistLaw == 1>> diff --git a/src/player/js/playerJS.js b/src/player/js/playerJS.js index a22408087d9d0244c57f3a9ef601073d1890d1b4..dbc4ccb9d42c4c6fae34b48de3a145ae6267103c 100644 --- a/src/player/js/playerJS.js +++ b/src/player/js/playerJS.js @@ -437,7 +437,8 @@ globalThis.PCTitle = function() { } } - if (V.BrothiIDs.length >= 15) { + const facilities = App.Entity.facilities; + if (facilities.brothel.employeesIDs().size >= 15) { if (V.PC.title === 1) { titles.push("Procurator of the Brothel"); } else { @@ -445,10 +446,10 @@ globalThis.PCTitle = function() { } } - if (V.ClubiIDs.length >= 15) { + if (facilities.club.employeesIDs().size >= 15) { titles.push("First on the Club"); } - if (V.DairyiIDs.length >= 15) { + if (facilities.dairy.employeesIDs().size >= 15) { titles.push("Keeper of the Cattle"); } if (V.cumSlaves >= 15) { @@ -458,24 +459,24 @@ globalThis.PCTitle = function() { titles.push("Extractrix of the Ejaculate"); } } - if (V.ServQiIDs.length >= 15) { + if (facilities.servantsQuarters.employeesIDs().size >= 15) { if (V.PC.title === 1) { titles.push("Director of the Servants"); } else { titles.push("Directrix of the Servants"); } } - if (V.SchlRiIDs.length >= 10) { + if (facilities.schoolroom.employeesIDs().size >= 10) { if (V.PC.title === 1) { titles.push("Educator of the Slaves"); } else { titles.push("Educatrix of the Slaves"); } } - if (V.SpaiIDs.length >= 10) { + if (facilities.spa.employeesIDs().size >= 10) { titles.push("Order of the Bath"); } - if (V.ArcadeiIDs.length >= 15) { + if (facilities.arcade.employeesIDs().size >= 15) { titles.push("Comptroller of the Arcade"); } if (V.nurseryBabies >= 10) { diff --git a/src/pregmod/FCTV/seFCTVshows.tw b/src/pregmod/FCTV/seFCTVshows.tw index a62554ae127733772f746e24447d2be8f2340f2e..d190eab4e434dc1a9d3bacb061a8b8fadc4f90b9 100644 --- a/src/pregmod/FCTV/seFCTVshows.tw +++ b/src/pregmod/FCTV/seFCTVshows.tw @@ -137,7 +137,7 @@ <<case 1>> <<run FCTV.incrementChannel(2)>> - <<set _MSL = $MastSiIDs.length>> + <<set _MSL = App.Entity.facilities.dairy.employeesIDs().size>> which is currently showing <<if FCTV.channelCount(12, 'lt')>>the newest episode of a<<else>>a repeat of the<</if>> popular competitive reality show<<if FCTV.channelCount(0, 'gt')>>: Next Top Breeder.<<else>> where several female citizens are competing for something.<</if>> The intro sequence shows a succession of beautiful ladies either participating in a mixture of contrived competitions, or talking and going about their lives in a sorority-like setting. The montage is overlaid with a narrator's voice: "12 of Canadia Arcology's most attractive women are all competing for the privilege of having the arcology owner's children. diff --git a/src/pregmod/newChildIntro.tw b/src/pregmod/newChildIntro.tw index c4febcd7897120daca8cbcb82df8bcd63fe3a3f3..1f4434d1ac56395e01abffd322c70fa6d737f647 100644 --- a/src/pregmod/newChildIntro.tw +++ b/src/pregmod/newChildIntro.tw @@ -1075,7 +1075,7 @@ You slowly strip down, gauging $his reactions to your show, until you are fully <</link>> <<if ($activeSlave.lactation > 0 || (($dairySlimMaintainUpgrade == 0 || $dairySlimMaintain == 0) && ($activeSlave.boobs > 300 || $activeSlave.dick == 0 || $dairyImplantsSetting == 1) && $dairyImplantsSetting != 2)) || ($activeSlave.balls > 0)>> <<if $dairyPrepUpgrade == 1>> - <<if $dairy > $DairyiIDs.length+$bioreactorsXY+$bioreactorsXX+$bioreactorsHerm+$bioreactorsBarren>> + <<if App.Entity.facilities.dairy.hasFreeSpace>> <br><<link "Send $him straight to the Industrial Dairy">> <<set $activeSlave.choosesOwnAssignment = 0>> <<set $activeSlave.anus = Math.clamp($activeSlave.anus, 3, 4)>> @@ -1088,7 +1088,7 @@ You slowly strip down, gauging $his reactions to your show, until you are fully <</link>> <</if>> <</if>> - <<if $dairy > $DairyiIDs.length+$bioreactorsXY+$bioreactorsXX+$bioreactorsHerm+$bioreactorsBarren>> + <<if App.Entity.facilities.dairy.hasFreeSpace>> <br><<link "Break $him in for the Industrial Dairy">> <<set $activeSlave.choosesOwnAssignment = 0>> <<set $activeSlave.anus = Math.clamp($activeSlave.anus, 3, 4)>> @@ -1123,13 +1123,13 @@ You slowly strip down, gauging $his reactions to your show, until you are fully As $he <<if canSee($activeSlave)>>watches<<elseif canHear($activeSlave)>>listens<<else>>stands there<</if>>, aroused, first one citizen and then the other finishes and steps away. The first arcade inmate's <<if $seeDicks != 100>>pussy<<else>>butt<</if>> is left looking sore until $arcadeName's systems cover _himU for a quick cleaning, and the second inmate's asshole <<if $seeDicks != 0>>has obviously seen severe use, since the poor _girlU doesn't have a pussy to spread the load<<else>>is loose enough that the machines have to clean up the cum it drools onto the floor<</if>>. $activeSlave.slaveName lets out a cheer and turns to you, @@.hotpink;eagerly awaiting the day $he gets to go to $arcadeName and play with the holes.@@ It seems $he missed the point. <</replace>> <</link>> - <<if ($arcade > $ArcadeiIDs.length) || ($arcadeUpgradeFuckdolls == 2)>> + <<if (App.Entity.facilities.arcade.hasFreeSpace) || ($arcadeUpgradeFuckdolls == 2)>> <br><<link "Send $him straight to the Arcade">> <<= assignJob($activeSlave, "be confined in the arcade")>> <<set $activeSlave.choosesOwnAssignment = 0>> <<replace "#result">> You order <<if $HeadGirl == 0>>another slave<<else>>$HeadGirl.slaveName<</if>> to get $activeSlave.slaveName set up in $arcadeName. The new slave does not know what $arcadeName is, not really, and $he doesn't know what being set up there means, either. $He'll be confined inside a small space, not too different from the tube $he was grown in. It's only when the restraints lock into place that $he'll understand $his doom. $His mouth will be forced open and presented at one wall of $arcadeName, and $his ass will protrude from its other side, $his holes available for public relief at both ends. $He'll probably refuse to believe the truth, until the first cockhead enters $his mouth<<if $activeSlave.vagina > -1>>, parts $his pussylips,<</if>> or presses against $his poor anus. - <<if ($arcade <= $ArcadeiIDs.length)>>Mere <<if $showInches == 2>>yards<<else>>meters<</if>> away, preparations to convert the least appealing Arcade slave into a Fuckdoll begin. As $activeSlave.slaveName is broken in by $his first customers, $he's blissfully unaware that $he's $arcade new slaves away from the same fate.<</if>> + <<if ($arcade <= App.Entity.facilities.arcade.employeesIDs().size)>>Mere <<if $showInches == 2>>yards<<else>>meters<</if>> away, preparations to convert the least appealing Arcade slave into a Fuckdoll begin. As $activeSlave.slaveName is broken in by $his first customers, $he's blissfully unaware that $he's $arcade new slaves away from the same fate.<</if>> <</replace>> <</link>> <</if>> diff --git a/src/pregmod/widgets/pregmodBirthWidgets.tw b/src/pregmod/widgets/pregmodBirthWidgets.tw index 733708b96d901a75dc0467a8ae28429d17b1f24f..16eb04389ce628158d9e517745225e43f9b4dbe6 100644 --- a/src/pregmod/widgets/pregmodBirthWidgets.tw +++ b/src/pregmod/widgets/pregmodBirthWidgets.tw @@ -1031,7 +1031,7 @@ <<case "be your Head Girl">> <<if (random(1,20) > $suddenBirth)>> - <<set _HGL = $HGSuiteiIDs.length>> + <<set _HGL = App.Entity.facilities.headGirlSuite.employeesIDs().size>> $He returns to <<if $HGSuite == 1>>$his room's bed<<else>>$his bed<</if>> and strips before slipping into it. $He makes $himself comfortable<<if _HGL != 0>>, as $his slave rushes to $his side,<</if>> and begins working on birthing <<if $slaves[$i].counter.birthsTotal == 0>>$his first<<else>>this week's<</if>> baby. $His child is promptly taken<<if _HGL != 0>> by $his roommate<</if>> and $he rests awhile before returning to managing your slaves. <<else>> While overseeing your other slaves, $slaves[$i].slaveName's water breaks. $He attempts to hold back the coming birth until $he can catch a break in $his duties but ultimately fails. diff --git a/src/uncategorized/PETS.tw b/src/uncategorized/PETS.tw index c463f473ade377fd792544dc1be0bf566eb91334..b36ce153d9bc665ecc637b7a59b6871376341fba 100644 --- a/src/uncategorized/PETS.tw +++ b/src/uncategorized/PETS.tw @@ -274,13 +274,13 @@ You decide to knit up care's raveled sleave with a break in the spa. You have yo <<link "Encourage the schoolteacher to abuse poor students">> <<replace "#result">> You lean against the doorway of the classroom. $activeSlave.slaveName glances at you, but you subtly let $him know to continue with $his business. When $he finishes the lesson and, around the same time, climaxes, you clear your throat. The students all start with surprise and turn to you with trepidation. You observe in a conversational tone of voice that $activeSlave.slaveName is making great sacrifices here, performing an unsexy, boring job, and that any slave that does not work hard to learn will find themselves at the teacher's sexual disposal. Several of the least attentive students @@.green;try to look studious,@@ though a few of the better ones can't hide a certain anticipation. - <<run $slaves.forEach(function(s) { - if (s.assignment == "learn in the schoolroom" && s.intelligenceImplant < 30) { + <<run App.Entity.facilities.schoolroom.employees().forEach(function(s) { + if (s.intelligenceImplant < 30) { s.intelligenceImplant += 0.1; s.counter.oral += 1; + V.oralTotal += 1; }; })>> - <<set $oralTotal += $SchlRiIDs.length>> <</replace>> <</link>> <br><<link "Take the delinquent student in hand">> diff --git a/src/uncategorized/RESS.tw b/src/uncategorized/RESS.tw index 0e8c67305ce4b7938467aac3f7b1e175ef9223db..194396d4952f9b5a39d4d651658321d3d957dba9 100644 --- a/src/uncategorized/RESS.tw +++ b/src/uncategorized/RESS.tw @@ -18128,17 +18128,8 @@ brought in to you. This time <<= App.UI.slaveDescriptionDialog($activeSlave)>> h <<link "Ask $him about $his fantasy">> <<setNonlocalPronouns $seeDicks>> <<replace "#result">> - <<set _pussy = false, _balls = false>> - <<for _ress = 0; _ress < $ArcadeiIDs.length; _ress++>> - <<if $slaves[$slaveIndices[$ArcadeiIDs[_ress]]].vagina > 0>> - <<set _pussy = true>><<break>> - <</if>> - <</for>> - <<for _ress = 0; _ress < $ArcadeiIDs.length; _ress++>> - <<if $slaves[$slaveIndices[$ArcadeiIDs[_ress]]].balls > 0>> - <<set _balls = true>><<break>> - <</if>> - <</for>> + <<set _pussy = App.Entity.facilities.arcade.employees().some(s => s.vagina > 0)>> + <<set _balls = App.Entity.facilities.arcade.employees().some(s => s.balls > 0) You order $him to explain further. "<<Master>>," $he <<say>>s carefully, "it'<<s>> $arcadeName. There'<<s>> a <<s>>pe<<c>>ific pla<<c>>e there, and, well, I can't de<<s>>cribe it. It'<<s>> in the <<s>>ervi<<c>>e area under $arcadeName. Can I <<sh>>ow you what I mean?" Intrigued, you order $him to show you the place $he's talking about, and lead $him to $arcadeName through the access hallway. $He points to the service tunnel under one of the rows of inmates, which allows trusted slaves to clean up and perform maintenance. <<if $activeSlave.belly >= 100000>> Once you've managed to shove the massive slut @@ -18186,11 +18177,11 @@ brought in to you. This time <<= App.UI.slaveDescriptionDialog($activeSlave)>> h Fucking $him here would be interesting; unfortunately, there just isn't enough room for two mothers-to-be. <</if>> <br><<link "Teach $him about true sadism">> - <<set _ress = $slaveIndices[$ArcadeiIDs.random()]>> - <<setLocalPronouns $slaves[_ress] 2>> + <<set _ress = App.Entity.facilities.arcade.employees().random()>> + <<setLocalPronouns _ress 2>> <<replace "#result2">> $He seems to be focusing on the purely physical aspects of the degradation here. The true meaning of this place is so much more, and you decide to share it with $him. You call $his name, tearing $his attention away from the spectacle mere <<if $showInches == 2>>inches<<else>>centimeters<</if>> over your heads, and <<if canSee($activeSlave)>>point<<else>>direct $him<</if>> to a particular slave. You tell $activeSlave.slaveName that this particular Arcade inmate's name is - <<= SlaveFullName($slaves[_ress])>>. You tell $him that _he2 is $slaves[_ress].actualAge years old, that _he2 is $slaves[_ress].nationality, and that _he2 was once <<= convertCareer($slaves[_ress])>>. You list more details of _his2 life before _he2 was placed here to be fucked endlessly. $activeSlave.slaveName's eyes widen as you recite the details of the prior life of this piece of human sexual equipment and the sheer weight of the intellectual sadism smashes into $him. Then the slave above you both jerks a little. <<if $activeSlave.dick == 0>>There's no visible sign _his2 pussy's being fucked, so it must be<<else>>_His2 cock hardens involuntarily, indicating that it's<</if>> going into _his2 ass. You resume, mentioning that _he2's been buttfucked $slaves[_ress].counter.anal times. + <<= SlaveFullName(_ress)>>. You tell $him that _he2 is _ress.actualAge years old, that _he2 is _ress.nationality, and that _he2 was once <<= convertCareer(_ress)>>. You list more details of _his2 life before _he2 was placed here to be fucked endlessly. $activeSlave.slaveName's eyes widen as you recite the details of the prior life of this piece of human sexual equipment and the sheer weight of the intellectual sadism smashes into $him. Then the slave above you both jerks a little. <<if $activeSlave.dick == 0>>There's no visible sign _his2 pussy's being fucked, so it must be<<else>>_His2 cock hardens involuntarily, indicating that it's<</if>> going into _his2 ass. You resume, mentioning that _he2's been buttfucked _ress.counter.anal times. $activeSlave.slaveName jerks suddenly, <<if canAchieveErection($activeSlave)>>shooting $his cum onto the floor<<elseif $activeSlave.vagina < 0>>dribbling a little<<elseif $activeSlave.vaginaLube > 0>>squirting onto the floor<<else>>orgasming<</if>>. $He came without being touched. $He <<if canSee($activeSlave)>>stares at<<else>>faces<</if>> the mess $he made just by being in the presence of the arcology's @@.hotpink;undisputed preeminent sadist;@@ $he shudders at the sheer gothic glory of it. $He has a new moment to think of when $he feels like @@.lightsalmon;indulging $his own sadism.@@ <</replace>> <<set $activeSlave.devotion += 5, $activeSlave.fetishStrength = Math.clamp($activeSlave.fetishStrength+10, 0, 100)>> diff --git a/src/uncategorized/arcade.tw b/src/uncategorized/arcade.tw index ff29e44aa97626a585b961dd1b6468dc5c20e2e8..4baa5e2d316de585d71689e32d3ade24059ff152 100644 --- a/src/uncategorized/arcade.tw +++ b/src/uncategorized/arcade.tw @@ -1,6 +1,6 @@ :: Arcade [nobr] -<<set $nextButton = "Back to Main", $nextLink = "Main", $returnTo = "Arcade", $showEncyclopedia = 1, $encyclopedia = "Arcade", _AL = $ArcadeiIDs.length>> +<<set $nextButton = "Back to Main", $nextLink = "Main", $returnTo = "Arcade", $showEncyclopedia = 1, $encyclopedia = "Arcade", _AL = App.Entity.facilities.arcade.employeesIDs().size>> <p class="scene-intro"> <<if $arcadeName != "the Arcade">> diff --git a/src/uncategorized/arcadeReport.tw b/src/uncategorized/arcadeReport.tw index 8122b65e2d1b1ac8a62fecfdcc3595d08d5e4982..6e59f20e62cb69fc1cdfdf196e77b378593b613b 100644 --- a/src/uncategorized/arcadeReport.tw +++ b/src/uncategorized/arcadeReport.tw @@ -3,8 +3,8 @@ <span id="arcadestats"> </span> -<<SlaveIDSort $ArcadeiIDs>> -<<set _DL = $ArcadeiIDs.length, _SL = $slaves.length, _cockmilked = 0, _milked = 0, _milkprofits = 0, _profits = 0, _oldCash = 0, _boobsImplanted = 0, _prostatesImplanted = 0, _vasectomiesUndone = 0, _mSlave = 0, _bSlave = 0, _pSlave = 0, _cSlave = 0>> +<<set _slaves = App.Utils.sortedEmployees(App.Entity.facilities.arcade)>> +<<set _DL = _slaves.length, _SL = $slaves.length, _cockmilked = 0, _milked = 0, _milkprofits = 0, _profits = 0, _oldCash = 0, _boobsImplanted = 0, _prostatesImplanted = 0, _vasectomiesUndone = 0, _mSlave = 0, _bSlave = 0, _pSlave = 0, _cSlave = 0>> <!-- Statistics gathering --> <<set $facility = $facility || {}, $facility.arcade = initFacilityStatistics($facility.arcade)>> @@ -23,42 +23,42 @@ <br><br> $arcadeNameCaps's customers enjoy @@.green;getting off in $arcadeDecoration surroundings.@@ <</if>> -<<for _dI = 0; _dI < _DL; _dI++>> - <<set $i = $slaveIndices[$ArcadeiIDs[_dI]]>> - <<setLocalPronouns $slaves[$i]>> +<<for _slave range _slaves>> + <<setLocalPronouns _slave>> + <<set $i = $slaveIndices[_slave.ID]>> /% for the included passages %/ /* Perform facility based rule changes */ - <<set $slaves[$i].clothes = "no clothing">> + <<set _slave.clothes = "no clothing">> /* Health */ - <<if $arcadeUpgradeHealth == 2 && $slaves[$i].health.condition < 40>> - <<run improveCondition($slaves[$i], 2)>> - <<elseif $slaves[$i].health.condition > 20>> - <<run healthDamage($slaves[$i], 5)>> - <<elseif $arcadeUpgradeHealth == 1 && $slaves[$i].health.condition < -30>> - <<run improveCondition($slaves[$i], 2)>> - <<elseif $slaves[$i].health.condition > -50>> - <<run healthDamage($slaves[$i], 3)>> - <<elseif $slaves[$i].health.condition > -90>> - <<run healthDamage($slaves[$i], 1)>> + <<if $arcadeUpgradeHealth == 2 && _slave.health.condition < 40>> + <<run improveCondition(_slave, 2)>> + <<elseif _slave.health.condition > 20>> + <<run healthDamage(_slave, 5)>> + <<elseif $arcadeUpgradeHealth == 1 && _slave.health.condition < -30>> + <<run improveCondition(_slave, 2)>> + <<elseif _slave.health.condition > -50>> + <<run healthDamage(_slave, 3)>> + <<elseif _slave.health.condition > -90>> + <<run healthDamage(_slave, 1)>> <</if>> /* Curatives */ <<if $arcadeUpgradeHealth == 2>> - <<set $slaves[$i].curatives = 2>> + <<set _slave.curatives = 2>> <<elseif $arcadeUpgradeHealth == 1>> - <<set $slaves[$i].curatives = 1>> + <<set _slave.curatives = 1>> <</if>> /* Stimulation or lack thereof trust/devotion effect */ <<if ($arcadeUpgradeInjectors > 0)>> <<if $arcadeUpgradeInjectors == 2>> - <<set $slaves[$i].aphrodisiacs = 2>> + <<set _slave.aphrodisiacs = 2>> <</if>> - <<set $slaves[$i].devotion -= 5, $slaves[$i].trust -= 10>> + <<set _slave.devotion -= 5, _slave.trust -= 10>> <<else>> - <<set $slaves[$i].trust -= 5>> + <<set _slave.trust -= 5>> <</if>> /* Muscles */ - <<if ($slaves[$i].muscles > -100)>> - <<set $slaves[$i].muscles-->> + <<if (_slave.muscles > -100)>> + <<set _slave.muscles-->> <</if>> <<if $showEWD != 0>> @@ -66,85 +66,85 @@ /* 000-250-006 */ <<if $seeImages && $seeReportImages>> <div class="imageRef tinyImg"> - <<= SlaveArt($slaves[$i], 0, 0)>> + <<= SlaveArt(_slave, 0, 0)>> </div> <</if>> /* 000-250-006 */ - <span class='slave-name'><<= SlaveFullName($slaves[$i])>></span> - <<if $slaves[$i].choosesOwnAssignment == 2>> + <span class='slave-name'><<= SlaveFullName(_slave)>></span> + <<if _slave.choosesOwnAssignment == 2>> <<include "SA chooses own job">> <<else>> is confined in $arcadeName. <</if>> - <br> $He <<= App.SlaveAssignment.workAGloryHole($slaves[$i])>> + <br> $He <<= App.SlaveAssignment.workAGloryHole(_slave)>> <<else>> <<silently>> <<include "SA chooses own job">> - <<run App.SlaveAssignment.workAGloryHole($slaves[$i])>> + <<run App.SlaveAssignment.workAGloryHole(_slave)>> <</silently>> <</if>> <<if ($arcadeUpgradeCollectors > 0)>> - <<if ($slaves[$i].vasectomy == 1)>> - <<set $slaves[$i].vasectomy = 0, _vasectomiesUndone++>> - <<run cashX(forceNeg($surgeryCost), "slaveSurgery", $slaves[$i]), surgeryDamage($slaves[$i], 10)>> - <<elseif ($slaves[$i].lactation < 2)>> - <<set $slaves[$i].lactation = 2, _boobsImplanted++>> - <<set _bSlave = $slaves[$i]>> - <<run cashX(forceNeg($surgeryCost), "slaveSurgery", $slaves[$i]), surgeryDamage($slaves[$i], 10)>> - <<elseif $slaves[$i].prostate == 1>> - <<set $slaves[$i].prostate = 2, _prostatesImplanted++>> - <<set _pSlave = $slaves[$i]>> - <<run cashX(forceNeg($surgeryCost), "slaveSurgery", $slaves[$i]), surgeryDamage($slaves[$i], 10)>> - <<elseif ($slaves[$i].lactation > 0) || ($slaves[$i].balls > 0)>> + <<if (_slave.vasectomy == 1)>> + <<set _slave.vasectomy = 0, _vasectomiesUndone++>> + <<run cashX(forceNeg($surgeryCost), "slaveSurgery", _slave), surgeryDamage(_slave, 10)>> + <<elseif (_slave.lactation < 2)>> + <<set _slave.lactation = 2, _boobsImplanted++>> + <<set _bSlave = _slave>> + <<run cashX(forceNeg($surgeryCost), "slaveSurgery", _slave), surgeryDamage(_slave, 10)>> + <<elseif _slave.prostate == 1>> + <<set _slave.prostate = 2, _prostatesImplanted++>> + <<set _pSlave = _slave>> + <<run cashX(forceNeg($surgeryCost), "slaveSurgery", _slave), surgeryDamage(_slave, 10)>> + <<elseif (_slave.lactation > 0) || (_slave.balls > 0)>> <<set _oldCash = $cash>> <<if $showEWD != 0>> - <br> $He <<= App.SlaveAssignment.getMilked($slaves[$i])>> + <br> $He <<= App.SlaveAssignment.getMilked(_slave)>> <<else>> - <<run App.SlaveAssignment.getMilked($slaves[$i])>> + <<run App.SlaveAssignment.getMilked(_slave)>> <</if>> <<set _milkprofits += $cash-_oldCash>> <<set _growth = 0>> - <<set _gigantomastiaMod = $slaves[$i].geneticQuirks.gigantomastia == 2 ? ($slaves[$i].geneticQuirks.macromastia == 2 ? 3 : 2) : 1>> - <<if ($slaves[$i].boobs < 2000)>> + <<set _gigantomastiaMod = _slave.geneticQuirks.gigantomastia == 2 ? (_slave.geneticQuirks.macromastia == 2 ? 3 : 2) : 1>> + <<if (_slave.boobs < 2000)>> <<set _growth = 100>> - <<elseif ($slaves[$i].boobs < 5000*_gigantomastiaMod)>> + <<elseif (_slave.boobs < 5000*_gigantomastiaMod)>> <<set _growth = 50>> - <<elseif ($slaves[$i].boobs < 10000*_gigantomastiaMod)>> + <<elseif (_slave.boobs < 10000*_gigantomastiaMod)>> <<set _growth = 25>> <</if>> - <<if ($slaves[$i].geneMods.NCS == 1)>> + <<if (_slave.geneMods.NCS == 1)>> /* ** NCS will allow some growth for Arcade milking, but not as much as the Dairy. */ <<set _growth = Math.trunc(_growth/3.5)>> <</if>> - <<set $slaves[$i].boobs += _growth>> - <<if (($slaves[$i].balls > 0) && ($slaves[$i].balls < 10) && (random(1,100) > (40 + (10 * ($slaves[$i].balls + (2 * $slaves[$i].geneMods.NCS))))))>> - <<set $slaves[$i].balls++>> + <<set _slave.boobs += _growth>> + <<if ((_slave.balls > 0) && (_slave.balls < 10) && (random(1,100) > (40 + (10 * (_slave.balls + (2 * _slave.geneMods.NCS))))))>> + <<set _slave.balls++>> <</if>> - <<if (($slaves[$i].dick > 0) && ($slaves[$i].dick < 10) && (random(1,100) > (40 + (10 * $slaves[$i].dick + (2 * $slaves[$i].geneMods.NCS)))))>> - <<set $slaves[$i].dick++>> + <<if ((_slave.dick > 0) && (_slave.dick < 10) && (random(1,100) > (40 + (10 * _slave.dick + (2 * _slave.geneMods.NCS)))))>> + <<set _slave.dick++>> <</if>> - <<if ($slaves[$i].lactation > 0)>> + <<if (_slave.lactation > 0)>> <<set _milked++>> - <<set _mSlave = $slaves[$i]>> + <<set _mSlave = _slave>> <</if>> - <<if ($slaves[$i].balls > 0)>> + <<if (_slave.balls > 0)>> <<set _cockmilked++>> - <<set _cSlave = $slaves[$i]>> + <<set _cSlave = _slave>> <</if>> <</if>> <</if>> - <<if ($slaves[$i].inflation > 0)>> - <<set $slaves[$i].inflation = 0, $slaves[$i].inflationType = "none", $slaves[$i].inflationMethod = 0, $slaves[$i].milkSource = 0>> - <<run SetBellySize($slaves[$i])>> + <<if (_slave.inflation > 0)>> + <<set _slave.inflation = 0, _slave.inflationType = "none", _slave.inflationMethod = 0, _slave.milkSource = 0>> + <<run SetBellySize(_slave)>> <</if>> <<if $showEWD != 0>> <br> <<include "SA rules">> <<include "SA diet">> <<include "SA long term effects">> - <<= App.SlaveAssignment.drugs($slaves[$i])>> + <<= App.SlaveAssignment.drugs(_slave)>> <<include "SA relationships">> <<include "SA rivalries">> <br><<include "SA devotion">> @@ -153,7 +153,7 @@ <<include "SA rules">> <<include "SA diet">> <<include "SA long term effects">> - <<run App.SlaveAssignment.drugs($slaves[$i])>> + <<run App.SlaveAssignment.drugs(_slave)>> <<include "SA relationships">> <<include "SA rivalries">> <<include "SA devotion">> @@ -223,30 +223,29 @@ <<if ($arcadeUpgradeFuckdolls == 2)>> <<set $activeSlave = 0, _Age = -1, _FD = -1, _MB = -1, _Con = -1>> - <<for _dI = 0; _dI < _DL; _dI++>> - <<set $i = $slaveIndices[$ArcadeiIDs[_dI]]>> - <<if $slaves[$i].sentence == 0>> /* let's not convert slaves we are punishing into Fuckdolls */ - <<if ($slaves[$i].fetish == "mindbroken")>> - <<if ($slaves[$i].fuckdoll == 0)>> - <<if ($slaves[$i].physicalAge > 35)>> + <<for _slave range _slaves>> + <<if _slave.sentence == 0>> /* let's not convert slaves we are punishing into Fuckdolls */ + <<if (_slave.fetish == "mindbroken")>> + <<if (_slave.fuckdoll == 0)>> + <<if (_slave.physicalAge > 35)>> <<set _Age = $i>> <<break>> <<elseif _FD == -1>> <<set _FD = $i>> <</if>> <<elseif _MB == -1>> - <<if $slaves[$i].vagina >= 4 || $slaves[$i].anus >= 4>> + <<if _slave.vagina >= 4 || _slave.anus >= 4>> <<set _Con = $i>> - <<elseif $slaves[$i].physicalAge > 35>> + <<elseif _slave.physicalAge > 35>> <<set _Age = $i>> <<else>> <<set _MB = $i>> <</if>> <</if>> <<elseif _Con == -1>> - <<if $slaves[$i].vagina >= 4 || $slaves[$i].anus >= 4>> + <<if _slave.vagina >= 4 || _slave.anus >= 4>> <<set _Con = $i>> - <<elseif $slaves[$i].physicalAge > 35>> + <<elseif _slave.physicalAge > 35>> <<set _Age = $i>> <</if>> <</if>> diff --git a/src/uncategorized/arcmgmt.tw b/src/uncategorized/arcmgmt.tw index 2fb07bc4bf41db1d6d9788728b0213d27b0861fb..ae50850d999abf599b084c424a500c6c11b3e435 100644 --- a/src/uncategorized/arcmgmt.tw +++ b/src/uncategorized/arcmgmt.tw @@ -1317,7 +1317,7 @@ You own <<if $fuckdolls > 0>> - <<set _AL = $ArcadeiIDs.length>> + <<set _AL = App.Entity.facilities.arcade.employeesIDs().size>> <<if ($fuckdolls > $arcade - _AL) && ($arcade > _AL)>> <<set _fuckdollsArcade = $arcade - _AL>> <<elseif $fuckdolls < $arcade - _AL>> diff --git a/src/uncategorized/brothel.tw b/src/uncategorized/brothel.tw index e8268bf1fdf16ff8bea7ab31ea127284ca5013c3..29755dcf271fd7a914f3878cff276013414fa3c6 100644 --- a/src/uncategorized/brothel.tw +++ b/src/uncategorized/brothel.tw @@ -1,6 +1,6 @@ :: Brothel [nobr] -<<set $nextButton = "Back to Main", $nextLink = "Main", $returnTo = "Brothel", $showEncyclopedia = 1, $encyclopedia = "Brothel", _BL = $BrothiIDs.length>> +<<set $nextButton = "Back to Main", $nextLink = "Main", $returnTo = "Brothel", $showEncyclopedia = 1, $encyclopedia = "Brothel", _BL = App.Entity.facilities.brothel.employeesIDs().size>> <p class="scene-intro"> <<if $brothelName != "the Brothel">> diff --git a/src/uncategorized/brothelAdvertisement.tw b/src/uncategorized/brothelAdvertisement.tw index 90d9a7cf0fa7c8ddd40520a2eafa4ee4dd440c46..6578d5031a708863ca4d0914c2ca146846bb7577 100644 --- a/src/uncategorized/brothelAdvertisement.tw +++ b/src/uncategorized/brothelAdvertisement.tw @@ -133,7 +133,7 @@ <div> You are spending <<print cashFormatColor(forceNeg($brothelAdsSpending))>> each week to advertise $brothelName. <<if $lastWeeksCashIncome.brothelAds > 0>> - Last week's ads increased profits by <<print cashFormatColor($lastWeeksCashIncome.brothelAds)>><<if $BrothiIDs.length > 1>> and also increased business for your whores<</if>>, and cost <<print cashFormatColor(forceNeg($lastWeeksCashExpenses.brothelAds))>>. + Last week's ads increased profits by <<print cashFormatColor($lastWeeksCashIncome.brothelAds)>><<if App.Entity.facilities.brothel.employeesIDs().size > 1>> and also increased business for your whores<</if>>, and cost <<print cashFormatColor(forceNeg($lastWeeksCashExpenses.brothelAds))>>. <</if>> </div> diff --git a/src/uncategorized/brothelReport.tw b/src/uncategorized/brothelReport.tw index b31a1b09d83819b1f41bb09223525eddc72fa219..fd1b2b681c5e5e4eee2def624caae4b0d3239bcd 100644 --- a/src/uncategorized/brothelReport.tw +++ b/src/uncategorized/brothelReport.tw @@ -3,8 +3,8 @@ <span id="brothelstats"> </span> -<<SlaveIDSort $BrothiIDs>> -<<set _DL = $BrothiIDs.length, _SL = $slaves.length, $legendaryWhoreID = 0, _FLsFetish = 0, _profits = 0>> +<<set _slaves = App.Utils.sortedEmployees(App.Entity.facilities.brothel)>> +<<set _DL = _slaves.length, _SL = $slaves.length, $legendaryWhoreID = 0, _FLsFetish = 0, _profits = 0>> <<set $legendaryWombID = 0>> <<set _minBonus = 50, _maxBonus = 150>> @@ -81,84 +81,85 @@ <<if ($Madam.dick > 2) && (canPenetrate($Madam))>> $His turgid dick helps $him manage the bitches. <</if>> - <<for _dI = 0; _dI < _DL; _dI++>> - <<set $i = $slaveIndices[$BrothiIDs[_dI]]>> - <<if $Madam.rivalryTarget == $slaves[$i].ID>> + <<for _slave range _slaves>> + <<set $i = $slaveIndices[_slave.ID]>> /% for the included passages %/ + + <<if $Madam.rivalryTarget == _slave.ID>> $He forces $his <<print rivalryTerm($Madam)>>, to service all the men in the brothel. - <<set $slaves[$i].devotion -= 2, $slaves[$i].trust -= 2>> - <<if canDoVaginal($slaves[$i])>> + <<set _slave.devotion -= 2, _slave.trust -= 2>> + <<if canDoVaginal(_slave)>> <<run seX($activeSlave, "vaginal", "public", "penetrative", 10)>> <</if>> - <<if canDoAnal($slaves[$i])>> + <<if canDoAnal(_slave)>> <<run seX($activeSlave, "anal", "public", "penetrative", 12)>> <</if>> <<run seX($activeSlave, "anal", "public", "penetrative", 10)>> <<if random(1,100) > 65>> - <<set $slaves[_FLs].rivalry++, $Madam.rivalry++, $slaves[$i].rivalry++>> + <<set $slaves[_FLs].rivalry++, $Madam.rivalry++, _slave.rivalry++>> <</if>> - <<elseif $Madam.relationshipTarget == $slaves[$i].ID>> - <<setLocalPronouns $slaves[$i] 2>> - $He dotes over $his <<print relationshipTerm($Madam)>>, $slaves[$i].slaveName, making sure _he2 is safe, but unfortunately driving potential customers away from _him2. - <<set $slaves[$i].devotion++>> - <<elseif areRelated($Madam, $slaves[$i])>> - <<setLocalPronouns $slaves[$i] 2>> - $He pays special attention to $his <<print relativeTerm($Madam,$slaves[$i])>>, $slaves[$i].slaveName, making sure _he2 is treated well and showing off _his2 skills. - <<set $slaves[$i].trust++>> + <<elseif $Madam.relationshipTarget == _slave.ID>> + <<setLocalPronouns _slave 2>> + $He dotes over $his <<print relationshipTerm($Madam)>>, _slave.slaveName, making sure _he2 is safe, but unfortunately driving potential customers away from _him2. + <<set _slave.devotion++>> + <<elseif areRelated($Madam, _slave)>> + <<setLocalPronouns _slave 2>> + $He pays special attention to $his <<print relativeTerm($Madam,_slave)>>, _slave.slaveName, making sure _he2 is treated well and showing off _his2 skills. + <<set _slave.trust++>> <</if>> - <<if $slaves[$i].prestigeDesc == "$He is a famed Free Cities whore, and commands top prices.">> - <<setLocalPronouns $slaves[$i] 2>> - $He makes sure to promote $slaves[$i].slaveName, the famed whore, in order to capitalize on _his2 popularity. - <<elseif $slaves[$i].prestigeDesc == "$He is a famed Free Cities slut, and can please anyone.">> - <<setLocalPronouns $slaves[$i] 2>> - $He makes sure to promote $slaves[$i].slaveName, the famed entertainer, in order to capitalize on _his2 popularity. - <<elseif $slaves[$i].prestigeDesc == "$He is remembered for winning best in show as a dairy cow.">> - <<setLocalPronouns $slaves[$i] 2>> + <<if _slave.prestigeDesc == "$He is a famed Free Cities whore, and commands top prices.">> + <<setLocalPronouns _slave 2>> + $He makes sure to promote _slave.slaveName, the famed whore, in order to capitalize on _his2 popularity. + <<elseif _slave.prestigeDesc == "$He is a famed Free Cities slut, and can please anyone.">> + <<setLocalPronouns _slave 2>> + $He makes sure to promote _slave.slaveName, the famed entertainer, in order to capitalize on _his2 popularity. + <<elseif _slave.prestigeDesc == "$He is remembered for winning best in show as a dairy cow.">> + <<setLocalPronouns _slave 2>> <<if ($arcologies[0].FSPhysicalIdealist != "unset")>> - <<if ($slaves[$i].muscles > 60) && ($slaves[$i].weight < 30) && ($slaves[$i].lactation > 0) && (($slaves[$i].boobs-$slaves[$i].boobsImplant) > 6000)>> - $He shows off how even a cow like $slaves[$i].slaveName can achieve physical perfection. + <<if (_slave.muscles > 60) && (_slave.weight < 30) && (_slave.lactation > 0) && ((_slave.boobs-_slave.boobsImplant) > 6000)>> + $He shows off how even a cow like _slave.slaveName can achieve physical perfection. <<else>> - A<<if ($slaves[$i].muscles < 30)>>n unmuscled,<</if>><<if ($slaves[$i].weight > 30)>> fat,<</if>> 'prestigious' <<if ($slaves[$i].lactation > 0)>>cow<<elseif (($slaves[$i].boobs-$slaves[$i].boobsImplant) > 6000)>>mass of titflesh<<else>>slave<</if>> like $slaves[$i].slaveName is woefully out of fashion, so $Madam.slaveName tries to draw attention away from _him2. + A<<if (_slave.muscles < 30)>>n unmuscled,<</if>><<if (_slave.weight > 30)>> fat,<</if>> 'prestigious' <<if (_slave.lactation > 0)>>cow<<elseif ((_slave.boobs-_slave.boobsImplant) > 6000)>>mass of titflesh<<else>>slave<</if>> like _slave.slaveName is woefully out of fashion, so $Madam.slaveName tries to draw attention away from _him2. <</if>> <<else>> - <<if ($slaves[$i].lactation > 0) && (($slaves[$i].boobs-$slaves[$i].boobsImplant) > 6000)>> - $He makes sure to massage $slaves[$i].slaveName's huge breasts to get the milk flowing before enticing clients to suckle and play with _him2. + <<if (_slave.lactation > 0) && ((_slave.boobs-_slave.boobsImplant) > 6000)>> + $He makes sure to massage _slave.slaveName's huge breasts to get the milk flowing before enticing clients to suckle and play with _him2. <<else>> - $He would like to show off $slaves[$i].slaveName's huge udders, but $slaves[$i].slaveName <<if ($slaves[$i].lactation == 0)>>isn't producing milk anymore<<else>>doesn't exactly have huge udders anymore<</if>>. + $He would like to show off _slave.slaveName's huge udders, but _slave.slaveName <<if (_slave.lactation == 0)>>isn't producing milk anymore<<else>>doesn't exactly have huge udders anymore<</if>>. <</if>> <</if>> - <<elseif $slaves[$i].prestigeDesc == "$He is remembered for winning best in show as a cockmilker.">> - <<setLocalPronouns $slaves[$i] 2>> + <<elseif _slave.prestigeDesc == "$He is remembered for winning best in show as a cockmilker.">> + <<setLocalPronouns _slave 2>> <<if $arcologies[0].FSGenderFundamentalist != "unset">> /* this needs review - doesn't fit right. An XY slave would be expected to be masculine. */ - <<if ($slaves[$i].balls == 0) && ($slaves[$i].dick == 0) && ($slaves[$i].vagina > -1)>> - $He uses $slaves[$i].slaveName as an example of how even a huge-balled freak like _him2 can be restored to proper femininity. + <<if (_slave.balls == 0) && (_slave.dick == 0) && (_slave.vagina > -1)>> + $He uses _slave.slaveName as an example of how even a huge-balled freak like _him2 can be restored to proper femininity. <<else>> - $He tries to hide $slaves[$i].slaveName, 'her' body being notorious for its defiance of conventional femininity. + $He tries to hide _slave.slaveName, 'her' body being notorious for its defiance of conventional femininity. <</if>> <<else>> - <<if (($slaves[$i].balls > 5) && ($slaves[$i].dick != 0)) || (($slaves[$i].balls > 4) && ($slaves[$i].dick != 0) && ($slaves[$i].prostate > 1))>> - $He shows off $slaves[$i].slaveName's copious loads by putting a condom over _his2 dick and teasing _him2 till _he2 bursts it. The show draws multiple clients that want to play with _his2 oversized junk and messy orgasms. + <<if ((_slave.balls > 5) && (_slave.dick != 0)) || ((_slave.balls > 4) && (_slave.dick != 0) && (_slave.prostate > 1))>> + $He shows off _slave.slaveName's copious loads by putting a condom over _his2 dick and teasing _him2 till _he2 bursts it. The show draws multiple clients that want to play with _his2 oversized junk and messy orgasms. <<else>> - $He would love to show off $slaves[$i].slaveName's copious loads, but $slaves[$i].slaveName<<if $slaves[$i].dick == 0>> doesn't have a dick<<elseif $slaves[$i].balls == 0>>'s not producing cum<<else>>'s orgasms just aren't messy enough<</if>>. + $He would love to show off _slave.slaveName's copious loads, but _slave.slaveName<<if _slave.dick == 0>> doesn't have a dick<<elseif _slave.balls == 0>>'s not producing cum<<else>>'s orgasms just aren't messy enough<</if>>. <</if>> <</if>> - <<elseif $slaves[$i].prestigeDesc == "$He is remembered for winning best in show as a breeder.">> - <<setLocalPronouns $slaves[$i] 2>> - <<if $slaves[$i].bellyPreg >= 5000>> - $He makes sure $slaves[$i].slaveName's growing pregnancy is well taken care of, even if it means driving away potential customers away when the mother-to-be needs a rest. - <<elseif canGetPregnant($slaves[$i])>> - $He makes sure to play off $slaves[$i].slaveName's fame and fertility by enticing potential customers to be the one to claim _his2 womb by filling it with their child. + <<elseif _slave.prestigeDesc == "$He is remembered for winning best in show as a breeder.">> + <<setLocalPronouns _slave 2>> + <<if _slave.bellyPreg >= 5000>> + $He makes sure _slave.slaveName's growing pregnancy is well taken care of, even if it means driving away potential customers away when the mother-to-be needs a rest. + <<elseif canGetPregnant(_slave)>> + $He makes sure to play off _slave.slaveName's fame and fertility by enticing potential customers to be the one to claim _his2 womb by filling it with their child. <<else>> - $He would love to play off of $slaves[$i].slaveName's fame and fertility, but unfortunately _he2 <<if $slaves[$i].pregKnown == 1 && $slaves[$i].bellyPreg < 1500>>is already pregnant and not far enough along to show it<<elseif $slaves[$i].pregKnown == 1 && $slaves[$i].bellyPreg < 5000>>already pregnant, but not enough to be exciting<<else>>is unable to get knocked up<</if>>. + $He would love to play off of _slave.slaveName's fame and fertility, but unfortunately _he2 <<if _slave.pregKnown == 1 && _slave.bellyPreg < 1500>>is already pregnant and not far enough along to show it<<elseif _slave.pregKnown == 1 && _slave.bellyPreg < 5000>>already pregnant, but not enough to be exciting<<else>>is unable to get knocked up<</if>>. <</if>> <</if>> <</for>> <<if (_DL+$brothelSlavesGettingHelp < 10)>> <<set $i = _FLs>> /* apply following SA passages to facility leader */ - <<setLocalPronouns $slaves[$i]>> + <<setLocalPronouns _slave>> <<set _oldCash = $cash>> <<if $showEWD != 0>> - <br> $He <<= App.SlaveAssignment.whore($slaves[$i])>> + <br> $He <<= App.SlaveAssignment.whore(_slave)>> <<else>> <<run App.SlaveAssignment.whore($slaves[$i])>> <</if>> @@ -225,46 +226,46 @@ <<set _healthBonus += 3, _aphrod = 2>> <</if>> <<set _oldCash = $cash>> - <<for _dI = 0; _dI < _DL; _dI++>> - <<set $i = $slaveIndices[$BrothiIDs[_dI]]>> - <<setLocalPronouns $slaves[$i]>> - <<if ($legendaryWombID == 0) && (!isAmputee($slaves[$i])) && ($slaves[$i].preg > $slaves[$i].pregData.normalBirth/1.33) && ($slaves[$i].broodmother == 0) && ($slaves[$i].eggType == "human") && ($slaves[$i].counter.births > 10) && ($slaves[$i].devotion > 50) && ($slaves[$i].prestige == 0)>> - <<set $legendaryWombID = $slaves[$i].ID>> + <<for _slave range _slaves>> + <<set $i = $slaveIndices[_slave.ID]>> + <<setLocalPronouns _slave>> + <<if ($legendaryWombID == 0) && (!isAmputee(_slave)) && (_slave.preg > _slave.pregData.normalBirth/1.33) && (_slave.broodmother == 0) && (_slave.eggType == "human") && (_slave.counter.births > 10) && (_slave.devotion > 50) && (_slave.prestige == 0)>> + <<set $legendaryWombID = _slave.ID>> <</if>> - <<if ($legendaryWhoreID == 0) && ($slaves[$i].skill.whoring >= 100) && ($slaves[$i].devotion > 50) && ($slaves[$i].prestige == 0)>> - <<set $legendaryWhoreID = $slaves[$i].ID>> + <<if ($legendaryWhoreID == 0) && (_slave.skill.whoring >= 100) && (_slave.devotion > 50) && (_slave.prestige == 0)>> + <<set $legendaryWhoreID = _slave.ID>> <</if>> /* Perform facility based rule changes */ - <<run improveCondition($slaves[$i], _healthBonus)>> - <<set $slaves[$i].aphrodisiacs = _aphrod>> + <<run improveCondition(_slave, _healthBonus)>> + <<set _slave.aphrodisiacs = _aphrod>> <<switch $brothelDecoration>> <<case "Degradationist" "standard">> - <<set $slaves[$i].rules.living = "spare">> + <<set _slave.rules.living = "spare">> <<default>> - <<set $slaves[$i].rules.living = "normal">> + <<set _slave.rules.living = "normal">> <</switch>> - <<if ($slaves[$i].health.condition < -80)>> - <<run improveCondition($slaves[$i], 20)>> - <<elseif $slaves[$i].health.condition < -40>> - <<run improveCondition($slaves[$i], 15)>> - <<elseif $slaves[$i].health.condition < 0>> - <<run improveCondition($slaves[$i], 10)>> - <<elseif $slaves[$i].health.condition < 90>> - <<run improveCondition($slaves[$i], 7)>> + <<if (_slave.health.condition < -80)>> + <<run improveCondition(_slave, 20)>> + <<elseif _slave.health.condition < -40>> + <<run improveCondition(_slave, 15)>> + <<elseif _slave.health.condition < 0>> + <<run improveCondition(_slave, 10)>> + <<elseif _slave.health.condition < 90>> + <<run improveCondition(_slave, 7)>> <</if>> - <<if ($slaves[$i].devotion <= 20) && ($slaves[$i].trust >= -20)>> - <<set $slaves[$i].devotion -= 5, $slaves[$i].trust -= 5>> - <<elseif ($slaves[$i].devotion < 45)>> - <<set $slaves[$i].devotion += 4>> - <<elseif ($slaves[$i].devotion > 50)>> - <<set $slaves[$i].devotion -= 4>> + <<if (_slave.devotion <= 20) && (_slave.trust >= -20)>> + <<set _slave.devotion -= 5, _slave.trust -= 5>> + <<elseif (_slave.devotion < 45)>> + <<set _slave.devotion += 4>> + <<elseif (_slave.devotion > 50)>> + <<set _slave.devotion -= 4>> <</if>> - <<if ($slaves[$i].trust < 30)>> - <<set $slaves[$i].trust += 5>> + <<if (_slave.trust < 30)>> + <<set _slave.trust += 5>> <</if>> - <<if $slaves[$i].energy > 40 && $slaves[$i].energy < 95>> - <<set $slaves[$i].energy++>> + <<if _slave.energy > 40 && _slave.energy < 95>> + <<set _slave.energy++>> <</if>> <<if $showEWD != 0>> @@ -272,44 +273,44 @@ /* 000-250-006 */ <<if $seeImages && $seeReportImages>> <div class="imageRef tinyImg"> - <<= SlaveArt($slaves[$i], 0, 0)>> + <<= SlaveArt(_slave, 0, 0)>> </div> <</if>> /* 000-250-006 */ - <span class="slave-name"><<= SlaveFullName($slaves[$i])>></span> - <<if $slaves[$i].choosesOwnAssignment == 2>> + <span class="slave-name"><<= SlaveFullName(_slave)>></span> + <<if _slave.choosesOwnAssignment == 2>> <<include "SA chooses own job">> <<else>> is working out of $brothelName. <</if>> - <br> $He <<= App.SlaveAssignment.whore($slaves[$i])>> + <br> $He <<= App.SlaveAssignment.whore(_slave)>> <br> - <<= App.SlaveAssignment.choosesOwnClothes($slaves[$i])>> + <<= App.SlaveAssignment.choosesOwnClothes(_slave)>> <<include "SA rules">> <<include "SA diet">> <<include "SA long term effects">> - <<= App.SlaveAssignment.drugs($slaves[$i])>> + <<= App.SlaveAssignment.drugs(_slave)>> <<include "SA relationships">> <<include "SA rivalries">> <br><<include "SA devotion">> <<else>> <<silently>> <<include "SA chooses own job">> - <<run App.SlaveAssignment.whore($slaves[$i])>> - <<run App.SlaveAssignment.choosesOwnClothes($slaves[$i])>> + <<run App.SlaveAssignment.whore(_slave)>> + <<run App.SlaveAssignment.choosesOwnClothes(_slave)>> <<include "SA rules">> <<include "SA diet">> <<include "SA long term effects">> - <<run App.SlaveAssignment.drugs($slaves[$i])>> + <<run App.SlaveAssignment.drugs(_slave)>> <<include "SA relationships">> <<include "SA rivalries">> <<include "SA devotion">> <</silently>> <</if>> - <<set _seed = Math.max(App.Ads.getMatchedCategoryCount($slaves[$i], "brothel"), 1)>> + <<set _seed = Math.max(App.Ads.getMatchedCategoryCount(_slave, "brothel"), 1)>> <<set _adsIncome = _seed * random(50,60) * Math.trunc($brothelAdsSpending/1000)>> - <<set _cashX = _adsIncome, getSlaveStatisticData($slaves[$i], $facility.brothel).adsIncome += _adsIncome>> + <<set _cashX = _adsIncome, getSlaveStatisticData(_slave, $facility.brothel).adsIncome += _adsIncome>> <<run cashX(_cashX, "brothelAds")>> <</for>> diff --git a/src/uncategorized/cellblock.tw b/src/uncategorized/cellblock.tw index 903ecea20d5142de9b99851c628eb5943e267278..6af055a19cd6f33e006df4ebfd8e005db04785bf 100644 --- a/src/uncategorized/cellblock.tw +++ b/src/uncategorized/cellblock.tw @@ -1,6 +1,6 @@ :: Cellblock [nobr] -<<set $nextButton = "Back to Main", $nextLink = "Main", $returnTo = "Cellblock", $showEncyclopedia = 1, $encyclopedia = "Cellblock", _CL = $CellBiIDs.length>> +<<set $nextButton = "Back to Main", $nextLink = "Main", $returnTo = "Cellblock", $showEncyclopedia = 1, $encyclopedia = "Cellblock", _CL = App.Entity.facilities.cellblock.employeesIDs().size>> <<if $cellblockName != "the Cellblock">> <<set $cellblockNameCaps = $cellblockName.replace("the ", "The ")>> diff --git a/src/uncategorized/cellblockReport.tw b/src/uncategorized/cellblockReport.tw index c4a7a01421accdc3303445f4e9287dc793ef73ca..3dda3ca2d91be55d7e7d5db85e5f37a9ce08ba41 100644 --- a/src/uncategorized/cellblockReport.tw +++ b/src/uncategorized/cellblockReport.tw @@ -1,7 +1,7 @@ :: Cellblock Report [nobr] -<<SlaveIDSort $CellBiIDs>> -<<set _DL = $CellBiIDs.length, _SL = $slaves.length, _brokenSlaves = 0, _idleBonus = 0, _softenedQuirks = 0, _trustMalus = 0, _FLsFetish = 0>> +<<set _slaves = App.Utils.sortedEmployees(App.Entity.facilities.cellblock)>> +<<set _DL = _slaves.length, _SL = $slaves.length, _brokenSlaves = 0, _idleBonus = 0, _softenedQuirks = 0, _trustMalus = 0, _FLsFetish = 0>> <<if $cellblockDecoration != "standard">> <<set _devBonus = 1>> @@ -90,25 +90,24 @@ <<set _devBonus++, _trustMalus++, _idleBonus++>> $His devotion to you is so absolute that $he sees breaking bitches for your service as a noble calling. <</if>> - <<for _dI = 0; _dI < _DL; _dI++>> - <<set $i = $slaveIndices[$CellBiIDs[_dI]]>> - <<if $Wardeness.rivalryTarget == $slaves[$i].ID>> - $He greatly enjoys breaking $his <<print rivalryTerm($Wardeness)>>, $slaves[$i].slaveName's will. - <<set $slaves[$i].devotion++, $slaves[$i].trust -= 3>> + <<for _slave range _slaves>> + <<if $Wardeness.rivalryTarget == _slave.ID>> + $He greatly enjoys breaking $his <<print rivalryTerm($Wardeness)>>, _slave.slaveName's will. + <<set _slave.devotion++, _slave.trust -= 3>> <<if random(1,100) > 30>> - <<set $Wardeness.rivalry++, $slaves[_FLs].rivalry++, $slaves[$i].rivalry++>> + <<set $Wardeness.rivalry++, $slaves[_FLs].rivalry++, _slave.rivalry++>> <</if>> - <<elseif $Wardeness.relationshipTarget == $slaves[$i].ID>> - $He hates having to break $his <<print relationshipTerm($Wardeness)>>, $slaves[$i].slaveName, but $his devotion to you wins out in the end. - <<set $slaves[$i].devotion++, $slaves[$i].trust -= 3>> + <<elseif $Wardeness.relationshipTarget == _slave.ID>> + $He hates having to break $his <<print relationshipTerm($Wardeness)>>, _slave.slaveName, but $his devotion to you wins out in the end. + <<set _slave.devotion++, _slave.trust -= 3>> <<if random(1,100) >= 50>> - $His and $slaves[$i].slaveName's relationship has been shattered by these events. - <<set $Wardeness.relationship = 0, $Wardeness.relationshipTarget = 0, $slaves[_FLs].relationship = 0, $slaves[_FLs].relationshipTarget = 0, $slaves[$i].relationship = 0, $slaves[$i].relationshipTarget = 0>> + $His and _slave.slaveName's relationship has been shattered by these events. + <<set $Wardeness.relationship = 0, $Wardeness.relationshipTarget = 0, $slaves[_FLs].relationship = 0, $slaves[_FLs].relationshipTarget = 0, _slave.relationship = 0, _slave.relationshipTarget = 0>> <</if>> - <<elseif areRelated($Wardeness, $slaves[$i])>> - <<setLocalPronouns $slaves[$i] 2>> - $He shows $his <<print relativeTerm($Wardeness,$slaves[$i])>> $slaves[$i].slaveName no mercy, making sure _he2 understands _his2 place. - <<set $slaves[$i].devotion++, $slaves[$i].trust-->> + <<elseif areRelated($Wardeness, _slave)>> + <<setLocalPronouns _slave 2>> + $He shows $his <<print relativeTerm($Wardeness,_slave)>> _slave.slaveName no mercy, making sure _he2 understands _his2 place. + <<set _slave.devotion++, _slave.trust-->> <</if>> <</for>> <<if (_DL < $cellblock)>> @@ -161,122 +160,122 @@ <<set $Wardeness = $slaves[_FLs]>> <</if>> -<<for _dI = 0; _dI < _DL; _dI++>> - <<set $i = $slaveIndices[$CellBiIDs[_dI]]>> - <<setLocalPronouns $slaves[$i]>> - <<if ($slaves[$i].devotion <= 20)>> - <<if ($slaves[$i].trust >= -20)>> - <<if (($slaves[$i].hears == -1 && $slaves[$i].earwear != "hearing aids") || ($slaves[$i].hears == 0 && $slaves[$i].earwear == "muffling ear plugs") ||($slaves[$i].hears == -2))>> - <<set $slaves[$i].devotion -= 2, $slaves[$i].trust -= 2>> +<<for _slave range _slaves>> + <<set $i = $slaveIndices[_slave.ID]>> + <<setLocalPronouns _slave>> + <<if (_slave.devotion <= 20)>> + <<if (_slave.trust >= -20)>> + <<if ((_slave.hears == -1 && _slave.earwear != "hearing aids") || (_slave.hears == 0 && _slave.earwear == "muffling ear plugs") ||(_slave.hears == -2))>> + <<set _slave.devotion -= 2, _slave.trust -= 2>> <<else>> - <<set $slaves[$i].devotion -= 4, $slaves[$i].trust -= 4>> + <<set _slave.devotion -= 4, _slave.trust -= 4>> <</if>> <<else>> - <<set $slaves[$i].devotion++>> + <<set _slave.devotion++>> <</if>> <</if>> <<switch $cellblockDecoration>> <<case "Paternalist">> - <<set $slaves[$i].rules.living = "normal">> - <<if ($slaves[$i].inflation > 0)>> - <<set $slaves[$i].inflation = 0, $slaves[$i].inflationType = "none", $slaves[$i].inflationMethod = 0, $slaves[$i].milkSource = 0>> - <<run SetBellySize($slaves[$i])>> + <<set _slave.rules.living = "normal">> + <<if (_slave.inflation > 0)>> + <<set _slave.inflation = 0, _slave.inflationType = "none", _slave.inflationMethod = 0, _slave.milkSource = 0>> + <<run SetBellySize(_slave)>> <</if>> <<case "Pastoralist">> - <<set $slaves[$i].rules.living = "spare">> - <<if $slaves[$i].inflation == 0>> - <<if $slaves[$i].pregKnown == 0 && $slaves[$i].bellyImplant < 1500>> - <<set $slaves[$i].inflation = 2, $slaves[$i].inflationType = "milk", $slaves[$i].inflationMethod = 1>> + <<set _slave.rules.living = "spare">> + <<if _slave.inflation == 0>> + <<if _slave.pregKnown == 0 && _slave.bellyImplant < 1500>> + <<set _slave.inflation = 2, _slave.inflationType = "milk", _slave.inflationMethod = 1>> <<else>> - <<set $slaves[$i].inflation = 1, $slaves[$i].inflationType = "milk", $slaves[$i].inflationMethod = 1>> + <<set _slave.inflation = 1, _slave.inflationType = "milk", _slave.inflationMethod = 1>> <</if>> - <<run SetBellySize($slaves[$i])>> + <<run SetBellySize(_slave)>> <</if>> <<case "Hedonistic">> - <<set $slaves[$i].rules.living = "spare">> - <<if $slaves[$i].weight < 200>> - <<if $slaves[$i].weightDirection == 1>> - <<set $slaves[$i].weight += 5>> - <<elseif $slaves[$i].weightDirection == -1>> - <<set $slaves[$i].weight += 1>> + <<set _slave.rules.living = "spare">> + <<if _slave.weight < 200>> + <<if _slave.weightDirection == 1>> + <<set _slave.weight += 5>> + <<elseif _slave.weightDirection == -1>> + <<set _slave.weight += 1>> <<else>> - <<set $slaves[$i].weight += 3>> + <<set _slave.weight += 3>> <</if>> <</if>> - <<if $slaves[$i].muscles > -100>> - <<set $slaves[$i].muscles -= 2>> + <<if _slave.muscles > -100>> + <<set _slave.muscles -= 2>> <</if>> - <<if $slaves[$i].inflation == 0>> - <<if $slaves[$i].pregKnown == 0 && $slaves[$i].bellyImplant < 1500>> - <<set $slaves[$i].inflation = 3, $slaves[$i].inflationType = "food", $slaves[$i].inflationMethod = 1>> + <<if _slave.inflation == 0>> + <<if _slave.pregKnown == 0 && _slave.bellyImplant < 1500>> + <<set _slave.inflation = 3, _slave.inflationType = "food", _slave.inflationMethod = 1>> <<else>> - <<set $slaves[$i].inflation = 1, $slaves[$i].inflationType = "food", $slaves[$i].inflationMethod = 1>> + <<set _slave.inflation = 1, _slave.inflationType = "food", _slave.inflationMethod = 1>> <</if>> - <<run SetBellySize($slaves[$i])>> + <<run SetBellySize(_slave)>> <</if>> <<default>> - <<set $slaves[$i].rules.living = "spare">> - <<if ($slaves[$i].inflation > 0)>> - <<set $slaves[$i].inflation = 0, $slaves[$i].inflationType = "none", $slaves[$i].inflationMethod = 0, $slaves[$i].milkSource = 0>> - <<run SetBellySize($slaves[$i])>> + <<set _slave.rules.living = "spare">> + <<if (_slave.inflation > 0)>> + <<set _slave.inflation = 0, _slave.inflationType = "none", _slave.inflationMethod = 0, _slave.milkSource = 0>> + <<run SetBellySize(_slave)>> <</if>> <</switch>> <<if $cellblockUpgrade == 1>> - <<if ($slaves[$i].behavioralFlaw != "none") && ($slaves[$i].behavioralQuirk == "none")>> - <<run SoftenBehavioralFlaw($slaves[$i])>> - <<set $slaves[$i].devotion -= 10, _softenedQuirks++>> - <<elseif ($slaves[$i].sexualFlaw != "none") && ($slaves[$i].sexualQuirk == "none")>> - <<run SoftenSexualFlaw($slaves[$i])>> - <<set $slaves[$i].devotion -= 10, _softenedQuirks++>> + <<if (_slave.behavioralFlaw != "none") && (_slave.behavioralQuirk == "none")>> + <<run SoftenBehavioralFlaw(_slave)>> + <<set _slave.devotion -= 10, _softenedQuirks++>> + <<elseif (_slave.sexualFlaw != "none") && (_slave.sexualQuirk == "none")>> + <<run SoftenSexualFlaw(_slave)>> + <<set _slave.devotion -= 10, _softenedQuirks++>> <</if>> <</if>> - <<set $slaves[$i].devotion += _devBonus, $slaves[$i].trust -= _trustMalus>> - <<if ($Wardeness != 0) && ($Wardeness.sexualFlaw == "malicious") && ($slaves[$i].energy >= 2)>> - <<set $slaves[$i].energy -= 2>> + <<set _slave.devotion += _devBonus, _slave.trust -= _trustMalus>> + <<if ($Wardeness != 0) && ($Wardeness.sexualFlaw == "malicious") && (_slave.energy >= 2)>> + <<set _slave.energy -= 2>> <</if>> - <<if ($slaves[$i].health.condition < -80)>> - <<run improveCondition($slaves[$i], 20)>> - <<elseif ($slaves[$i].health.condition < -40)>> - <<run improveCondition($slaves[$i], 15)>> - <<elseif ($slaves[$i].health.condition < 0)>> - <<run improveCondition($slaves[$i], 10)>> - <<elseif ($slaves[$i].health.condition < 40)>> - <<run improveCondition($slaves[$i], 7)>> - <<elseif ($slaves[$i].health.condition < 100)>> - <<run improveCondition($slaves[$i], 3)>> + <<if (_slave.health.condition < -80)>> + <<run improveCondition(_slave, 20)>> + <<elseif (_slave.health.condition < -40)>> + <<run improveCondition(_slave, 15)>> + <<elseif (_slave.health.condition < 0)>> + <<run improveCondition(_slave, 10)>> + <<elseif (_slave.health.condition < 40)>> + <<run improveCondition(_slave, 7)>> + <<elseif (_slave.health.condition < 100)>> + <<run improveCondition(_slave, 3)>> <</if>> <<if $showEWD != 0>> <br><br> /* 000-250-006 */ <<if $seeImages && $seeReportImages>> <div class="imageRef tinyImg"> - <<= SlaveArt($slaves[$i], 0, 0)>> + <<= SlaveArt(_slave, 0, 0)>> </div> <</if>> /* 000-250-006 */ - <span class='slave-name'><<= SlaveFullName($slaves[$i])>></span> - <<if $slaves[$i].choosesOwnAssignment == 2>> + <span class='slave-name'><<= SlaveFullName(_slave)>></span> + <<if _slave.choosesOwnAssignment == 2>> <<include "SA chooses own job">> <<else>> is confined in $cellblockName. <</if>> - <br> $He <<= App.SlaveAssignment.stayConfined($slaves[$i])>> + <br> $He <<= App.SlaveAssignment.stayConfined(_slave)>> <br> <<include "SA rules">> <<include "SA diet">> <<include "SA long term effects">> - <<= App.SlaveAssignment.drugs($slaves[$i])>> + <<= App.SlaveAssignment.drugs(_slave)>> <<include "SA relationships">> <<include "SA rivalries">> <br><<include "SA devotion">> <<else>> <<silently>> <<include "SA chooses own job">> - <<run App.SlaveAssignment.stayConfined($slaves[$i])>> + <<run App.SlaveAssignment.stayConfined(_slave)>> <<include "SA rules">> <<include "SA diet">> <<include "SA long term effects">> - <<run App.SlaveAssignment.drugs($slaves[$i])>> + <<run App.SlaveAssignment.drugs(_slave)>> <<include "SA relationships">> <<include "SA rivalries">> <<include "SA devotion">> diff --git a/src/uncategorized/clinic.tw b/src/uncategorized/clinic.tw index ee8cf5a1f0611cdef56aeb6af953547bc5391c70..9398239decdc54311fab1017eb1e67ddad05c54d 100644 --- a/src/uncategorized/clinic.tw +++ b/src/uncategorized/clinic.tw @@ -1,6 +1,6 @@ :: Clinic [nobr] -<<set $nextButton = "Back to Main", $nextLink = "Main", $returnTo = "Clinic", $showEncyclopedia = 1, $encyclopedia = "Clinic", _CL = $CliniciIDs.length>> +<<set $nextButton = "Back to Main", $nextLink = "Main", $returnTo = "Clinic", $showEncyclopedia = 1, $encyclopedia = "Clinic", _CL = App.Entity.facilities.clinic.employeesIDs().size>> <<if $clinicName != "the Clinic">> <<set $clinicNameCaps = $clinicName.replace("the ", "The ")>> diff --git a/src/uncategorized/clinicReport.tw b/src/uncategorized/clinicReport.tw index 81d162a7377a4412934715f73ec48932be7bedc4..595ad6ae31998f92d53b10888b5417df9411a07d 100644 --- a/src/uncategorized/clinicReport.tw +++ b/src/uncategorized/clinicReport.tw @@ -1,7 +1,7 @@ :: Clinic Report [nobr] -<<SlaveIDSort $CliniciIDs>> -<<set _DL = $CliniciIDs.length, _SL = $slaves.length, _healthBonus = 0, _idleBonus = 0, _FLsFetish = 0, _restedSlaves = 0>> +<<set _slaves = App.Utils.sortedEmployees(App.Entity.facilities.clinic)>> +<<set _DL = _slaves.length, _SL = $slaves.length, _healthBonus = 0, _idleBonus = 0, _FLsFetish = 0, _restedSlaves = 0>> <<if $clinicDecoration != "standard">> <<set _devBonus = 1>> @@ -78,40 +78,40 @@ <<if ($slaves[_FLs].devotion >= 60)>> <<set _healthBonus++>> <</if>> - <<for _dI = 0; _dI < _DL; _dI++>> - <<set $i = $slaveIndices[$CliniciIDs[_dI]]>> - <<if $Nurse.rivalryTarget == $slaves[$i].ID>> - <<setLocalPronouns $slaves[$i] 2>> - $He purposefully neglects the needs of $his <<print rivalryTerm($Nurse)>>, $slaves[$i].slaveName, hindering _his2 recovery and deepening their dislike for each other. - <<set $slaves[$i].devotion--, $slaves[$i].trust-->> - <<run healthDamage($slaves[$i], 3)>> + <<for _slave range _slaves>> + <<set $i = $slaveIndices[_slave.ID]>> + <<if $Nurse.rivalryTarget == _slave.ID>> + <<setLocalPronouns _slave 2>> + $He purposefully neglects the needs of $his <<print rivalryTerm($Nurse)>>, _slave.slaveName, hindering _his2 recovery and deepening their dislike for each other. + <<set _slave.devotion--, _slave.trust-->> + <<run healthDamage(_slave, 3)>> <<if random(1,100) > 65>> - <<set $Nurse.rivalry++, $slaves[_FLs].rivalry++, $slaves[$i].rivalry++>> + <<set $Nurse.rivalry++, $slaves[_FLs].rivalry++, _slave.rivalry++>> <</if>> - <<elseif $Nurse.relationshipTarget == $slaves[$i].ID>> - <<setLocalPronouns $slaves[$i] 2>> - $He dedicates most of $his attention to $his <<print relationshipTerm($Nurse)>>, $slaves[$i].slaveName, making sure _he2 has everything _he2 needs and more. This lavish attention detracts from $his overall effectiveness. - <<set _idleBonus -= 3, $slaves[$i].devotion++, $slaves[$i].trust++>> - <<run improveCondition($slaves[$i], 3)>> - <<elseif areRelated($Nurse, $slaves[$i])>> - $He makes sure to spend extra time caring for $his <<print relativeTerm($Nurse,$slaves[$i])>>, $slaves[$i].slaveName. - <<set $slaves[$i].trust++>> - <<run improveCondition($slaves[$i], 1)>> + <<elseif $Nurse.relationshipTarget == _slave.ID>> + <<setLocalPronouns _slave 2>> + $He dedicates most of $his attention to $his <<print relationshipTerm($Nurse)>>, _slave.slaveName, making sure _he2 has everything _he2 needs and more. This lavish attention detracts from $his overall effectiveness. + <<set _idleBonus -= 3, _slave.devotion++, _slave.trust++>> + <<run improveCondition(_slave, 3)>> + <<elseif areRelated($Nurse, _slave)>> + $He makes sure to spend extra time caring for $his <<print relativeTerm($Nurse,_slave)>>, _slave.slaveName. + <<set _slave.trust++>> + <<run improveCondition(_slave, 1)>> <</if>> - <<switch $slaves[$i].prestigeDesc>> + <<switch _slave.prestigeDesc>> <<case "$He is a famed Free Cities whore, and commands top prices.">> - <<setLocalPronouns $slaves[$i] 2>> - $He does $his best to aid the famous whore, $slaves[$i].slaveName, making sure to pay special attention to _his2 worn holes. - <<run improveCondition($slaves[$i], 2)>> + <<setLocalPronouns _slave 2>> + $He does $his best to aid the famous whore, _slave.slaveName, making sure to pay special attention to _his2 worn holes. + <<run improveCondition(_slave, 2)>> <<case "$He is a famed Free Cities slut, and can please anyone.">> - <<setLocalPronouns $slaves[$i] 2>> - $He does $his best to aid the famous entertainer, $slaves[$i].slaveName, making sure _he2 can show off as soon as possible. - <<run improveCondition($slaves[$i], 2)>> + <<setLocalPronouns _slave 2>> + $He does $his best to aid the famous entertainer, _slave.slaveName, making sure _he2 can show off as soon as possible. + <<run improveCondition(_slave, 2)>> <<case "$He is remembered for winning best in show as a cockmilker.">> - <<setLocalPronouns $slaves[$i] 2>> - <<if ($slaves[$i].balls > 4) && ($slaves[$i].dick != 0)>> - $He does $his best to aid the dribbling $slaves[$i].slaveName, paying special attention to _his2 huge cock and balls as well as making sure to milk _his2 <<if canAchieveErection($slaves[$i])>>erect <</if>>dick hourly. - <<run improveCondition($slaves[$i], 4)>> + <<setLocalPronouns _slave 2>> + <<if (_slave.balls > 4) && (_slave.dick != 0)>> + $He does $his best to aid the dribbling _slave.slaveName, paying special attention to _his2 huge cock and balls as well as making sure to milk _his2 <<if canAchieveErection(_slave)>>erect <</if>>dick hourly. + <<run improveCondition(_slave, 4)>> <<if (random(1,100) > 65) && (($Nurse.fetish == "none") || ($Nurse.fetish == "cumslut"))>> <<if $Nurse.fetish == "none">> <<set $Nurse.fetish = "cumslut", $slaves[_FLs].fetish = "cumslut">> @@ -121,11 +121,11 @@ <</if>> <</if>> <<case "$He is remembered for winning best in show as a dairy cow.">> - <<setLocalPronouns $slaves[$i] 2>> - <<if ($slaves[$i].lactation > 0) && (($slaves[$i].boobs-$slaves[$i].boobsImplant) > 6000)>> - $He does $his best to aid the leaking $slaves[$i].slaveName, paying special attention to _his2 huge breasts as well as making sure to milk _him2 hourly. - <<run improveCondition($slaves[$i], 4)>> - <<set $slaves[$i].lactationDuration = 2, $slaves[$i].boobs -= $slaves[$i].boobsMilk, $slaves[$i].boobsMilk = 0>> + <<setLocalPronouns _slave 2>> + <<if (_slave.lactation > 0) && ((_slave.boobs-_slave.boobsImplant) > 6000)>> + $He does $his best to aid the leaking _slave.slaveName, paying special attention to _his2 huge breasts as well as making sure to milk _him2 hourly. + <<run improveCondition(_slave, 4)>> + <<set _slave.lactationDuration = 2, _slave.boobs -= _slave.boobsMilk, _slave.boobsMilk = 0>> <<if (random(1,100) > 65) && (($Nurse.fetish == "none") || ($Nurse.fetish == "boobs"))>> <<if $Nurse.fetish == "none">> <<set $Nurse.fetish = "boobs", $slaves[_FLs].fetish = "boobs">> @@ -135,52 +135,52 @@ <</if>> <</if>> <<case "$He is remembered for winning best in show as a breeder.">> - <<setLocalPronouns $slaves[$i] 2>> - <<if $slaves[$i].bellyPreg >= 1500>> - $He does $his best to aid the pregnant $slaves[$i].slaveName, paying special attention to _his2 swollen belly and the welfare of the life within. - <<run improveCondition($slaves[$i], 6)>> - <<elseif $slaves[$i].ovaries == 1 || $slaves[$i].mpreg == 1>> - $He does $his best to aid the breeder $slaves[$i].slaveName, paying special attention to _his2 fertility and reproductive organs. - <<run improveCondition($slaves[$i], 4)>> + <<setLocalPronouns _slave 2>> + <<if _slave.bellyPreg >= 1500>> + $He does $his best to aid the pregnant _slave.slaveName, paying special attention to _his2 swollen belly and the welfare of the life within. + <<run improveCondition(_slave, 6)>> + <<elseif _slave.ovaries == 1 || _slave.mpreg == 1>> + $He does $his best to aid the breeder _slave.slaveName, paying special attention to _his2 fertility and reproductive organs. + <<run improveCondition(_slave, 4)>> <<else>> - $He lays out plans on how to restore the breeder $slaves[$i].slaveName to _his2 former gravid glory. + $He lays out plans on how to restore the breeder _slave.slaveName to _his2 former gravid glory. <</if>> <</switch>> - <<if $slaves[$i].bellyImplant > -1 && $clinicInflateBelly == 1>> - <<setLocalPronouns $slaves[$i] 2>> - <br>''@@.pink;$slaves[$i].slaveName@@'' spent a lot of time during the week under IV-like stands with bags of inert filler steadily flowing into _his2 belly implant, slowly pushing _his2 belly further and further out. Careful attention, along with several drug injections, were used to make sure _his2 body was able to safely adjust to the implant's rapid growth. - <<run healthDamage($slaves[$i], 10)>> - <<set $slaves[$i].bellyImplant += 5000>> - <<if ($slaves[$i].devotion > 50)>> - <<set $slaves[$i].devotion += 4, $slaves[$i].trust += 3>> - <<elseif ($slaves[$i].devotion >= -20)>> - <<set $slaves[$i].trust -= 5>> + <<if _slave.bellyImplant > -1 && $clinicInflateBelly == 1>> + <<setLocalPronouns _slave 2>> + <br>''@@.pink;_slave.slaveName@@'' spent a lot of time during the week under IV-like stands with bags of inert filler steadily flowing into _his2 belly implant, slowly pushing _his2 belly further and further out. Careful attention, along with several drug injections, were used to make sure _his2 body was able to safely adjust to the implant's rapid growth. + <<run healthDamage(_slave, 10)>> + <<set _slave.bellyImplant += 5000>> + <<if (_slave.devotion > 50)>> + <<set _slave.devotion += 4, _slave.trust += 3>> + <<elseif (_slave.devotion >= -20)>> + <<set _slave.trust -= 5>> <<else>> - <<set $slaves[$i].devotion -= 5, $slaves[$i].trust -= 10>> + <<set _slave.devotion -= 5, _slave.trust -= 10>> <</if>> - <<if $slaves[$i].bellyImplant > ($arcologies[0].FSTransformationFetishistResearch ? 800000 : 130000)>> - <<set $slaves[$i].bellyImplant = ($arcologies[0].FSTransformationFetishistResearch ? 800000 : 130000)>> + <<if _slave.bellyImplant > ($arcologies[0].FSTransformationFetishistResearch ? 800000 : 130000)>> + <<set _slave.bellyImplant = ($arcologies[0].FSTransformationFetishistResearch ? 800000 : 130000)>> _He2 is filled to the maximum that _his2 implant can stand. <</if>> <</if>> - <<if $slaves[$i].pregKnown == 1 && $slaves[$i].preg < $slaves[$i].pregData.normalBirth && $slaves[$i].pregControl == "speed up">> - <<setLocalPronouns $slaves[$i] 2>> - <br>''@@.pink;$slaves[$i].slaveName@@'' spends most of _his2 time on bedrest being filled with rapid gestation agents and concentrated slave food. All _he2 can do is <<if hasAnyArms($slaves[$i]) && canSee($slaves[$i])>>watch and feel _his2 belly pushing further and further out with life<<elseif canSee($slaves[$i])>>watch _his2 belly bulging further and further out with life<<elseif hasAnyArms($slaves[$i])>>feel _his2 belly pushing further and further out with life beneath _his2 fingers<<else>>feel the every growing pressure inside _his2 abdomen<</if>>. Careful attention, along with numerous drug injections, are used to make sure _his2 body is able to safely adjust to _his2 pregnancy's rapid growth. - <<run healthDamage($slaves[$i], 10)>> - <<if ($slaves[$i].devotion > 50)>> - <<set $slaves[$i].devotion += 2, $slaves[$i].trust += 1>> - <<elseif ($slaves[$i].devotion >= -20)>> - <<set $slaves[$i].trust -= 5>> + <<if _slave.pregKnown == 1 && _slave.preg < _slave.pregData.normalBirth && _slave.pregControl == "speed up">> + <<setLocalPronouns _slave 2>> + <br>''@@.pink;_slave.slaveName@@'' spends most of _his2 time on bedrest being filled with rapid gestation agents and concentrated slave food. All _he2 can do is <<if hasAnyArms(_slave) && canSee(_slave)>>watch and feel _his2 belly pushing further and further out with life<<elseif canSee(_slave)>>watch _his2 belly bulging further and further out with life<<elseif hasAnyArms(_slave)>>feel _his2 belly pushing further and further out with life beneath _his2 fingers<<else>>feel the every growing pressure inside _his2 abdomen<</if>>. Careful attention, along with numerous drug injections, are used to make sure _his2 body is able to safely adjust to _his2 pregnancy's rapid growth. + <<run healthDamage(_slave, 10)>> + <<if (_slave.devotion > 50)>> + <<set _slave.devotion += 2, _slave.trust += 1>> + <<elseif (_slave.devotion >= -20)>> + <<set _slave.trust -= 5>> <<else>> - <<set $slaves[$i].devotion -= 5, $slaves[$i].trust -= 10>> + <<set _slave.devotion -= 5, _slave.trust -= 10>> <</if>> - <<if $slaves[$i].preg >= $slaves[$i].pregData.minLiveBirth && $slaves[$i].pregControl == "speed up">> - <<set $slaves[$i].pregControl = "none">> - ''@@.pink;$slaves[$i].slaveName's@@'' child is ready to pop out of _his2 womb, ''@@.yellow;_his2 course of rapid gestation agents is finished@@''. + <<if _slave.preg >= _slave.pregData.minLiveBirth && _slave.pregControl == "speed up">> + <<set _slave.pregControl = "none">> + ''@@.pink;_slave.slaveName's@@'' child is ready to pop out of _his2 womb, ''@@.yellow;_his2 course of rapid gestation agents is finished@@''. <</if>> - <<elseif $slaves[$i].preg > 2 && $slaves[$i].pregKnown == 0>> - During $his tests, $he discovers that $slaves[$i].slaveName @@.lime;is pregnant.@@ - <<set $slaves[$i].pregKnown = 1>> + <<elseif _slave.preg > 2 && _slave.pregKnown == 0>> + During $his tests, $he discovers that _slave.slaveName @@.lime;is pregnant.@@ + <<set _slave.pregKnown = 1>> <</if>> <</for>> <<if (_DL < $clinic)>> @@ -233,90 +233,90 @@ <<set $Nurse = $slaves[_FLs]>> <</if>> -<<for _dI = 0; _dI < _DL; _dI++>> - <<set $i = $slaveIndices[$CliniciIDs[_dI]]>> - <<setLocalPronouns $slaves[$i]>> +<<for _slave range _slaves>> + <<set $i = $slaveIndices[_slave.ID]>> + <<setLocalPronouns _slave>> - <<if $slaves[$i].devotion < 45>> - <<set $slaves[$i].devotion += 4>> + <<if _slave.devotion < 45>> + <<set _slave.devotion += 4>> <</if>> - <<set $slaves[$i].devotion += _devBonus>> - <<if $slaves[$i].trust < 45>> - <<set $slaves[$i].trust += 4>> + <<set _slave.devotion += _devBonus>> + <<if _slave.trust < 45>> + <<set _slave.trust += 4>> <</if>> - <<if ($slaves[$i].health.condition < -80)>> - <<run improveCondition($slaves[$i], (20 + ($curativeUpgrade * 10) + _healthBonus))>> - <<elseif ($slaves[$i].health.condition < -40)>> - <<run improveCondition($slaves[$i], (10 + ($curativeUpgrade * 7) + _healthBonus))>> - <<elseif ($slaves[$i].health.condition < 0)>> - <<run improveCondition($slaves[$i], (7 + ($curativeUpgrade * 5) + _healthBonus))>> - <<elseif ($slaves[$i].health.condition < 90)>> - <<run improveCondition($slaves[$i], (3 + ($curativeUpgrade * 3) + _healthBonus))>> + <<if (_slave.health.condition < -80)>> + <<run improveCondition(_slave, (20 + ($curativeUpgrade * 10) + _healthBonus))>> + <<elseif (_slave.health.condition < -40)>> + <<run improveCondition(_slave, (10 + ($curativeUpgrade * 7) + _healthBonus))>> + <<elseif (_slave.health.condition < 0)>> + <<run improveCondition(_slave, (7 + ($curativeUpgrade * 5) + _healthBonus))>> + <<elseif (_slave.health.condition < 90)>> + <<run improveCondition(_slave, (3 + ($curativeUpgrade * 3) + _healthBonus))>> <</if>> /* the clinic is a well-equipped medical facility and can allow the Nurse or player to * directly cure serious wounds caused by injury and surgery with minimal side effects */ - <<if $slaves[$i].health.shortDamage >= 10>> + <<if _slave.health.shortDamage >= 10>> <<if ($Nurse != 0)>> - <<run healthCure($slaves[$i], 5 + _healthBonus)>> + <<run healthCure(_slave, 5 + _healthBonus)>> <<else>> - <<run healthCure($slaves[$i], $PC.skill.medicine / 15)>> /* maximum of 6...even a bad full-time nurse will be better than a player doctor */ + <<run healthCure(_slave, $PC.skill.medicine / 15)>> /* maximum of 6...even a bad full-time nurse will be better than a player doctor */ <</if>> <</if>> <<switch $clinicDecoration>> <<case "Eugenics" "Gender Fundamentalist" "Gender Radicalist" "Hedonistic" "Intellectual Dependency" "Maturity Preferentialist" "Paternalist" "Petite Admiration" "Repopulation Focus" "Slimness Enthusiast" "Statuesque Glorification" "Youth Preferentialist">> - <<set $slaves[$i].rules.living = "luxurious">> + <<set _slave.rules.living = "luxurious">> <<case "Arabian Revivalist" "Aztec Revivalist" "Chattel Religionist" "Chinese Revivalist" "Edo Revivalist" "Egyptian Revivalist" "Roman Revivalist">> - <<set $slaves[$i].rules.living = "normal">> + <<set _slave.rules.living = "normal">> <<default>> - <<set $slaves[$i].rules.living = "spare">> + <<set _slave.rules.living = "spare">> <</switch>> <<if ($Nurse != 0)>> - <<if ($clinicSpeedGestation == 1) && ($slaves[$i].pregKnown == 1)>> - <<set $slaves[$i].pregControl = "speed up">> + <<if ($clinicSpeedGestation == 1) && (_slave.pregKnown == 1)>> + <<set _slave.pregControl = "speed up">> <</if>> - <<if ($slaves[$i].chem > 10) && ($clinicUpgradeFilters >= 1)>> - <<if $slaves[$i].health.health > -50 && ($clinicUpgradePurge > 0)>> - <<set $slaves[$i].chem -= 100 * $clinicUpgradePurge>> - <<run healthDamage($slaves[$i], 15)>> + <<if (_slave.chem > 10) && ($clinicUpgradeFilters >= 1)>> + <<if _slave.health.health > -50 && ($clinicUpgradePurge > 0)>> + <<set _slave.chem -= 100 * $clinicUpgradePurge>> + <<run healthDamage(_slave, 15)>> <</if>> - <<set $slaves[$i].chem = Math.max($slaves[$i].chem - 5, 0)>> + <<set _slave.chem = Math.max(_slave.chem - 5, 0)>> <</if>> - <<if $slaves[$i].lactation == 1>> - <<set $slaves[$i].boobs -= $slaves[$i].boobsMilk, $slaves[$i].boobsMilk = 0>> + <<if _slave.lactation == 1>> + <<set _slave.boobs -= _slave.boobsMilk, _slave.boobsMilk = 0>> <</if>> <</if>> - <<if ($slaves[$i].health.illness > 0)>> - <<elseif ($slaves[$i].health.shortDamage >= 20)>> /* shortDamage does no real harm, until it gets to 20 */ - <<elseif ($slaves[$i].health.condition <= 40)>> - <<elseif ($Nurse != 0) && ($slaves[$i].chem > 15) && ($clinicUpgradeFilters == 1)>> - <<elseif ($Nurse != 0) && ($slaves[$i].pregKnown == 1) && ($clinicSpeedGestation > 0 || $slaves[$i].pregControl == "speed up")>> - <<elseif ($Nurse != 0) && ($clinicObservePregnancy == 1) && ($slaves[$i].pregAdaptation*1000 < $slaves[$i].bellyPreg || $slaves[$i].preg > $slaves[$i].pregData.normalBirth/1.33)>> - <<elseif ($Nurse != 0) && ($clinicInflateBelly > 0) && ($slaves[$i].bellyImplant >= 0) && ($slaves[$i].bellyImplant <= ($arcologies[0].FSTransformationFetishistResearch ? 800000 : 130000))>> + <<if (_slave.health.illness > 0)>> + <<elseif (_slave.health.shortDamage >= 20)>> /* shortDamage does no real harm, until it gets to 20 */ + <<elseif (_slave.health.condition <= 40)>> + <<elseif ($Nurse != 0) && (_slave.chem > 15) && ($clinicUpgradeFilters == 1)>> + <<elseif ($Nurse != 0) && (_slave.pregKnown == 1) && ($clinicSpeedGestation > 0 || _slave.pregControl == "speed up")>> + <<elseif ($Nurse != 0) && ($clinicObservePregnancy == 1) && (_slave.pregAdaptation*1000 < _slave.bellyPreg || _slave.preg > _slave.pregData.normalBirth/1.33)>> + <<elseif ($Nurse != 0) && ($clinicInflateBelly > 0) && (_slave.bellyImplant >= 0) && (_slave.bellyImplant <= ($arcologies[0].FSTransformationFetishistResearch ? 800000 : 130000))>> <<else>> <p> - <span class="slave-name">$slaves[$i].slaveName</span> has been cured<<if ($Nurse != 0) && ($clinicUpgradeFilters == 1)>> and purified<</if>>, + <span class="slave-name">_slave.slaveName</span> has been cured<<if ($Nurse != 0) && ($clinicUpgradeFilters == 1)>> and purified<</if>>, <span class="noteworthy"> - <<if $assignmentRecords[$slaves[$i].ID]>> - <<set _oldJob = $assignmentRecords[$slaves[$i].ID]>> - <<= assignJobSafely($slaves[$i], _oldJob)>> - <<if $slaves[$i].choosesOwnAssignment === 1>> + <<if $assignmentRecords[_slave.ID]>> + <<set _oldJob = $assignmentRecords[_slave.ID]>> + <<= assignJobSafely(_slave, _oldJob)>> + <<if _slave.choosesOwnAssignment === 1>> and $he is resting before choosing another task. - <<elseif $slaves[$i].assignment === "rest">> + <<elseif _slave.assignment === "rest">> <<if _oldJob != "rest">> and since $he was unable to return to $his old task to <<print _oldJob>>, $his assignment has defaulted to rest. <<else>> so $he has returned to rest. <</if>> <<else>> - so $he goes back to <<print $slaves[$i].assignment>>. + so $he goes back to <<print _slave.assignment>>. <</if>> <<else>> so $his assignment has defaulted to rest. - <<= removeJob($slaves[$i], "get treatment in the clinic")>> + <<= removeJob(_slave, "get treatment in the clinic")>> <</if>> </span> </p> @@ -328,50 +328,50 @@ /* 000-250-006 */ <<if $seeImages && $seeReportImages>> <div class="imageRef tinyImg"> - <<= SlaveArt($slaves[$i], 0, 0)>> + <<= SlaveArt(_slave, 0, 0)>> </div> <</if>> /* 000-250-006 */ - <span class='slave-name'><<= SlaveFullName($slaves[$i])>></span> - <<if $slaves[$i].choosesOwnAssignment == 2>> + <span class='slave-name'><<= SlaveFullName(_slave)>></span> + <<if _slave.choosesOwnAssignment == 2>> <<include "SA chooses own job">> <<else>> is receiving treatment in $clinicName. <</if>> - <br> $He <<= App.SlaveAssignment.rest($slaves[$i])>> - <<if ($slaves[$i].health.illness > 0)>> + <br> $He <<= App.SlaveAssignment.rest(_slave)>> + <<if (_slave.health.illness > 0)>> $He stays in the clinic since $he is still sick. - <<elseif ($slaves[$i].health.condition <= 40)>> + <<elseif (_slave.health.condition <= 40)>> $He stays in the clinic since $his health is still poor. - <<elseif ($slaves[$i].health.shortDamage >= 20)>> + <<elseif (_slave.health.shortDamage >= 20)>> $He stays in the clinic to recover from $his injuries. - <<elseif ($Nurse != 0) && ($slaves[$i].chem > 15) && ($clinicUpgradeFilters == 1)>> + <<elseif ($Nurse != 0) && (_slave.chem > 15) && ($clinicUpgradeFilters == 1)>> $He stays in the clinic as unhealthy chemicals are still being flushed from $his system. - <<elseif ($Nurse != 0) && ($slaves[$i].pregKnown == 1) && ($clinicSpeedGestation > 0 || $slaves[$i].pregControl == "speed up")>> + <<elseif ($Nurse != 0) && (_slave.pregKnown == 1) && ($clinicSpeedGestation > 0 || _slave.pregControl == "speed up")>> $He stays in the clinic to hurry $his pregnancy along safely. - <<elseif ($Nurse != 0) && ($clinicInflateBelly > 0) && ($slaves[$i].bellyImplant >= 0) && ($slaves[$i].bellyImplant <= ($arcologies[0].FSTransformationFetishistResearch ? 800000 : 130000))>> + <<elseif ($Nurse != 0) && ($clinicInflateBelly > 0) && (_slave.bellyImplant >= 0) && (_slave.bellyImplant <= ($arcologies[0].FSTransformationFetishistResearch ? 800000 : 130000))>> $He stays in the clinic as $his implants can still receive more filling. - <<elseif ($Nurse != 0) && ($clinicObservePregnancy == 1) && ($slaves[$i].pregAdaptation*1000 < $slaves[$i].bellyPreg || $slaves[$i].preg > $slaves[$i].pregData.normalBirth/1.33)>> + <<elseif ($Nurse != 0) && ($clinicObservePregnancy == 1) && (_slave.pregAdaptation*1000 < _slave.bellyPreg || _slave.preg > _slave.pregData.normalBirth/1.33)>> $He stays in the clinic waiting for the child to be born. <</if>> <br> - <<= App.SlaveAssignment.choosesOwnClothes($slaves[$i])>> + <<= App.SlaveAssignment.choosesOwnClothes(_slave)>> <<include "SA rules">> <<include "SA diet">> <<include "SA long term effects">> - <<= App.SlaveAssignment.drugs($slaves[$i])>> + <<= App.SlaveAssignment.drugs(_slave)>> <<include "SA relationships">> <<include "SA rivalries">> <br><<include "SA devotion">> <<else>> <<silently>> <<include "SA chooses own job">> - <<run App.SlaveAssignment.rest($slaves[$i])>> - <<run App.SlaveAssignment.choosesOwnClothes($slaves[$i])>> + <<run App.SlaveAssignment.rest(_slave)>> + <<run App.SlaveAssignment.choosesOwnClothes(_slave)>> <<include "SA rules">> <<include "SA diet">> <<include "SA long term effects">> - <<run App.SlaveAssignment.drugs($slaves[$i])>> + <<run App.SlaveAssignment.drugs(_slave)>> <<include "SA relationships">> <<include "SA rivalries">> <<include "SA devotion">> diff --git a/src/uncategorized/club.tw b/src/uncategorized/club.tw index d5ee1248cd12cabbcb1866245ab5d5417465d2b7..72a274a2e3dfb49034bdc060e720955ea696394b 100644 --- a/src/uncategorized/club.tw +++ b/src/uncategorized/club.tw @@ -1,6 +1,6 @@ :: Club [nobr] -<<set $nextButton = "Back to Main", $nextLink = "Main", $returnTo = "Club", $showEncyclopedia = 1, $encyclopedia = "Club", _CL = $ClubiIDs.length>> +<<set $nextButton = "Back to Main", $nextLink = "Main", $returnTo = "Club", $showEncyclopedia = 1, $encyclopedia = "Club", _CL = App.Entity.facilities.club.employeesIDs().size>> <p class="scene-intro"> <<if $clubName != "the Club">> diff --git a/src/uncategorized/clubReport.tw b/src/uncategorized/clubReport.tw index 3e4830ffcc559db9f55e0f79c8b69360f3989c2d..930a6c113e0044a91fed43750ae0bb7eeed6f9b3 100644 --- a/src/uncategorized/clubReport.tw +++ b/src/uncategorized/clubReport.tw @@ -1,10 +1,9 @@ :: Club Report [nobr] -<span id="clubstats"> -</span> +<span id="clubstats" /> -<<SlaveIDSort $ClubiIDs>> -<<set _DL = $ClubiIDs.length, _SL = $slaves.length, $clubBonuses = 0, $legendaryEntertainerID = 0, _FLsFetish = 0>> +<<set _slaves = App.Utils.sortedEmployees(App.Entity.facilities.club)>> +<<set _DL = _slaves.length, _SL = $slaves.length, $clubBonuses = 0, $legendaryEntertainerID = 0, _FLsFetish = 0>> <<set $legendaryWombID = 0>> <<set _minBonus = 50, _maxBonus = 150>> @@ -145,39 +144,39 @@ <</if>> <<if (_DL > 0)>> - <<for _dI = 0; _dI < _DL; _dI++>> - <<set $i = $slaveIndices[$ClubiIDs[_dI]]>> - <<setLocalPronouns $slaves[$i]>> - <<if ($legendaryEntertainerID == 0) && ($slaves[$i].prestige == 0) && ($slaves[$i].skill.entertainment >= 100) && ($slaves[$i].devotion > 50)>> - <<set $legendaryEntertainerID = $slaves[$i].ID>> + <<for _slave range _slaves>> + <<set $i = $slaveIndices[_slave.ID]>> + <<setLocalPronouns _slave>> + <<if ($legendaryEntertainerID == 0) && (_slave.prestige == 0) && (_slave.skill.entertainment >= 100) && (_slave.devotion > 50)>> + <<set $legendaryEntertainerID = _slave.ID>> <</if>> - <<if ($legendaryWombID == 0) && (!isAmputee($slaves[$i])) && ($slaves[$i].preg > $slaves[$i].pregData.normalBirth/1.33) && ($slaves[$i].broodmother == 0) && ($slaves[$i].eggType == "human") && ($slaves[$i].counter.births > 10) && ($slaves[$i].devotion > 50) && ($slaves[$i].prestige == 0)>> - <<set $legendaryWombID = $slaves[$i].ID>> + <<if ($legendaryWombID == 0) && (!isAmputee(_slave)) && (_slave.preg > _slave.pregData.normalBirth/1.33) && (_slave.broodmother == 0) && (_slave.eggType == "human") && (_slave.counter.births > 10) && (_slave.devotion > 50) && (_slave.prestige == 0)>> + <<set $legendaryWombID = _slave.ID>> <</if>> - <<if ($slaves[$i].devotion <= 20) && ($slaves[$i].trust >= -20)>> - <<set $slaves[$i].devotion -= 5, $slaves[$i].trust -= 5>> - <<elseif ($slaves[$i].devotion < 45)>> - <<set $slaves[$i].devotion += 4>> - <<elseif ($slaves[$i].devotion > 50)>> - <<set $slaves[$i].devotion -= 4>> + <<if (_slave.devotion <= 20) && (_slave.trust >= -20)>> + <<set _slave.devotion -= 5, _slave.trust -= 5>> + <<elseif (_slave.devotion < 45)>> + <<set _slave.devotion += 4>> + <<elseif (_slave.devotion > 50)>> + <<set _slave.devotion -= 4>> <</if>> - <<if ($slaves[$i].trust < 30)>> - <<set $slaves[$i].trust += 5>> + <<if (_slave.trust < 30)>> + <<set _slave.trust += 5>> <</if>> - <<if ($slaves[$i].health.condition < -80)>> - <<run improveCondition($slaves[$i], 20)>> - <<elseif ($slaves[$i].health.condition < -40)>> - <<run improveCondition($slaves[$i], 15)>> - <<elseif ($slaves[$i].health.condition < 0)>> - <<run improveCondition($slaves[$i], 10)>> - <<elseif ($slaves[$i].health.condition < 90)>> - <<run improveCondition($slaves[$i], 7)>> + <<if (_slave.health.condition < -80)>> + <<run improveCondition(_slave, 20)>> + <<elseif (_slave.health.condition < -40)>> + <<run improveCondition(_slave, 15)>> + <<elseif (_slave.health.condition < 0)>> + <<run improveCondition(_slave, 10)>> + <<elseif (_slave.health.condition < 90)>> + <<run improveCondition(_slave, 7)>> <</if>> - <<if $slaves[$i].rules.living != "normal">> - <<set $slaves[$i].rules.living = "normal">> + <<if _slave.rules.living != "normal">> + <<set _slave.rules.living = "normal">> <</if>> <<if $showEWD != 0>> @@ -185,35 +184,35 @@ /* 000-250-006 */ <<if $seeImages && $seeReportImages>> <div class="imageRef tinyImg"> - <<= SlaveArt($slaves[$i], 0, 0)>> + <<= SlaveArt(_slave, 0, 0)>> </div> <</if>> /* 000-250-006 */ - <span class='slave-name'><<= SlaveFullName($slaves[$i])>></span> - <<if $slaves[$i].choosesOwnAssignment == 2>> + <span class='slave-name'><<= SlaveFullName(_slave)>></span> + <<if _slave.choosesOwnAssignment == 2>> <<include "SA chooses own job">> <<else>> is serving in $clubName. <</if>> - <br> $He <<= App.SlaveAssignment.serveThePublic($slaves[$i])>> + <br> $He <<= App.SlaveAssignment.serveThePublic(_slave)>> <br> - <<= App.SlaveAssignment.choosesOwnClothes($slaves[$i])>> + <<= App.SlaveAssignment.choosesOwnClothes(_slave)>> <<include "SA rules">> <<include "SA diet">> <<include "SA long term effects">> - <<= App.SlaveAssignment.drugs($slaves[$i])>> + <<= App.SlaveAssignment.drugs(_slave)>> <<include "SA relationships">> <<include "SA rivalries">> <br><<include "SA devotion">> <<else>> <<silently>> <<include "SA chooses own job">> - <<run App.SlaveAssignment.serveThePublic($slaves[$i])>> - <<run App.SlaveAssignment.choosesOwnClothes($slaves[$i])>> + <<run App.SlaveAssignment.serveThePublic(_slave)>> + <<run App.SlaveAssignment.choosesOwnClothes(_slave)>> <<include "SA rules">> <<include "SA diet">> <<include "SA long term effects">> - <<run App.SlaveAssignment.drugs($slaves[$i])>> + <<run App.SlaveAssignment.drugs(_slave)>> <<include "SA relationships">> <<include "SA rivalries">> <<include "SA devotion">> diff --git a/src/uncategorized/costsBudget.js b/src/uncategorized/costsBudget.js index 14cc0c03134a4ec8e61b784f9d01681b5e173dbe..3224707be519c0ed375fafc89c5e471212833b88 100644 --- a/src/uncategorized/costsBudget.js +++ b/src/uncategorized/costsBudget.js @@ -1,6 +1,6 @@ App.UI.Budget.Cost = function() { let el = document.createElement('p'); - let table = document.createElement("TABLE"); + let table = document.createElement("table"); table.classList.add("budget"); let node; let subNode; @@ -8,525 +8,6 @@ App.UI.Budget.Cost = function() { let array; let coloredRow = true; - /* Old way - // Set up profits column - V.lastWeeksCashProfits = new App.Data.Records.LastWeeksCash(); - - // HEADER / PENTHOUSE - let header = table.createTHead(); - let row = header.insertRow(0); - let th = document.createElement("th"); - let pent = document.createElement("h2"); - pent.textContent = "Penthouse"; - th.appendChild(pent); - row.appendChild(th); - - array = [ - "Income", - "Expense", - "Totals" - ]; - for (let th of array) { - let cell = document.createElement("th"); - cell.textContent = th; - row.appendChild(cell); - } - - let body = document.createElement('tbody'); - table.appendChild(body); - row = body.insertRow(); - // PENTHOUSE - generateRowsFromArray([ - [Job.WHORE, "Whores"], - ["rest", "Resting"], - ["houseServant", "House servants"], - ["publicServant", "Public servants"], - ["classes", "Classes"], - ["milked", "Milked"], - ["gloryhole", "Gloryhole"], - ]); - - - // STRUCTURES - createSectionHeader("Structures"); - - // Brothel - structureSetup(V.brothelNameCaps, "brothel", V.brothel, "Brothel", V.BrothiIDs.length); - generateRowsFromArray([ - ["whoreBrothel", "Brothel whores"] - ]); - - if (V.brothel) { - node = new DocumentFragment(); - node.appendChild( - App.UI.DOM.link( - "Brothel Ads", - () => { - V.nextButton = "Back to Budget"; - V.nextLink = "Costs Budget"; - }, - [], - "Brothel Advertisement" - ) - ); - } else { - node = document.createTextNode("Brothel Ads"); - } - generateRow("brothelAds", node); - - if (V.brothel) { - generateRow(""); - } - - // Club - structureSetup(V.clubNameCaps, "club", V.club, "Club", V.ClubiIDs.length); - - if (V.club) { - node = new DocumentFragment(); - node.appendChild( - App.UI.DOM.link( - "Club ads", - () => { - V.nextButton = "Back to Budget"; - V.nextLink = "Costs Budget"; - }, - [], - "Club Advertisement" - ) - ); - } else { - node = document.createTextNode(`${V.clubNameCaps} (${V.ClubiIDs.length} slaves)`); - } - generateRow("clubAds", node); - - if (V.club) { - generateRow(""); - } - - // Arcade - structureSetup(V.arcadeNameCaps, "arcade", V.arcade, "Arcade", V.ArcadeiIDs.length); - generateRowsFromArray([ - ["gloryholeArcade", "Arcade slaves"] - ]); - - if (V.arcade) { - generateRow(""); - } - - // Dairy - structureSetup(V.dairyNameCaps, "dairy", V.dairy, "Dairy", V.DairyiIDs.length); - generateRowsFromArray([ - ["milkedDairy", "Dairy cows"] - ]); - - if (V.dairy) { - generateRow(""); - } - - structureSetup("Servants' Quarters", "servantsQuarters", V.servantsQuarters, "Servants' Quarters", V.ServQiIDs.length); - - structureSetup("Master Suite", "masterSuite", V.masterSuite, "Master Suite", V.MastSiIDs.length); - - structureSetup(V.schoolroomNameCaps, "school", V.schoolroom, "Schoolroom", V.SchlRiIDs.length); - - structureSetup(V.spaNameCaps, "spa", V.spa, "Spa", V.SpaiIDs.length); - - structureSetup(V.clinicNameCaps, "clinic", V.clinic, "Clinic", V.CliniciIDs.length); - - structureSetup(V.cellblockNameCaps, "cellblock", V.cellblock, "Cellblock", V.CellBiIDs.length); - - structureSetup("Prosthetic Lab", "lab", V.researchLab.level, "Prosthetic Lab", "maintenance for "); - - structureSetup(V.incubatorNameCaps, "incubator", V.incubator, "Incubator", V.incubatorSlaves); - - structureSetup(V.nurseryNameCaps, "nursery", V.nursery, "Nursery", V.NurseryiIDs.length); - - structureSetup(V.farmyardNameCaps, "farmyard", V.farmyard, "Farmyard", V.FarmyardiIDs.length); - - structureSetup(V.pitNameCaps, "pit", V.pit, "Pit", V.fighterIDs.length); - - - // Weather - generateRowsFromArray([ - ["environment", "Environment"] - ]); - if (V.lastWeeksCashExpenses.weather < 0 && V.weatherCladding === 0) { - node = new DocumentFragment(); - node.append("Weather is causing "); - let span = document.createElement('span'); - span.className = "red"; - span.textContent = "expensive damage. "; - node.append(span); - node.append("Consider a protective "); - node.appendChild( - App.UI.DOM.link( - "upgrade", - () => { - V.nextButton = "Back to Budget"; - V.nextLink = "Costs Budget"; - }, - [], - "Manage Arcology" - ) - ); - } else { - node = document.createTextNode("Weather"); - } - - generateRow("weather", node); - - // SLAVES - createSectionHeader("Slaves"); - - node = App.UI.DOM.link( - "Slave maintenance", - () => { - V.nextButton = "Back to Budget"; - V.nextLink = "Costs Budget"; - }, - [], - "Costs Report Slaves" - ); - generateRow("slaveUpkeepUndefined", node); - - generateRowsFromArray([ - ["extraMilk", "Extra milk"], - ["slaveTransfer", "Selling/buying major slaves"], - - ]); - - node = new DocumentFragment(); - node.append("Menials: "); - node.appendChild( - App.UI.DOM.link( - "Assistant's ", - () => { - V.nextButton = "Back to Budget"; - V.nextLink = "Costs Budget"; - }, - [], - "Personal assistant options" - ) - ); - node.appendChild(document.createTextNode("flipping")); - generateRow("menialTransfer", node); - - node = new DocumentFragment(); - node.append("Fuckdolls: "); - node.appendChild( - App.UI.DOM.link( - "Assistant's ", - () => { - V.nextButton = "Back to Budget"; - V.nextLink = "Costs Budget"; - }, - [], - "Personal assistant options" - ) - ); - node.appendChild(document.createTextNode("flipping")); - generateRow("fuckdollsTransfer", node); - - node = new DocumentFragment(); - node.append("Bioreactors: "); - node.appendChild( - App.UI.DOM.link( - "Assistant's ", - () => { - V.nextButton = "Back to Budget"; - V.nextLink = "Costs Budget"; - }, - [], - "Personal assistant options" - ) - ); - node.appendChild(document.createTextNode("flipping")); - generateRow("menialBioreactorsTransfer", node); - - - generateRowsFromArray([ - ["babyTransfer", "Selling/buying babies"], - ]); - - node = App.UI.DOM.link( - "Menials", - () => { - V.nextButton = "Back to Budget"; - V.nextLink = "Costs Budget"; - }, - [], - "Buy Slaves" - ); - node.appendChild(document.createTextNode(": labor")); - generateRow("menialTrades", node); - - generateRowsFromArray([ - ["fuckdolls", "Menials: fuckdolls"], - ["menialBioreactors", "Menials: bioreactors"], - ["porn", "Porn"], - ]); - - node = App.UI.DOM.link( - "Recruiter", - () => { - V.nextButton = "Back to Budget"; - V.nextLink = "Costs Budget"; - }, - [], - "Recruiter Select" - ); - node.appendChild(document.createTextNode(": labor")); - generateRow("recruiter", node); - - generateRowsFromArray([ - ["menialRetirement", "Menials retiring"], - ["slaveMod", "Slave modification"], - ["slaveSurgery", "Slave surgery"], - ["birth", "Slave birth"], - ]); - - // FINANCE - createSectionHeader("Finance"); - - generateRowsFromArray([ - ["personalBusiness", "Personal business"] - ]); - - if (V.PC.rules.living === "luxurious") { - text = `Since you are accustomed to luxury, your personal living expenses are:`; - } else if (V.PC.rules.living === "normal") { - text = `Since you are used to living well, your personal living expenses are:`; - } else { - text = `Since you are used to a fairly normal life, your personal living expenses are:`; - } - - generateRowsFromArray([ - ["personalLivingExpenses", text] - ]); - - node = new DocumentFragment(); - node.append("Your training expenses "); - - switch (V.personalAttention) { - case "trading": - text = "Trading trainer"; - break; - case "warfare": - text = "Warfare trainer"; - break; - case "slaving": - text = "Slaving trainer"; - break; - case "engineering": - text = "Engineering trainer"; - break; - case "medicine": - text = "Medicine trainer"; - break; - case "hacking": - text = "Hacking trainer"; - break; - default: - text = ""; - } - - node.appendChild( - App.UI.DOM.link( - text, - () => { - V.nextButton = "Back to Budget"; - V.nextLink = "Costs Budget"; - }, - [], - "Personal Attention Select" - ) - ); - if (text !== "") { - node.append(" fees"); - } - - generateRow("PCtraining", node); - - generateRowsFromArray([ - ["PCmedical", "Your medical expenses"], - ["PCskills", "Your skills"] - ]); - - node = new DocumentFragment(); - node.append("Your "); - node.appendChild( - App.UI.DOM.link( - "rents", - () => { - V.nextButton = "Back to Budget"; - V.nextLink = "Costs Budget"; - }, - [], - "Manage Arcology" - ) - ); - if (V.lastWeeksCashExpenses.rents < 0) { - node.append(" and bribes"); - } - generateRow("rents", node); - - generateRowsFromArray([ - ["stocks", `Stock dividends on ${V.personalShares} / ${V.publicShares + V.personalShares} shares.`], - ["stocksTraded", "Stock trading"], - ["fines", "Fines"], - ["event", "Events"], - ["war", "Arcology conflict"], - ["capEx", "Capital expenses"], - ["cheating", "CHEATING"] - ]); - - // POLICIES - createSectionHeader("Policies"); - - node = App.UI.DOM.link( - "Policies", - () => { - V.nextButton = "Back to Budget"; - V.nextLink = "Costs Budget"; - }, - [], - "Policies" - ); - - generateRow("policies", node); - - if (V.secExpEnabled) { - node = App.UI.DOM.link( - "Edicts", - () => { - V.nextButton = "Back to Budget"; - V.nextLink = "Costs Budget"; - }, - [], - "edicts" - ); - } else { - node = document.createTextNode("Edicts"); - } - generateRow("edicts", node); - - node = App.UI.DOM.link( - "Society shaping", - () => { - V.nextButton = "Back to Budget"; - V.nextLink = "Costs Budget"; - }, - [], - "Future Society" - ); - - generateRow("futureSocieties", node); - - if (V.TSS.subsidize !== 0) { - text = ["The Slavegirl School", "branch campus influence"]; - } else if (V.GRI.subsidize !== 0) { - text = ["Growth Research Institute", "subsidiary lab influence"]; - } else if (V.SCP.subsidize !== 0) { - text = ["St. Claver Preparatory", "branch campus influence"]; - } else if (V.LDE.subsidize !== 0) { - text = ["L'Encole des Enculees", "branch campus influence"]; - } else if (V.TGA.subsidize !== 0) { - text = ["The Gymnasium-Academy", "branch campus influence"]; - } else if (V.TCR.subsidize !== 0) { - text = ["The Cattle Ranch", "branch campus influence"]; - } else if (V.HA.subsidize !== 0) { - text = ["Hippolyta Academy", "branch campus influence"]; - } else if (V.NUL.subsidize !== 0) { - text = ["Nueva Universidad de Libertad", "branch campus influence"]; - } else if (V.TFS.subsidize !== 0) { - text = ["The Futanari Sisters", "community influence"]; - } else if (V.TSS.schoolPresent === 1) { - text = ["The Slavegirl School", "branch campus upkeep"]; - } else if (V.GRI.schoolPresent === 1) { - text = ["Growth Research Institute", "subsidiary lab upkeep"]; - } else if (V.SCP.schoolPresent === 1) { - text = ["St. Claver Preparatory", "branch campus upkeep"]; - } else if (V.LDE.schoolPresent === 1) { - text = ["L'Encole des Enculees", "branch campus upkeep"]; - } else if (V.TGA.schoolPresent === 1) { - text = ["The Gymnasium-Academy", "branch campus upkeep"]; - } else if (V.TCR.schoolPresent === 1) { - text = ["The Cattle Ranch", "branch campus upkeep"]; - } else if (V.HA.schoolPresent === 1) { - text = ["Hippolyta Academy", "branch campus upkeep"]; - } else if (V.NUL.schoolPresent === 1) { - text = ["Nueva Universidad de Libertad", "branch campus upkeep"]; - } else { - text = ["Unknown school expense", ""]; - } - - node = new DocumentFragment(); - node.appendChild( - App.UI.DOM.link( - text[0], - () => { - V.nextButton = "Back to Budget"; - V.nextLink = "Costs Budget"; - }, - [], - "Policies" - ) - ); - node.append(" " + text[1]); - - generateRow("schoolBacking", node); - - - generateRowsFromArray([ - ["citizenOrphanage", `Education of ${V.citizenOrphanageTotal} of your slaves' children in citizen schools`], - ["privateOrphanage", `Private tutelage of ${V.privateOrphanageTotal} of your slaves' children`] - ]); - - node = document.createElement('div'); - node.append("Security: "); - if (V.barracks) { - node.appendChild( - App.UI.DOM.link( - V.mercenariesTitle, - () => { - V.nextButton = "Back to Budget"; - V.nextLink = "Costs Budget"; - }, - [], - "Barracks" - ) - ); - } else { - node.append("Mercenaries: "); - subNode = document.createElement('div'); - subNode.className = "red detail"; - subNode.textContent = "Cost increased by the lack of an armory to house them."; - node.appendChild(subNode); - } - - if ((V.PC.skill.warfare >= 100) || (V.PC.career === "arcology owner")) { - subNode = document.createElement('div'); - subNode.append("Cost reduced by your "); - - subSubNode = document.createElement('span'); - subSubNode.className = "springgreen"; - subSubNode.textContent = "mercenary contacts."; - subNode.appendChild(subSubNode); - node.appendChild(subNode); - } - - generateRow("mercenaries", node); - - text = "Peacekeepers"; // set up peacekeepers text a little early so I can fit it into the generateRowsFromArray() call - if (V.peacekeepers.undermining !== 0) { - text += ", including undermining"; - } - generateRowsFromArray([ - ["securityExpansion", "Security expansion"], - ["specialForces", "Special forces"], - ["peacekeepers", text] - ]); - */ // Set up object to track calculated displays const income = "lastWeeksCashIncome"; const expenses = "lastWeeksCashExpenses"; @@ -586,7 +67,7 @@ App.UI.Budget.Cost = function() { // HEAD GIRL // find passage name for HGSuite - generateRowGroup(V.HGSuiteNameCaps, "HEADGIRLSUITE", V.HGSuite, null, V.HGSuiteiIDs.length); + generateRowGroup(V.HGSuiteNameCaps, "HEADGIRLSUITE"); generateRowCategory("Head Girl", "slaveAssignmentHeadgirl"); generateRowCategory("Head Girl Fucktoys", "slaveAssignmentHeadgirlsuite"); @@ -596,11 +77,11 @@ App.UI.Budget.Cost = function() { // BODYGUARD // find passage name for Armory - generateRowGroup("Armory", "DOJO", V.dojo, null, null); + generateRowGroup("Armory", "DOJO"); generateRowCategory("Bodyguard", "slaveAssignmentBodyguard"); // CONCUBINE - generateRowGroup("Master Suite", "MASTERSUITE", V.masterSuite, "Master Suite", V.MastSiIDs.length); + generateRowGroup("Master Suite", "MASTERSUITE"); generateRowCategory("Master Suite Maintenance", "masterSuite"); generateRowCategory("Master Suite Concubine", "slaveAssignmentConcubine"); generateRowCategory("Master Suite Fucktoys", "slaveAssignmentMastersuite"); @@ -611,12 +92,12 @@ App.UI.Budget.Cost = function() { generateRowCategory("Agent's Partner", "slaveAssignmentAgentPartner"); // ARCADE - generateRowGroup(V.arcadeNameCaps, "ARCADE", V.arcade, "Arcade", V.ArcadeiIDs.length); + generateRowGroup(V.arcadeNameCaps, "ARCADE"); generateRowCategory("Arcade Maintenance", "arcade"); generateRowCategory("Arcade Fuckdolls", "slaveAssignmentArcade"); // BROTHEL - generateRowGroup(V.brothelNameCaps, "BROTHEL", V.brothel, "Brothel", V.BrothiIDs.length); + generateRowGroup(V.brothelNameCaps, "BROTHEL"); generateRowCategory("Brothel Maintenance", "brothel"); generateRowCategory("Brothel Madam", "slaveAssignmentMadam"); generateRowCategory("Brothel MadamVign", "slaveAssignmentMadamVign"); @@ -625,13 +106,13 @@ App.UI.Budget.Cost = function() { generateRowCategory("Brothel Ads", "brothelAds"); // CELLBLOCK - generateRowGroup(V.cellblockNameCaps, "CELLBLOCK", V.cellblock, "Cellblock", V.CellBiIDs.length); + generateRowGroup(V.cellblockNameCaps, "CELLBLOCK"); generateRowCategory("Cellblock Maintenance", "cellblock"); generateRowCategory("Cellblock Warden", "slaveAssignmentWarden"); generateRowCategory("Cellblock Slaves", "slaveAssignmentCellblock"); // CLUB - generateRowGroup(V.clubNameCaps, "CLUB", V.club, "Club", V.ClubiIDs.length); + generateRowGroup(V.clubNameCaps, "CLUB"); generateRowCategory("Club Maintenance", "club"); generateRowCategory("Club DJ", "slaveAssignmentDj"); generateRowCategory("Club DJVign", "slaveAssignmentDjVign"); @@ -640,63 +121,63 @@ App.UI.Budget.Cost = function() { generateRowCategory("Club Ads", "clubAds"); // CLINIC - generateRowGroup(V.clinicNameCaps, "CLINIC", V.club, "Club", V.ClubiIDs.length); + generateRowGroup(V.clinicNameCaps, "CLINIC"); generateRowCategory("Clinic Maintenance", "clinic"); generateRowCategory("Clinic Nurse", "slaveAssignmentNurse"); generateRowCategory("Clinic Slaves", "slaveAssignmentClinic"); // DAIRY - generateRowGroup(V.dairyNameCaps, "DAIRY", V.dairy, "Dairy", V.DairyiIDs.length); + generateRowGroup(V.dairyNameCaps, "DAIRY"); generateRowCategory("Dairy Maintenance", "dairy"); generateRowCategory("Dairy Milkmaid", "slaveAssignmentMilkmaid"); generateRowCategory("Dairy Cows", "slaveAssignmentDairy"); generateRowCategory("Dairy Cows", "slaveAssignmentDairyVign"); // FARMYARD - generateRowGroup(V.farmyardNameCaps, "FARMYARD", V.farmyard, "Farmyard", V.FarmyardiIDs.length); + generateRowGroup(V.farmyardNameCaps, "FARMYARD"); generateRowCategory("Farmyard Maintenance", "farmyard"); generateRowCategory("Farmyard Farmer", "slaveAssignmentFarmer"); generateRowCategory("Farmyard Farmhands", "slaveAssignmentFarmyard"); generateRowCategory("Farmyard FarmhandsVign", "slaveAssignmentFarmyardVign"); // INCUBATOR - generateRowGroup(V.incubatorNameCaps, "INCUBATOR", V.incubator, "Incubator", V.incubatorSlaves); + generateRowGroup(V.incubatorNameCaps, "INCUBATOR"); generateRowCategory("Incubator Maintenance", "incubator"); generateRowCategory("Incubator Babies", "incubatorSlaves"); // NURSERY - generateRowGroup(V.nurseryNameCaps, "NURSERY", V.nursery, "Nursery", V.NurseryiIDs.length); + generateRowGroup(V.nurseryNameCaps, "NURSERY"); generateRowCategory("Nursery Maintenance", "nursery"); generateRowCategory("Nursery Matron", "slaveAssignmentMatron"); generateRowCategory("Nursery Nannies", "slaveAssignmentNursery"); generateRowCategory("Nursery NanniesVign", "slaveAssignmentNurseryVign"); // PIT - generateRowGroup(V.pitNameCaps, "PIT", V.pit, "Pit", V.fighterIDs.length); + generateRowGroup(V.pitNameCaps, "PIT"); generateRowCategory("Pit Maintenance", "pit"); // PROSTHETIC LAB - generateRowGroup("Prosthetic Lab", "PROSTHETICLAB", V.researchLab.level, "Prosthetic Lab", null); + generateRowGroup("Prosthetic Lab", "PROSTHETICLAB"); generateRowCategory("Prosthetic Lab Maintenance", "lab"); generateRowCategory("Prostethic Lab Research", "labResearch"); generateRowCategory("Prostethic Lab Scientists", "labScientists"); generateRowCategory("Prostethic Lab Menials", "labMenials"); // SCHOOLROOM - generateRowGroup(V.schoolroomNameCaps, "SCHOOLROOM", V.schoolroom, "Schoolroom", V.SchlRiIDs.length); + generateRowGroup(V.schoolroomNameCaps, "SCHOOLROOM"); generateRowCategory("Schoolroom Maintenance", "school"); generateRowCategory("Schoolroom Teacher", "slaveAssignmentTeacher"); generateRowCategory("Schoolroom Students", "slaveAssignmentSchool"); // SERVANTS' QUARTERS - generateRowGroup(V.servantsQuartersNameCaps, "SERVANTSQUARTERS", V.servantsQuarters, "Servants' Quarters", V.ServQiIDs.length); + generateRowGroup(V.servantsQuartersNameCaps, "SERVANTSQUARTERS"); generateRowCategory("Servants' Quarters Maintenance", "servantsQuarters"); generateRowCategory("Servants' Quarters Steward", "slaveAssignmentSteward"); generateRowCategory("Servants' Quarters Servants", "slaveAssignmentQuarter"); generateRowCategory("Servants' Quarters ServantsVign", "slaveAssignmentQuarterVign"); // SPA - generateRowGroup(V.spaNameCaps, "SPA", V.spa, "Spa", V.SpaiIDs.length); + generateRowGroup(V.spaNameCaps, "SPA"); generateRowCategory("Spa Maintenance", "spa"); generateRowCategory("Spa Attendant", "slaveAssignmentAttendant"); generateRowCategory("Spa Slaves", "slaveAssignmentSpa"); @@ -873,7 +354,7 @@ App.UI.Budget.Cost = function() { } } - function generateRowGroup(title, group, structure, passage, occupancy) { + function generateRowGroup(title, group) { if (F[group].income || F[group].expenses || V.showAllEntries.costsBudget) { row = table.insertRow(); cell = row.insertCell(); diff --git a/src/uncategorized/dairy.tw b/src/uncategorized/dairy.tw index 3fc4745e1d5225b6e5361edddfbdb9d6a5ea4d61..a7583c5059fff13b31d0a505f7ead6eac434a75d 100644 --- a/src/uncategorized/dairy.tw +++ b/src/uncategorized/dairy.tw @@ -1,8 +1,8 @@ :: Dairy [nobr] -<<set $nextButton = "Back to Main", $nextLink = "Main", $returnTo = "Dairy", $showEncyclopedia = 1, $encyclopedia = "Dairy", _SL = $slaves.length, _DL = $DairyiIDs.length>> +<<set _slaves = App.Utils.sortedEmployees(App.Entity.facilities.dairy)>> +<<set $nextButton = "Back to Main", $nextLink = "Main", $returnTo = "Dairy", $showEncyclopedia = 1, $encyclopedia = "Dairy", _SL = $slaves.length, _DL = _slaves.length>> -<<SlaveIDSort $DairyiIDs>> <<if $dairyName != "the Dairy">> <<set $dairyNameCaps = $dairyName.replace("the ", "The ")>> <</if>> @@ -37,24 +37,29 @@ </p> <p> <<if $dairyPregSettingChanged == 1>> - <<for _Di = 0; _Di < _DL; _Di++>> - <<set _i = $slaveIndices[$DairyiIDs[_Di]]>> - <<setLocalPronouns $slaves[_i]>> - <<if ($slaves[_i].vagina > -1) && ($slaves[_i].vagina < 3)>> - $slaves[_i].slaveName's milking machine ejects $him, since it cannot fit the mandated dildo into $his tight cunt. - <<= removeJob($slaves[_i], "work in the dairy")>> - <<set _DL--, _Di-->> + <<set _purgedSlaves = false>> + <<for _slave range _slaves>> + <<setLocalPronouns _slave>> + <<if (_slave.vagina > -1) && (_slave.vagina < 3)>> + _slave.slaveName's milking machine ejects $him, since it cannot fit the mandated dildo into $his tight cunt. + <<= removeJob(_slave, Job.DAIRY)>> + <<set _purgedSlaves = true>> + <<continue>> <</if>> <<if ($dairyPregSetting > 0)>> - <<set WombCleanGenericReserve($slaves[_i], "incubator", 9999)>> - <<set WombCleanGenericReserve($slaves[_i], "nursery", 9999)>> - <<if (($slaves[_i].broodmother > 0) || ($slaves[_i].bellyImplant != -1))>> - $slaves[_i].slaveName's milking machine ejects $him, since it detected a foreign body in $his womb blocking its required functions. - <<= removeJob($slaves[_i], "work in the dairy")>> - <<set _DL--, _Di-->> + <<set WombCleanGenericReserve(_slave, "incubator", 9999)>> + <<set WombCleanGenericReserve(_slave, "nursery", 9999)>> + <<if ((_slave.broodmother > 0) || (_slave.bellyImplant != -1))>> + _slave.slaveName's milking machine ejects $him, since it detected a foreign body in $his womb blocking its required functions. + <<= removeJob(_slave, Job.DAIRY)>> + <<set _purgedSlaves = true>> <</if>> <</if>> <</for>> + <<if _purgedSlaves>> + <<set _slaves = App.Utils.sortedEmployees(App.Entity.facilities.dairy)>> + <<set _DL = _slaves.length>> + <</if>> In unison, the milking machines withdraw their dildos from the pregnant slaves' vaginas. The auxiliary drug injectors hiss as the slaves are filled with drugs that promote natural lubrication. The slaves begin to shift awkwardly as they feel their pussies begin to drool slick female fluids. Once a machine judges that its slave's cunt is sufficiently wet, it readies a gigantic dildo. The slaves cannot see their own groins, but as soon as the heads of the dildos touch their pussylips, they begin to <<if $dairyFeedersSetting < 2>> struggle instinctively against their restraints, and the more energetic ones begin to weep. @@ -74,15 +79,19 @@ </p> <p> <<if $dairyStimulatorsSettingChanged == 1>> - <<for _Di = 0; _Di < _DL; _Di++>> - <<set _i = $slaveIndices[$DairyiIDs[_Di]]>> - <<setLocalPronouns $slaves[_i]>> - <<if ($slaves[_i].anus < 3)>> - $slaves[_i].slaveName's milking machine ejects $him, since it cannot fit its massive anal dildo up $his tight asshole. - <<= removeJob($slaves[_i], "work in the dairy")>> - <<set _DL--, _Di-->> + <<set _purgedSlaves = false>> + <<for _slave range _slaves>> + <<if (_slave.anus < 3)>> + <<setLocalPronouns _slave> + _slave.slaveName's milking machine ejects $him, since it cannot fit its massive anal dildo up $his tight asshole. + <<= removeJob(_slave, Job.DAIRY)>> + <<set _purgedSlaves = true>> <</if>> <</for>> + <<if _purgedSlaves>> + <<set _slaves = App.Utils.sortedEmployees(App.Entity.facilities.dairy)>> + <<set _DL = _slaves.length>> + <</if>> In unison, the milking machines shove their dildos deep into slaves' anuses, ejaculating large quantities of lubricant deep inside their rectums. The slaves start in surprise at the sudden rush of warm slick fluid, and then relax as the phalli withdraw themselves from their butts. Their relief is short-lived, however, as their assholes are only empty for a moment. The reasonably sized dildos are replaced with dildos the size of horse cocks. As soon as the slaves feel the heads of these monstrous phalli press inexorably against their sphincters, <<if $dairyFeedersSetting < 2>> they begin to scream and struggle instinctively. As the constant assrape that will define their existences for the foreseeable future begins in earnest, their whining @@ -104,30 +113,38 @@ <p> <<if $dairyRestraintsSettingChanged == 1>> <<if $dairyRestraintsSetting == 1>> - <<for _Di = 0; _Di < _DL; _Di++>> - <<set _i = $slaveIndices[$DairyiIDs[_Di]]>> - <<setLocalPronouns $slaves[_i]>> - <<if ($slaves[_i].indentureRestrictions >= 2)>> - $slaves[_i].slaveName's milking machine declines to restrain $him, since $he is encoded as an indentured servant protected from restraint for milking. - <<= removeJob($slaves[_i], "work in the dairy")>> - <<set _DL--, _Di-->> + <<set _purgedSlaves = false>> + <<for _slave range _slaves>> + <<setLocalPronouns _slave>> + <<if (_slave.indentureRestrictions >= 2)>> + _slave.slaveName's milking machine declines to restrain $him, since $he is encoded as an indentured servant protected from restraint for milking. + <<= removeJob(_slave, Job.DAIRY)>> + <<set _purgedSlaves = true>> <</if>> <</for>> + <<if _purgedSlaves>> + <<set _slaves = App.Utils.sortedEmployees(App.Entity.facilities.dairy)>> + <<set _DL = _slaves.length>> + <</if>> The next cow to stumble over to a milking machine to be drained is gently but firmly embraced by its restraints, allowing it to suck _himU dry and violate _himU without any regard for _hisU feelings. Most of the cows accept this new wrinkle in their lives, since the restraints let them go afterward, and the milking machines bring temporary relief. Some, however, begin to regard the machines with concern. <<else>> The next cow to stumble over to a milking machine to be drained finds to _hisU surprise that _heU is not restrained while it sucks _himU dry. _HeU wiggles around experimentally, verifying that _heU is indeed free to pull _himselfU away from its ministrations if _heU wishes. There's little actual impact on the cows' behavior, since they still need the relief the machines offer. <</if>> <<elseif $dairyRestraintsSettingChanged == -1>> <<if $dairyRestraintsSetting == 1>> - <<for _Di = 0; _Di < _DL; _Di++>> - <<set _i = $slaveIndices[$DairyiIDs[_Di]]>> - <<setLocalPronouns $slaves[_i]>> - <<if ($slaves[_i].indentureRestrictions >= 1)>> - $slaves[_i].slaveName's milking machine declines to restrain $him, since $he is encoded as an indentured servant protected from being restrained for milking. - <<= removeJob($slaves[_i], "work in the dairy")>> - <<set _DL--, _Di-->> + <<set _purgedSlaves = false>> + <<for _slave range _slaves>> + <<if (_slave.indentureRestrictions >= 1)>> + <<setLocalPronouns _slave>> + _slave.slaveName's milking machine declines to restrain $him, since $he is encoded as an indentured servant protected from being restrained for milking. + <<= removeJob(_slave, "work in the dairy")>> + <<set _purgedSlaves = true>> <</if>> <</for>> + <<if _purgedSlaves>> + <<set _slaves = App.Utils.sortedEmployees(App.Entity.facilities.dairy)>> + <<set _DL = _slaves.length>> + <</if>> The next time a cow tries to get up after being milked, _heU finds to _hisU sudden terror that the machine will not let _himU go. It continues to add fluids to _hisU body, and remove them from _hisU nipples, ignoring _hisU mounting panic as _heU realizes that it's to be _hisU new partner and lover, on a level far more intimate than any possible human relationship. The other cows approach their machines with trepidation, but the mounting pressure in their udders forces them to embrace their immurement despite their terror. <<else>> The next time a cow finishes an intensive milking period, _hisU restraints loosen. _HeU does not move for a long time, as though _heU is unable to believe that _heU is, at least in an immediate and local sense, free. Finally, _heU prises _himselfU out of _hisU milking machine's embrace, thick strings of fluid leading from it to _hisU orifices as _heU pulls each one off of its corresponding port. diff --git a/src/uncategorized/dairyReport.tw b/src/uncategorized/dairyReport.tw index e975241557b4f9072f6df7b7420ce4c531bb3ed9..57719703986872cf6322edaaccfc13cd3ebdc28e 100644 --- a/src/uncategorized/dairyReport.tw +++ b/src/uncategorized/dairyReport.tw @@ -5,8 +5,8 @@ <<set _MMWorkout = 0>> -<<SlaveIDSort $DairyiIDs>> -<<set _DL = $DairyiIDs.length, _SL = $slaves.length, $bioreactorPerfectedID = 0, $legendaryBallsID = 0, $legendaryCowID = 0, $milkmaidDevotionBonus = 1, $milkmaidHealthBonus = 0, $milkmaidTrustBonus = 1, $milkmaidDevotionThreshold = 45, $milkmaidTrustThreshold = 35, _anusesStretched = 0, _birthers = 0, _births = 0, _cumWeek = 0, _femCumWeek = 0, _FLsFetish = 0, _milkWeek = 0, _balltacular = 0, _boobtacular = 0, _careerForgotten = 0, _chemMinor = 0, _chemSevere = 0, _desterilized = 0, _hatefilled = 0, _horrified = 0, _intelligenceLost = 0, _mindbroken = 0, _profits = 0, _skillsLost = 0, _stupidified = 0, _vaginasStretched = 0, _cmSlave = 0, _dsSlave = 0, _hfSlave = 0, _hrSlave = 0, _slSlave = 0, _cfSlave = 0, _stSlave = 0, _btSlave = 0>> +<<set _slaves = App.Utils.sortedEmployees(App.Entity.facilities.dairy)>> +<<set _DL = _slaves.length, _SL = $slaves.length, $bioreactorPerfectedID = 0, $legendaryBallsID = 0, $legendaryCowID = 0, $milkmaidDevotionBonus = 1, $milkmaidHealthBonus = 0, $milkmaidTrustBonus = 1, $milkmaidDevotionThreshold = 45, $milkmaidTrustThreshold = 35, _anusesStretched = 0, _birthers = 0, _births = 0, _cumWeek = 0, _femCumWeek = 0, _FLsFetish = 0, _milkWeek = 0, _balltacular = 0, _boobtacular = 0, _careerForgotten = 0, _chemMinor = 0, _chemSevere = 0, _desterilized = 0, _hatefilled = 0, _horrified = 0, _intelligenceLost = 0, _mindbroken = 0, _profits = 0, _skillsLost = 0, _stupidified = 0, _vaginasStretched = 0, _cmSlave = 0, _dsSlave = 0, _hfSlave = 0, _hrSlave = 0, _slSlave = 0, _cfSlave = 0, _stSlave = 0, _btSlave = 0>> <!-- Statistics gathering --> <<set $facility = $facility || {}, $facility.dairy = initFacilityStatistics($facility.dairy)>> @@ -16,73 +16,72 @@ <<set _milkmaidImpregnated = 0, _milkers = 0, _cummers = 0, _breeders = 0, _prostateStim = 0>> <<if (_DL > 0)>> - <<for _dI = 0; _dI < _DL; _dI++>> - <<set _i = $slaveIndices[$DairyiIDs[_dI]]>> - <<if $slaves[_i].lactation > 0>> + <<for _slave range _slaves>> + <<if _slave.lactation > 0>> <<set _milkers++>> <</if>> - <<if $slaves[_i].balls > 0 && $slaves[_i].ballType == "human">> + <<if _slave.balls > 0 && _slave.ballType == "human">> <<set _cummers++>> <</if>> - <<if ($slaves[_i].bellyPreg >= 500 && $dairyPregSetting > 0)>> + <<if (_slave.bellyPreg >= 500 && $dairyPregSetting > 0)>> <<set _breeders++>> <</if>> <<if ($milkmaidImpregnates == 1) && (canPenetrate($Milkmaid)) && $Milkmaid.pubertyXY == 1>> - <<if (canImpreg($slaves[_i], $Milkmaid))>> - <<set $slaves[_i].preg = 1, $slaves[_i].pregSource = $Milkmaid.ID, $slaves[_i].pregKnown = 1, $slaves[_i].pregWeek = 1, _milkmaidImpregnated++>> - <<if $slaves[_i].mpreg == 1>> - <<set $slaves[_i].counter.anal += 10, $analTotal += 10>> + <<if (canImpreg(_slave, $Milkmaid))>> + <<set _slave.preg = 1, _slave.pregSource = $Milkmaid.ID, _slave.pregKnown = 1, _slave.pregWeek = 1, _milkmaidImpregnated++>> + <<if _slave.mpreg == 1>> + <<set _slave.counter.anal += 10, $analTotal += 10>> <<else>> - <<set $slaves[_i].counter.vaginal += 10, $vaginalTotal += 10>> + <<set _slave.counter.vaginal += 10, $vaginalTotal += 10>> <</if>> - <<set $slaves[_i].pregType = setPregType($slaves[_i])>> - <<set WombImpregnate($slaves[_i], $slaves[_i].pregType, $Milkmaid.ID, 1)>> + <<set _slave.pregType = setPregType(_slave)>> + <<set WombImpregnate(_slave, _slave.pregType, $Milkmaid.ID, 1)>> <</if>> <</if>> /* how much effort the MM must take to force a slave into a stall */ - <<if $slaves[_i].devotion <= 20>> + <<if _slave.devotion <= 20>> <<set _MMWorkout++>> <</if>> - <<if $slaves[_i].trust < 20>> + <<if _slave.trust < 20>> <<set _MMWorkout++>> <</if>> - <<if $slaves[_i].muscles >= 30 || $slaves[_i].muscles < -30>> + <<if _slave.muscles >= 30 || _slave.muscles < -30>> <<set _MMWorkout++>> <</if>> - <<if $slaves[_i].weight >= 70>> + <<if _slave.weight >= 70>> <<set _MMWorkout++>> <</if>> - <<if $slaves[_i].weight >= 160>> + <<if _slave.weight >= 160>> <<set _MMWorkout++>> <</if>> - <<if $slaves[_i].boobs >= 20000>> + <<if _slave.boobs >= 20000>> <<set _MMWorkout++>> <</if>> - <<if $slaves[_i].balls >= 30>> + <<if _slave.balls >= 30>> <<set _MMWorkout++>> <</if>> - <<if $slaves[_i].belly >= 5000>> + <<if _slave.belly >= 5000>> <<set _MMWorkout++>> <</if>> - <<if !canWalk($slaves[_i])>> /* big bonus if they can't move themselves and are fat as cows */ - <<if $slaves[_i].weight >= 70>> + <<if !canWalk(_slave)>> /* big bonus if they can't move themselves and are fat as cows */ + <<if _slave.weight >= 70>> <<set _MMWorkout += 2>> <</if>> - <<if $slaves[_i].weight >= 160>> + <<if _slave.weight >= 160>> <<set _MMWorkout += 2>> <</if>> - <<if $slaves[_i].boobs >= 20000>> + <<if _slave.boobs >= 20000>> <<set _MMWorkout += 2>> <</if>> - <<if $slaves[_i].balls >= 30>> + <<if _slave.balls >= 30>> <<set _MMWorkout += 2>> <</if>> - <<if $slaves[_i].belly >= 5000>> + <<if _slave.belly >= 5000>> <<set _MMWorkout += 2>> <</if>> <</if>> <<if ($dairyStimulatorsSetting < 2) && ($Milkmaid.dick > 4) && (canPenetrate($Milkmaid)) && _prostateStim != 1>> - <<if ($slaves[_i].balls > 0) && ($slaves[_i].prostate > 0)>> + <<if (_slave.balls > 0) && (_slave.prostate > 0)>> <<set _prostateStim = 1>> <</if>> <</if>> @@ -220,44 +219,44 @@ <<set $slaves[_FLs].need -= 50>> <</if>> <<set $milkmaidDevotionThreshold += (5*$milkmaidDevotionBonus), $milkmaidTrustThreshold += (5*$milkmaidTrustBonus)>> - <<for _dI = 0; _dI < _DL; _dI++>> - <<set $i = $slaveIndices[$DairyiIDs[_dI]]>> - <<if $Milkmaid.rivalryTarget == $slaves[$i].ID>> - <<setLocalPronouns $slaves[$i] 2>> - $He either neglects or harasses $his <<print rivalryTerm($Milkmaid)>>, $slaves[$i].slaveName, making sure _he2 is unhappy and uncomfortable. - <<set $slaves[$i].devotion -= 3, $slaves[$i].trust -= 3>> + <<for _slave range _slaves>> + <<set $i = $slaveIndices[_slave.ID]>> + <<if $Milkmaid.rivalryTarget == _slave.ID>> + <<setLocalPronouns _slave 2>> + $He either neglects or harasses $his <<print rivalryTerm($Milkmaid)>>, _slave.slaveName, making sure _he2 is unhappy and uncomfortable. + <<set _slave.devotion -= 3, _slave.trust -= 3>> <<if random(1,100) > 65>> - <<set $Milkmaid.rivalry++, $slaves[_FLs].rivalry++, $slaves[$i].rivalry++>> + <<set $Milkmaid.rivalry++, $slaves[_FLs].rivalry++, _slave.rivalry++>> <</if>> - <<elseif $Milkmaid.relationshipTarget == $slaves[$i].ID>> - <<setLocalPronouns $slaves[$i] 2>> - $He dotes over $his <<print relationshipTerm($Milkmaid)>>, $slaves[$i].slaveName, making sure _he2 is happy and comfortable. - <<set $slaves[$i].devotion++, $slaves[$i].trust++>> - <<elseif areRelated($Milkmaid, $slaves[$i])>> - <<setLocalPronouns $slaves[$i] 2>> - $He pays special attention to $his <<print relativeTerm($Milkmaid,$slaves[$i])>>, $slaves[$i].slaveName, making sure _he2 is well kept and happy. - <<set $slaves[$i].trust++>> + <<elseif $Milkmaid.relationshipTarget == _slave.ID>> + <<setLocalPronouns _slave 2>> + $He dotes over $his <<print relationshipTerm($Milkmaid)>>, _slave.slaveName, making sure _he2 is happy and comfortable. + <<set _slave.devotion++, _slave.trust++>> + <<elseif areRelated($Milkmaid, _slave)>> + <<setLocalPronouns _slave 2>> + $He pays special attention to $his <<print relativeTerm($Milkmaid,_slave)>>, _slave.slaveName, making sure _he2 is well kept and happy. + <<set _slave.trust++>> <</if>> - <<if $slaves[$i].prestigeDesc == "$He is remembered for winning best in show as a dairy cow.">> - <<if ($slaves[$i].lactation > 0) && (($slaves[$i].boobs-$slaves[$i].boobsImplant) > 6000)>> - $He spends extra time with $slaves[$i].slaveName, the well-known cow. $He is fascinated by $slaves[$i].slaveName's massive $slaves[$i].boobs cc breasts and spends extra time massaging and kneading them to maximize production. - <<set $slaves[$i].devotion += 3, $slaves[$i].trust += 3>> + <<if _slave.prestigeDesc == "$He is remembered for winning best in show as a dairy cow.">> + <<if (_slave.lactation > 0) && ((_slave.boobs-_slave.boobsImplant) > 6000)>> + $He spends extra time with _slave.slaveName, the well-known cow. $He is fascinated by _slave.slaveName's massive _slave.boobs cc breasts and spends extra time massaging and kneading them to maximize production. + <<set _slave.devotion += 3, _slave.trust += 3>> <<else>> - $He is disappointed that the well-known cow $slaves[$i].slaveName<<if ($slaves[$i].lactation == 0)>> isn't producing milk anymore. <<else>>'s breasts have shrunken considerably from their heyday.<</if>> + $He is disappointed that the well-known cow _slave.slaveName<<if (_slave.lactation == 0)>> isn't producing milk anymore. <<else>>'s breasts have shrunken considerably from their heyday.<</if>> <</if>> <</if>> - <<if $slaves[$i].prestigeDesc == "$He is remembered for winning best in show as a cockmilker.">> - <<if (($slaves[$i].balls > 6) && ($slaves[$i].dick != 0)) || (($slaves[$i].balls > 4) && ($slaves[$i].dick != 0) && ($slaves[$i].prostate > 1))>> - $He spends extra time with $slaves[$i].slaveName, the massive ejaculating cow. $He can't help but massage the cow's dick and testes to stimulate them further and coax more from them. - <<set $slaves[$i].devotion += 3, $slaves[$i].trust += 3>> + <<if _slave.prestigeDesc == "$He is remembered for winning best in show as a cockmilker.">> + <<if ((_slave.balls > 6) && (_slave.dick != 0)) || ((_slave.balls > 4) && (_slave.dick != 0) && (_slave.prostate > 1))>> + $He spends extra time with _slave.slaveName, the massive ejaculating cow. $He can't help but massage the cow's dick and testes to stimulate them further and coax more from them. + <<set _slave.devotion += 3, _slave.trust += 3>> <<else>> - $He is disappointed that the (formerly) massive ejaculating cow $slaves[$i].slaveName<<if $slaves[$i].balls == 0 || $slaves[$i].dick == 0>> is incapable of giving cum<<elseif $slaves[$i].prostate < 2>> no longer possesses a hyperactive prostate<<else>>'s balls are considerably smaller than at their heyday<</if>>. + $He is disappointed that the (formerly) massive ejaculating cow _slave.slaveName<<if _slave.balls == 0 || _slave.dick == 0>> is incapable of giving cum<<elseif _slave.prostate < 2>> no longer possesses a hyperactive prostate<<else>>'s balls are considerably smaller than at their heyday<</if>>. <</if>> <</if>> - <<if $slaves[$i].prestigeDesc == "$He is remembered for winning best in show as a breeder." && $slaves[$i].bellyPreg >= 1500>> - <<setLocalPronouns $slaves[$i] 2>> - $He spends extra time with $slaves[$i].slaveName, the well-known breeder. $Milkmaid.slaveName is fascinated by _his2 growing pregnancy and popular womb. $He makes sure _his2 belly and its occupants are nice and comfortable. - <<set $slaves[$i].devotion += 3, $slaves[$i].trust += 3>> + <<if _slave.prestigeDesc == "$He is remembered for winning best in show as a breeder." && _slave.bellyPreg >= 1500>> + <<setLocalPronouns _slave 2>> + $He spends extra time with _slave.slaveName, the well-known breeder. $Milkmaid.slaveName is fascinated by _his2 growing pregnancy and popular womb. $He makes sure _his2 belly and its occupants are nice and comfortable. + <<set _slave.devotion += 3, _slave.trust += 3>> <</if>> <</for>> <</if>> @@ -313,69 +312,69 @@ <</if>> <<set _oldCash = $cash>> -<<for _dI = 0; _dI < _DL; _dI++>> - <<set $i = $slaveIndices[$DairyiIDs[_dI]]>> - <<setLocalPronouns $slaves[$i]>> +<<for _slave range _slaves>> + <<set $i = $slaveIndices[_slave.ID]>> + <<setLocalPronouns _slave>> /* Special attention section */ - <<if ($legendaryCowID == 0) && ($slaves[$i].lactation > 0) && (($slaves[$i].boobs-$slaves[$i].boobsImplant-$slaves[$i].boobsMilk) > 6000) && ($slaves[$i].devotion > 50) && ($slaves[$i].prestige == 0)>> - <<set $legendaryCowID = $slaves[$i].ID>> + <<if ($legendaryCowID == 0) && (_slave.lactation > 0) && ((_slave.boobs-_slave.boobsImplant-_slave.boobsMilk) > 6000) && (_slave.devotion > 50) && (_slave.prestige == 0)>> + <<set $legendaryCowID = _slave.ID>> <</if>> - <<if ($legendaryBallsID == 0) && ($slaves[$i].dick != 0) && ($slaves[$i].balls > 5 || ($slaves[$i].balls > 4 && $slaves[$i].prostate > 1)) && ($slaves[$i].devotion > 50) && ($slaves[$i].prestige == 0)>> - <<set $legendaryBallsID = $slaves[$i].ID>> + <<if ($legendaryBallsID == 0) && (_slave.dick != 0) && (_slave.balls > 5 || (_slave.balls > 4 && _slave.prostate > 1)) && (_slave.devotion > 50) && (_slave.prestige == 0)>> + <<set $legendaryBallsID = _slave.ID>> <</if>> /* Perform facility based rule changes */ <<if ($dairySlimMaintain == 0)>> <<if $dairyWeightSetting == 0>> - <<if $slaves[$i].weight <= 30>> - <<set $slaves[$i].diet = "fattening">> + <<if _slave.weight <= 30>> + <<set _slave.diet = "fattening">> <<else>> - <<set $slaves[$i].diet = "healthy">> + <<set _slave.diet = "healthy">> <</if>> <<elseif $dairyWeightSetting == 1>> - <<if $slaves[$i].weight <= 95>> - <<set $slaves[$i].diet = "fattening">> + <<if _slave.weight <= 95>> + <<set _slave.diet = "fattening">> <<else>> - <<set $slaves[$i].diet = "healthy">> + <<set _slave.diet = "healthy">> <</if>> <<elseif $dairyWeightSetting == 2>> - <<if $slaves[$i].weight <= 130>> - <<set $slaves[$i].diet = "fattening">> + <<if _slave.weight <= 130>> + <<set _slave.diet = "fattening">> <<else>> - <<set $slaves[$i].diet = "healthy">> + <<set _slave.diet = "healthy">> <</if>> <<elseif $dairyWeightSetting == 3>> - <<if $slaves[$i].weight <= 160>> - <<set $slaves[$i].diet = "fattening">> + <<if _slave.weight <= 160>> + <<set _slave.diet = "fattening">> <<else>> - <<set $slaves[$i].diet = "healthy">> + <<set _slave.diet = "healthy">> <</if>> <<elseif $dairyWeightSetting == 4>> - <<if $slaves[$i].weight <= 195>> - <<set $slaves[$i].diet = "fattening">> + <<if _slave.weight <= 195>> + <<set _slave.diet = "fattening">> <<else>> - <<set $slaves[$i].diet = "healthy">> + <<set _slave.diet = "healthy">> <</if>> <<elseif $dairyRestraintsSetting > 1>> - <<set $slaves[$i].diet = "healthy">> + <<set _slave.diet = "healthy">> <</if>> - <<elseif $slaves[$i].weight > 10>> - <<set $slaves[$i].diet = "restricted">> - <<elseif ($slaves[$i].diet == "fattening") || $slaves[$i].diet == "healthy" || ($dairyRestraintsSetting > 1)>> - <<set $slaves[$i].diet = "healthy">> + <<elseif _slave.weight > 10>> + <<set _slave.diet = "restricted">> + <<elseif (_slave.diet == "fattening") || _slave.diet == "healthy" || ($dairyRestraintsSetting > 1)>> + <<set _slave.diet = "healthy">> <</if>> <<if $dairyRestraintsSetting > 1>> - <<set $slaves[$i].collar = "none", $slaves[$i].faceAccessory = "none", $slaves[$i].mouthAccessory = "none", $slaves[$i].choosesOwnClothes = 0, $slaves[$i].clothes = "no clothing", $slaves[$i].vaginalAccessory = "none", $slaves[$i].vaginalAttachment = "none", $slaves[$i].dickAccessory = "none", $slaves[$i].buttplug = "none", $slaves[$i].chastityAnus = 0, $slaves[$i].chastityPenis = 0, $slaves[$i].chastityVagina = 0>> + <<set _slave.collar = "none", _slave.faceAccessory = "none", _slave.mouthAccessory = "none", _slave.choosesOwnClothes = 0, _slave.clothes = "no clothing", _slave.vaginalAccessory = "none", _slave.vaginalAttachment = "none", _slave.dickAccessory = "none", _slave.buttplug = "none", _slave.chastityAnus = 0, _slave.chastityPenis = 0, _slave.chastityVagina = 0>> <</if>> <<switch $dairyDecoration>> <<case "Arabian Revivalist" "Aztec Revivalist" "Chattel Religionist" "Chinese Revivalist" "Degradationist" "Edo Revivalist" "Egyptian Revivalist" "Roman Revivalist" "Subjugationist" "Supremacist">> - <<set $slaves[$i].rules.living = "spare">> + <<set _slave.rules.living = "spare">> <<default>> - <<set $slaves[$i].rules.living = "normal">> + <<set _slave.rules.living = "normal">> <</switch>> <<if $dairyPregSetting > 0>> - <<set WombCleanGenericReserve($slaves[$i], "incubator", 9999)>> - <<set WombCleanGenericReserve($slaves[$i], "nursery", 9999)>> + <<set WombCleanGenericReserve(_slave, "incubator", 9999)>> + <<set WombCleanGenericReserve(_slave, "nursery", 9999)>> <</if>> /* General End of Week effects */ @@ -384,33 +383,33 @@ /* 000-250-006 */ <<if $seeImages && $seeReportImages>> <div class="imageRef tinyImg"> - <<= SlaveArt($slaves[$i], 0, 0)>> + <<= SlaveArt(_slave, 0, 0)>> </div> <</if>> /* 000-250-006 */ - <span class='slave-name'><<= SlaveFullName($slaves[$i])>></span> - <<if $slaves[$i].choosesOwnAssignment == 2>> + <span class='slave-name'><<= SlaveFullName(_slave)>></span> + <<if _slave.choosesOwnAssignment == 2>> <<include "SA chooses own job">> <<else>> is serving as a cow in $dairyName. <</if>> - <br> $He <<= App.SlaveAssignment.getMilked($slaves[$i])>> + <br> $He <<= App.SlaveAssignment.getMilked(_slave)>> <br> <<include "SA rules">> <<include "SA diet">> <<include "SA long term effects">> - <<= App.SlaveAssignment.drugs($slaves[$i])>> + <<= App.SlaveAssignment.drugs(_slave)>> <<include "SA relationships">> <<include "SA rivalries">> <br><<include "SA devotion">> <<else>> <<silently>> <<include "SA chooses own job">> - <<run App.SlaveAssignment.getMilked($slaves[$i])>> + <<run App.SlaveAssignment.getMilked(_slave)>> <<include "SA rules">> <<include "SA diet">> <<include "SA long term effects">> - <<run App.SlaveAssignment.drugs($slaves[$i])>> + <<run App.SlaveAssignment.drugs(_slave)>> <<include "SA relationships">> <<include "SA rivalries">> <<include "SA devotion">> @@ -419,190 +418,190 @@ <<set _milkWeek += $milk, _cumWeek += $cum>> /* Facility Specific End of Week effects */ - <<if ($slaves[$i].devotion <= 20) && ($slaves[$i].trust >= -20)>> - <<set $slaves[$i].devotion -= 5, $slaves[$i].trust -= 5>> + <<if (_slave.devotion <= 20) && (_slave.trust >= -20)>> + <<set _slave.devotion -= 5, _slave.trust -= 5>> <</if>> - <<if ($slaves[$i].health.condition < -80)>> - <<run improveCondition($slaves[$i], 20)>> - <<elseif ($slaves[$i].health.condition < -40)>> - <<run improveCondition($slaves[$i], 10)>> - <<elseif ($slaves[$i].health.condition < 0)>> - <<run improveCondition($slaves[$i], 7)>> - <<elseif ($slaves[$i].health.condition < 90)>> - <<run improveCondition($slaves[$i], 3)>> + <<if (_slave.health.condition < -80)>> + <<run improveCondition(_slave, 20)>> + <<elseif (_slave.health.condition < -40)>> + <<run improveCondition(_slave, 10)>> + <<elseif (_slave.health.condition < 0)>> + <<run improveCondition(_slave, 7)>> + <<elseif (_slave.health.condition < 90)>> + <<run improveCondition(_slave, 3)>> <</if>> - <<if ($slaves[$i].inflation > 0)>> - <<set $slaves[$i].inflation = 0, $slaves[$i].inflationType = "none", $slaves[$i].inflationMethod = 0, $slaves[$i].milkSource = 0>> - <<run SetBellySize($slaves[$i])>> + <<if (_slave.inflation > 0)>> + <<set _slave.inflation = 0, _slave.inflationType = "none", _slave.inflationMethod = 0, _slave.milkSource = 0>> + <<run SetBellySize(_slave)>> <</if>> - <<set _gigantomastiaMod = $slaves[$i].geneticQuirks.gigantomastia == 2 ? ($slaves[$i].geneticQuirks.macromastia == 2 ? 3 : 2) : 1>> - <<if ($slaves[$i].lactation > 0) && (($dairySlimMaintain == 0) || ($slaves[$i].boobs > 700))>> - <<if ($slaves[$i].boobs < 2000)>> + <<set _gigantomastiaMod = _slave.geneticQuirks.gigantomastia == 2 ? (_slave.geneticQuirks.macromastia == 2 ? 3 : 2) : 1>> + <<if (_slave.lactation > 0) && (($dairySlimMaintain == 0) || (_slave.boobs > 700))>> + <<if (_slave.boobs < 2000)>> <<set _growth = 100>> - <<elseif ($slaves[$i].boobs < 5000*_gigantomastiaMod)>> + <<elseif (_slave.boobs < 5000*_gigantomastiaMod)>> <<set _growth = 50>> - <<elseif ($slaves[$i].boobs < 10000*_gigantomastiaMod)>> + <<elseif (_slave.boobs < 10000*_gigantomastiaMod)>> <<set _growth = 25>> <<else>> <<set _growth = 0>> <</if>> - <<if ($slaves[$i].geneMods.NCS == 1)>> + <<if (_slave.geneMods.NCS == 1)>> <<set _growth = Math.trunc(_growth/2)>> <</if>> - <<set $slaves[$i].boobs += _growth>> + <<set _slave.boobs += _growth>> <</if>> - <<if $slaves[$i].prostate == 1>> - <<set $slaves[$i].prostate = 2>> - <<run cashX(forceNeg($surgeryCost), "slaveSurgery", $slaves[$i]), surgeryDamage($slaves[$i], 10)>> + <<if _slave.prostate == 1>> + <<set _slave.prostate = 2>> + <<run cashX(forceNeg($surgeryCost), "slaveSurgery", _slave), surgeryDamage(_slave, 10)>> <</if>> - <<if $slaves[$i].vasectomy == 1>> - <<set $slaves[$i].vasectomy = 0>> - <<run cashX(forceNeg($surgeryCost), "slaveSurgery", $slaves[$i]), surgeryDamage($slaves[$i], 10)>> + <<if _slave.vasectomy == 1>> + <<set _slave.vasectomy = 0>> + <<run cashX(forceNeg($surgeryCost), "slaveSurgery", _slave), surgeryDamage(_slave, 10)>> <</if>> <<if ($dairySlimMaintain == 0)>> <<if $dairyImplantsSetting <= 1>> - <<if ($slaves[$i].lactation < 2) && ($slaves[$i].boobs > 300 || $slaves[$i].balls == 0 || $slaves[$i].lactation == 1 || $dairyImplantsSetting == 1)>> - <<set $slaves[$i].lactation = 2, $slaves[$i].lactationDuration = 2>> - <<run cashX(forceNeg($surgeryCost), "slaveSurgery", $slaves[$i]), surgeryDamage($slaves[$i], 10)>> + <<if (_slave.lactation < 2) && (_slave.boobs > 300 || _slave.balls == 0 || _slave.lactation == 1 || $dairyImplantsSetting == 1)>> + <<set _slave.lactation = 2, _slave.lactationDuration = 2>> + <<run cashX(forceNeg($surgeryCost), "slaveSurgery", _slave), surgeryDamage(_slave, 10)>> <</if>> <<elseif $dairyImplantsSetting == 3>> - <<if ($slaves[$i].lactation < 1) && ($slaves[$i].boobs > 300 || $slaves[$i].balls == 0)>> - <<set $slaves[$i].induceLactation += 9>> - <<run induceLactation($slaves[$i])>> + <<if (_slave.lactation < 1) && (_slave.boobs > 300 || _slave.balls == 0)>> + <<set _slave.induceLactation += 9>> + <<run induceLactation(_slave)>> <</if>> <</if>> <</if>> <<if ($dairyFeedersUpgrade == 1) && ($dairyFeedersSetting > 0)>> <<if ($dairySlimMaintain == 0)>> - <<if ($slaves[$i].balls == 0)>> - <<set $slaves[$i].hormones = 2>> + <<if (_slave.balls == 0)>> + <<set _slave.hormones = 2>> <</if>> - <<elseif $slaves[$i].diet == "fattening">> - <<set $slaves[$i].weight += 2>> - <<if $slaves[$i].weightDirection == 1>> - <<set $slaves[$i].weight += 2>> + <<elseif _slave.diet == "fattening">> + <<set _slave.weight += 2>> + <<if _slave.weightDirection == 1>> + <<set _slave.weight += 2>> <</if>> <</if>> - <<if ($slaves[$i].health.condition < 75)>> - <<run improveCondition($slaves[$i], 25)>> + <<if (_slave.health.condition < 75)>> + <<run improveCondition(_slave, 25)>> <<else>> - <<if ($dairySlimMaintain == 0) && $slaves[$i].lactation > 0>> + <<if ($dairySlimMaintain == 0) && _slave.lactation > 0>> <<if $dairyFeedersSetting > 1 && $dairyStimulatorsSetting > 0>> - <<if $slaves[$i].boobs < 50000>> + <<if _slave.boobs < 50000>> <<if $arcologies[0].FSAssetExpansionistResearch == 1>> - <<if ($slaves[$i].boobs < 2000)>> + <<if (_slave.boobs < 2000)>> <<set _growth = 75*Math.trunc(($injectionUpgrade*2)+$dairyFeedersSetting+$dairyRestraintsSetting+((50)/4))>> - <<elseif ($slaves[$i].boobs < 5000*_gigantomastiaMod)>> + <<elseif (_slave.boobs < 5000*_gigantomastiaMod)>> <<set _growth = 50*Math.trunc(($injectionUpgrade*2)+$dairyFeedersSetting+$dairyRestraintsSetting+((50)/4))>> <<else>> <<set _growth = 25*Math.trunc(($injectionUpgrade*2)+$dairyFeedersSetting+$dairyRestraintsSetting+((50)/4))>> <</if>> <<else>> - <<set _growth = 25*Math.trunc(($injectionUpgrade*2)+$dairyFeedersSetting+$dairyRestraintsSetting+((50-$slaves[$i].physicalAge)/4))>> + <<set _growth = 25*Math.trunc(($injectionUpgrade*2)+$dairyFeedersSetting+$dairyRestraintsSetting+((50-_slave.physicalAge)/4))>> <</if>> - <<if $slaves[$i].boobs <= 20000 && $slaves[$i].boobs+_growth > 20000>> + <<if _slave.boobs <= 20000 && _slave.boobs+_growth > 20000>> <<set _boobtacular++>> <</if>> - <<if ($slaves[$i].geneMods.NCS == 1)>> + <<if (_slave.geneMods.NCS == 1)>> <<set _growth = Math.trunc(_growth/2)>> <</if>> - <<set $slaves[$i].boobs += _growth>> + <<set _slave.boobs += _growth>> <<else>> - /*<<set $slaves[$i].boobs = 50000>>*/ + /*<<set _slave.boobs = 50000>>*/ <</if>> <<elseif $dairyFeedersSetting > 0 && $dairyStimulatorsSetting > 0>> - <<if $slaves[$i].boobs < 25000>> + <<if _slave.boobs < 25000>> <<if $arcologies[0].FSAssetExpansionistResearch == 1>> - <<if ($slaves[$i].boobs < 2000)>> + <<if (_slave.boobs < 2000)>> <<set _growth = 75*Math.trunc(($injectionUpgrade*2)+$dairyFeedersSetting+$dairyRestraintsSetting+((50)/4))>> - <<elseif ($slaves[$i].boobs < 5000*_gigantomastiaMod)>> + <<elseif (_slave.boobs < 5000*_gigantomastiaMod)>> <<set _growth = 50*Math.trunc(($injectionUpgrade*2)+$dairyFeedersSetting+$dairyRestraintsSetting+((50)/4))>> <<else>> <<set _growth = 25*Math.trunc(($injectionUpgrade*2)+$dairyFeedersSetting+$dairyRestraintsSetting+((50)/4))>> <</if>> <<else>> - <<set _growth = 25*Math.trunc(($injectionUpgrade*2)+$dairyFeedersSetting+$dairyRestraintsSetting+((50-$slaves[$i].physicalAge)/4))>> + <<set _growth = 25*Math.trunc(($injectionUpgrade*2)+$dairyFeedersSetting+$dairyRestraintsSetting+((50-_slave.physicalAge)/4))>> <</if>> - <<if $slaves[$i].boobs <= 20000 && $slaves[$i].boobs+_growth > 20000>> + <<if _slave.boobs <= 20000 && _slave.boobs+_growth > 20000>> <<set _boobtacular++>> <</if>> - <<if ($slaves[$i].geneMods.NCS == 1)>> + <<if (_slave.geneMods.NCS == 1)>> <<set _growth = Math.trunc(_growth/2)>> <</if>> - <<set $slaves[$i].boobs += _growth>> + <<set _slave.boobs += _growth>> <</if>> <<elseif $dairyFeedersSetting > 1>> - <<if $slaves[$i].boobs < 10000>> + <<if _slave.boobs < 10000>> <<if $arcologies[0].FSAssetExpansionistResearch == 1>> - <<if ($slaves[$i].boobs < 2000)>> + <<if (_slave.boobs < 2000)>> <<set _growth = 75*Math.trunc(($injectionUpgrade*2)+$dairyFeedersSetting+$dairyRestraintsSetting+((50)/4))>> - <<elseif ($slaves[$i].boobs < 5000*_gigantomastiaMod)>> + <<elseif (_slave.boobs < 5000*_gigantomastiaMod)>> <<set _growth = 50*Math.trunc(($injectionUpgrade*2)+$dairyFeedersSetting+$dairyRestraintsSetting+((50)/4))>> <<else>> <<set _growth = 25*Math.trunc(($injectionUpgrade*2)+$dairyFeedersSetting+$dairyRestraintsSetting+((50)/4))>> <</if>> <<else>> - <<set _growth = 25*Math.trunc(($injectionUpgrade*2)+$dairyFeedersSetting+$dairyRestraintsSetting+((50-$slaves[$i].physicalAge)/4))>> + <<set _growth = 25*Math.trunc(($injectionUpgrade*2)+$dairyFeedersSetting+$dairyRestraintsSetting+((50-_slave.physicalAge)/4))>> <</if>> - <<if $slaves[$i].boobs <= 20000 && $slaves[$i].boobs+_growth > 20000>> + <<if _slave.boobs <= 20000 && _slave.boobs+_growth > 20000>> <<set _boobtacular++>> <</if>> - <<if ($slaves[$i].geneMods.NCS == 1)>> + <<if (_slave.geneMods.NCS == 1)>> <<set _growth = Math.trunc(_growth/2)>> <</if>> - <<set $slaves[$i].boobs += _growth>> + <<set _slave.boobs += _growth>> <</if>> <<else>> - <<if $slaves[$i].boobs < 5000>> + <<if _slave.boobs < 5000>> <<if $arcologies[0].FSAssetExpansionistResearch == 1>> - <<if ($slaves[$i].boobs < 2000)>> + <<if (_slave.boobs < 2000)>> <<set _growth = 75*Math.trunc(($injectionUpgrade*2)+$dairyFeedersSetting+$dairyRestraintsSetting+((50)/4))>> - <<elseif ($slaves[$i].boobs < 5000*_gigantomastiaMod)>> + <<elseif (_slave.boobs < 5000*_gigantomastiaMod)>> <<set _growth = 50*Math.trunc(($injectionUpgrade*2)+$dairyFeedersSetting+$dairyRestraintsSetting+((50)/4))>> <<else>> <<set _growth = 25*Math.trunc(($injectionUpgrade*2)+$dairyFeedersSetting+$dairyRestraintsSetting+((50)/4))>> <</if>> <<else>> - <<set _growth = 25*Math.trunc(($injectionUpgrade*2)+$dairyFeedersSetting+$dairyRestraintsSetting+((50-$slaves[$i].physicalAge)/4))>> + <<set _growth = 25*Math.trunc(($injectionUpgrade*2)+$dairyFeedersSetting+$dairyRestraintsSetting+((50-_slave.physicalAge)/4))>> <</if>> - <<if $slaves[$i].boobs <= 20000 && $slaves[$i].boobs+_growth > 20000>> + <<if _slave.boobs <= 20000 && _slave.boobs+_growth > 20000>> <<set _boobtacular++>> <</if>> - <<if ($slaves[$i].geneMods.NCS == 1)>> + <<if (_slave.geneMods.NCS == 1)>> <<set _growth = Math.trunc(_growth/2)>> <</if>> - <<set $slaves[$i].boobs += _growth>> + <<set _slave.boobs += _growth>> <</if>> <</if>> <</if>> - <<if ($slaves[$i].balls > 0)>> + <<if (_slave.balls > 0)>> <<if $arcologies[0].FSAssetExpansionistResearch == 1>> - <<if ($slaves[$i].geneMods.NCS == 0) && ($slaves[$i].balls < 125)>> - <<set $slaves[$i].balls++>> - <<elseif ($slaves[$i].geneMods.NCS == 1) && ($slaves[$i].balls < 125) && (random(1,600) > (30+(10*$slaves[$i].balls)-(10*$dairyRestraintsSetting)-($injectionUpgrade*10)))>> - <<set $slaves[$i].balls++>> + <<if (_slave.geneMods.NCS == 0) && (_slave.balls < 125)>> + <<set _slave.balls++>> + <<elseif (_slave.geneMods.NCS == 1) && (_slave.balls < 125) && (random(1,600) > (30+(10*_slave.balls)-(10*$dairyRestraintsSetting)-($injectionUpgrade*10)))>> + <<set _slave.balls++>> <</if>> - <<if ($slaves[$i].balls >= 125)>> + <<if (_slave.balls >= 125)>> <<set _balltacular++>> - <<set _btSlave = $slaves[$i]>> + <<set _btSlave = _slave>> <</if>> - <<elseif ($slaves[$i].balls < 10)>> - <<if ($slaves[$i].geneMods.NCS == 0) && (random(1,100) > (40+(10*$slaves[$i].balls)-(10*$dairyRestraintsSetting)-($injectionUpgrade*10)))>> - <<set $slaves[$i].balls++>> - <<elseif ($slaves[$i].geneMods.NCS == 1) && ($slaves[$i].balls < 125) && (random(1,50) > (40+(10*$slaves[$i].balls)-(10*$dairyRestraintsSetting)-($injectionUpgrade*10)))>> - <<set $slaves[$i].balls++>> + <<elseif (_slave.balls < 10)>> + <<if (_slave.geneMods.NCS == 0) && (random(1,100) > (40+(10*_slave.balls)-(10*$dairyRestraintsSetting)-($injectionUpgrade*10)))>> + <<set _slave.balls++>> + <<elseif (_slave.geneMods.NCS == 1) && (_slave.balls < 125) && (random(1,50) > (40+(10*_slave.balls)-(10*$dairyRestraintsSetting)-($injectionUpgrade*10)))>> + <<set _slave.balls++>> <</if>> - <<if ($slaves[$i].balls >= 10)>> + <<if (_slave.balls >= 10)>> <<set _balltacular++>> - <<set _btSlave = $slaves[$i]>> + <<set _btSlave = _slave>> <</if>> <</if>> - <<if $slaves[$i].dick > 0>> - <<if $slaves[$i].dick < 10>> - <<if (($slaves[$i].geneMods.NCS == 0) && (random(1,100) > (40+(10*$slaves[$i].dick)-(10*$dairyRestraintsSetting)-($injectionUpgrade*10))))>> - <<set $slaves[$i].dick++>> - <<elseif (($slaves[$i].geneMods.NCS == 1) && (random(1,50) > (40+(10*$slaves[$i].dick)-(10*$dairyRestraintsSetting)-($injectionUpgrade*10))))>> - <<set $slaves[$i].dick++>> + <<if _slave.dick > 0>> + <<if _slave.dick < 10>> + <<if ((_slave.geneMods.NCS == 0) && (random(1,100) > (40+(10*_slave.dick)-(10*$dairyRestraintsSetting)-($injectionUpgrade*10))))>> + <<set _slave.dick++>> + <<elseif ((_slave.geneMods.NCS == 1) && (random(1,50) > (40+(10*_slave.dick)-(10*$dairyRestraintsSetting)-($injectionUpgrade*10))))>> + <<set _slave.dick++>> <</if>> <</if>> <</if>> @@ -610,112 +609,112 @@ <</if>> <</if>> /* closes ($dairyFeedersUpgrade == 1) && ($dairyFeedersSetting > 0) */ <<if ($dairyStimulatorsUpgrade == 1) && $dairyStimulatorsSetting > 0>> - <<if ($dairyStimulatorsSetting > 1) && ($slaves[$i].anus < 4)>> - <<set $slaves[$i].anus++>> - <<if ($slaves[$i].anus >= 4)>> + <<if ($dairyStimulatorsSetting > 1) && (_slave.anus < 4)>> + <<set _slave.anus++>> + <<if (_slave.anus >= 4)>> <<set _anusesStretched++>> <</if>> - <<elseif ($slaves[$i].anus < 3)>> - <<set $slaves[$i].anus++>> + <<elseif (_slave.anus < 3)>> + <<set _slave.anus++>> <</if>> - <<if ($slaves[$i].health.condition < 60)>> - <<run improveCondition($slaves[$i], 20)>> - <<elseif $dairySlimMaintain == 0 && $slaves[$i].lactation > 0>> + <<if (_slave.health.condition < 60)>> + <<run improveCondition(_slave, 20)>> + <<elseif $dairySlimMaintain == 0 && _slave.lactation > 0>> <<if $dairyFeedersSetting > 1>> - <<if $slaves[$i].boobs < 50000>> + <<if _slave.boobs < 50000>> <<if $arcologies[0].FSAssetExpansionistResearch == 1>> - <<if ($slaves[$i].boobs < 2000)>> + <<if (_slave.boobs < 2000)>> <<set _growth = 75*Math.trunc(($injectionUpgrade*2)+$dairyFeedersSetting+$dairyRestraintsSetting+((50)/4))>> - <<elseif ($slaves[$i].boobs < 5000*_gigantomastiaMod)>> + <<elseif (_slave.boobs < 5000*_gigantomastiaMod)>> <<set _growth = 50*Math.trunc(($injectionUpgrade*2)+$dairyFeedersSetting+$dairyRestraintsSetting+((50)/4))>> <<else>> <<set _growth = 25*Math.trunc(($injectionUpgrade*2)+$dairyFeedersSetting+$dairyRestraintsSetting+((50)/4))>> <</if>> <<else>> - <<set _growth = 25*Math.trunc(($injectionUpgrade*2)+$dairyFeedersSetting+$dairyRestraintsSetting+((50-$slaves[$i].physicalAge)/4))>> + <<set _growth = 25*Math.trunc(($injectionUpgrade*2)+$dairyFeedersSetting+$dairyRestraintsSetting+((50-_slave.physicalAge)/4))>> <</if>> - <<if $slaves[$i].boobs <= 20000 && $slaves[$i].boobs+_growth > 20000>> + <<if _slave.boobs <= 20000 && _slave.boobs+_growth > 20000>> <<set _boobtacular++>> <</if>> - <<if ($slaves[$i].geneMods.NCS == 1)>> + <<if (_slave.geneMods.NCS == 1)>> <<set _growth = Math.trunc(_growth/2)>> <</if>> - <<set $slaves[$i].boobs += _growth>> + <<set _slave.boobs += _growth>> <</if>> <<elseif $dairyFeedersSetting > 0>> - <<if $slaves[$i].boobs < 25000>> + <<if _slave.boobs < 25000>> <<if $arcologies[0].FSAssetExpansionistResearch == 1>> - <<if ($slaves[$i].boobs < 2000)>> + <<if (_slave.boobs < 2000)>> <<set _growth = 75*Math.trunc(($injectionUpgrade*2)+$dairyFeedersSetting+$dairyRestraintsSetting+((50)/4))>> - <<elseif ($slaves[$i].boobs < 5000*_gigantomastiaMod)>> + <<elseif (_slave.boobs < 5000*_gigantomastiaMod)>> <<set _growth = 50*Math.trunc(($injectionUpgrade*2)+$dairyFeedersSetting+$dairyRestraintsSetting+((50)/4))>> <<else>> <<set _growth = 25*Math.trunc(($injectionUpgrade*2)+$dairyFeedersSetting+$dairyRestraintsSetting+((50)/4))>> <</if>> <<else>> - <<set _growth = 25*Math.trunc(($injectionUpgrade*2)+$dairyFeedersSetting+$dairyRestraintsSetting+((50-$slaves[$i].physicalAge)/4))>> + <<set _growth = 25*Math.trunc(($injectionUpgrade*2)+$dairyFeedersSetting+$dairyRestraintsSetting+((50-_slave.physicalAge)/4))>> <</if>> - <<if $slaves[$i].boobs <= 20000 && $slaves[$i].boobs+_growth > 20000>> + <<if _slave.boobs <= 20000 && _slave.boobs+_growth > 20000>> <<set _boobtacular++>> <</if>> - <<if ($slaves[$i].geneMods.NCS == 1)>> + <<if (_slave.geneMods.NCS == 1)>> <<set _growth = Math.trunc(_growth/2)>> <</if>> - <<set $slaves[$i].boobs += _growth>> + <<set _slave.boobs += _growth>> <</if>> <<else>> - <<if $slaves[$i].boobs < 10000>> + <<if _slave.boobs < 10000>> <<if $arcologies[0].FSAssetExpansionistResearch == 1>> - <<if ($slaves[$i].boobs < 2000)>> + <<if (_slave.boobs < 2000)>> <<set _growth = 75*Math.trunc(($injectionUpgrade*2)+$dairyFeedersSetting+$dairyRestraintsSetting+((50)/4))>> - <<elseif ($slaves[$i].boobs < 5000*_gigantomastiaMod)>> + <<elseif (_slave.boobs < 5000*_gigantomastiaMod)>> <<set _growth = 50*Math.trunc(($injectionUpgrade*2)+$dairyFeedersSetting+$dairyRestraintsSetting+((50)/4))>> <<else>> <<set _growth = 25*Math.trunc(($injectionUpgrade*2)+$dairyFeedersSetting+$dairyRestraintsSetting+((50)/4))>> <</if>> <<else>> - <<set _growth = 25*Math.trunc(($injectionUpgrade*2)+$dairyFeedersSetting+$dairyRestraintsSetting+((50-$slaves[$i].physicalAge)/4))>> + <<set _growth = 25*Math.trunc(($injectionUpgrade*2)+$dairyFeedersSetting+$dairyRestraintsSetting+((50-_slave.physicalAge)/4))>> <</if>> - <<if $slaves[$i].boobs <= 20000 && $slaves[$i].boobs+_growth > 20000>> + <<if _slave.boobs <= 20000 && _slave.boobs+_growth > 20000>> <<set _boobtacular++>> <</if>> - <<if ($slaves[$i].geneMods.NCS == 1)>> + <<if (_slave.geneMods.NCS == 1)>> <<set _growth = Math.trunc(_growth/2)>> <</if>> - <<set $slaves[$i].boobs += _growth>> + <<set _slave.boobs += _growth>> <</if>> <</if>> <</if>> <</if>> <<if ($dairyRestraintsSetting > 1)>> - <<if $slaves[$i].lactation > 0>> - <<set $slaves[$i].lactationAdaptation += 1>> + <<if _slave.lactation > 0>> + <<set _slave.lactationAdaptation += 1>> <</if>> - <<if ($slaves[$i].muscles > -100)>> - <<set $slaves[$i].muscles -= 1+$slaves[$i].geneticQuirks.mLoss>> + <<if (_slave.muscles > -100)>> + <<set _slave.muscles -= 1+_slave.geneticQuirks.mLoss>> <</if>> - <<if ($slaves[$i].fetish == "mindbroken")>> - <<if ($slaves[$i].boobs > 48000) && (($slaves[$i].balls >= 10) || ($slaves[$i].balls == 0))>> - <<set $bioreactorPerfectedID = $slaves[$i].ID>> + <<if (_slave.fetish == "mindbroken")>> + <<if (_slave.boobs > 48000) && ((_slave.balls >= 10) || (_slave.balls == 0))>> + <<set $bioreactorPerfectedID = _slave.ID>> <</if>> <<else>> - <<if ($slaves[$i].sexualFlaw != "self hating")>> - <<if ($slaves[$i].sexualFlaw != "cum addict") || ($dairyFeedersSetting == 0)>> - <<if ($slaves[$i].sexualFlaw != "anal addict") || ($dairyStimulatorsSetting == 0)>> - <<if ($slaves[$i].sexualFlaw != "breeder") || ($slaves[$i].preg < 0) || ($dairyPregSetting == 0)>> + <<if (_slave.sexualFlaw != "self hating")>> + <<if (_slave.sexualFlaw != "cum addict") || ($dairyFeedersSetting == 0)>> + <<if (_slave.sexualFlaw != "anal addict") || ($dairyStimulatorsSetting == 0)>> + <<if (_slave.sexualFlaw != "breeder") || (_slave.preg < 0) || ($dairyPregSetting == 0)>> <<if $dairyStimulatorsSetting > 1>> - <<if ($slaves[$i].sexualFlaw != "hates anal") && ($slaves[$i].sexualQuirk != "painal queen")>> - <<set $slaves[$i].sexualFlaw = "hates anal">> + <<if (_slave.sexualFlaw != "hates anal") && (_slave.sexualQuirk != "painal queen")>> + <<set _slave.sexualFlaw = "hates anal">> <</if>> <</if>> <<if $dairyPregSetting > 1>> - <<if ($slaves[$i].sexualFlaw != "hates penetration") && ($slaves[$i].sexualQuirk != "strugglefuck queen")>> - <<set $slaves[$i].sexualFlaw = "hates penetration">> + <<if (_slave.sexualFlaw != "hates penetration") && (_slave.sexualQuirk != "strugglefuck queen")>> + <<set _slave.sexualFlaw = "hates penetration">> <</if>> <</if>> <<if $dairyFeedersSetting > 1>> - <<if ($slaves[$i].sexualFlaw != "hates oral") && ($slaves[$i].sexualQuirk != "gagfuck queen")>> - <<set $slaves[$i].sexualFlaw = "hates oral">> + <<if (_slave.sexualFlaw != "hates oral") && (_slave.sexualQuirk != "gagfuck queen")>> + <<set _slave.sexualFlaw = "hates oral">> <</if>> <</if>> <</if>> @@ -723,173 +722,173 @@ <</if>> <</if>> <</if>> - <<if $slaves[$i].chem > 250>> + <<if _slave.chem > 250>> <<set _chemSevere++>> - <<elseif $slaves[$i].chem > 100>> + <<elseif _slave.chem > 100>> <<set _chemMinor++>> - <<set _cmSlave = $slaves[$i]>> + <<set _cmSlave = _slave>> <</if>> <</if>> <<if ($dairyStimulatorsSetting + $dairyFeedersSetting + $dairyPregSetting) > 5>> - <<if $slaves[$i].devotion <= 95 && $slaves[$i].sexualFlaw != "self hating">> - <<if ($slaves[$i].sexualFlaw != "breeder") || ($slaves[$i].preg < 0)>> - <<if ($slaves[$i].devotion > -75)>> - <<set $slaves[$i].devotion -= 10>> - <<if ($slaves[$i].devotion < -65)>> + <<if _slave.devotion <= 95 && _slave.sexualFlaw != "self hating">> + <<if (_slave.sexualFlaw != "breeder") || (_slave.preg < 0)>> + <<if (_slave.devotion > -75)>> + <<set _slave.devotion -= 10>> + <<if (_slave.devotion < -65)>> <<set _hatefilled++>> - <<set _hfSlave = $slaves[$i]>> + <<set _hfSlave = _slave>> <</if>> - <<elseif ($slaves[$i].trust > -75)>> - <<set $slaves[$i].trust -= 10>> - <<if ($slaves[$i].trust < -65)>> + <<elseif (_slave.trust > -75)>> + <<set _slave.trust -= 10>> + <<if (_slave.trust < -65)>> <<set _horrified++>> - <<set _hrSlave = $slaves[$i]>> + <<set _hrSlave = _slave>> <</if>> - <<elseif ($slaves[$i].skill.vaginal > 0)>> - <<set $slaves[$i].skill.vaginal -= 10, _skillsLost++>> - <<set _slSlave = $slaves[$i]>> - <<elseif ($slaves[$i].skill.oral > 0)>> - <<set $slaves[$i].skill.oral -= 10, _skillsLost++>> - <<set _slSlave = $slaves[$i]>> - <<elseif ($slaves[$i].skill.anal > 0)>> - <<set $slaves[$i].skill.anal -= 10, _skillsLost++>> - <<set _slSlave = $slaves[$i]>> - <<elseif ($slaves[$i].career != "a bioreactor")>> - <<set $slaves[$i].career = "a bioreactor", _careerForgotten++>> - <<set _cfSlave = $slaves[$i]>> - <<elseif ($slaves[$i].intelligenceImplant > 0)>> - <<set $slaves[$i].intelligenceImplant = Math.clamp($slaves[$i].intelligenceImplant-5, 0, 30), _skillsLost++>> - <<set _slSlave = $slaves[$i]>> - <<elseif ($slaves[$i].intelligence >= -15)>> - <<set $slaves[$i].intelligence -= 5, _intelligenceLost++>> - <<elseif ($slaves[$i].devotion >= -20)>> - <<set $slaves[$i].devotion -= 10>> - <<elseif ($slaves[$i].trust >= -20)>> - <<set $slaves[$i].trust -= 10>> - <<elseif ($slaves[$i].skill.whoring > 0)>> - <<set $slaves[$i].skill.whoring -= 10, _skillsLost++>> - <<set _slSlave = $slaves[$i]>> - <<elseif ($slaves[$i].skill.entertainment > 0)>> - <<set $slaves[$i].skill.entertainment -= 10, _skillsLost++>> - <<set _slSlave = $slaves[$i]>> - <<elseif ($slaves[$i].intelligence >= -50)>> - <<set $slaves[$i].intelligence -= 5>> - <<if $slaves[$i].intelligence < -50>> + <<elseif (_slave.skill.vaginal > 0)>> + <<set _slave.skill.vaginal -= 10, _skillsLost++>> + <<set _slSlave = _slave>> + <<elseif (_slave.skill.oral > 0)>> + <<set _slave.skill.oral -= 10, _skillsLost++>> + <<set _slSlave = _slave>> + <<elseif (_slave.skill.anal > 0)>> + <<set _slave.skill.anal -= 10, _skillsLost++>> + <<set _slSlave = _slave>> + <<elseif (_slave.career != "a bioreactor")>> + <<set _slave.career = "a bioreactor", _careerForgotten++>> + <<set _cfSlave = _slave>> + <<elseif (_slave.intelligenceImplant > 0)>> + <<set _slave.intelligenceImplant = Math.clamp(_slave.intelligenceImplant-5, 0, 30), _skillsLost++>> + <<set _slSlave = _slave>> + <<elseif (_slave.intelligence >= -15)>> + <<set _slave.intelligence -= 5, _intelligenceLost++>> + <<elseif (_slave.devotion >= -20)>> + <<set _slave.devotion -= 10>> + <<elseif (_slave.trust >= -20)>> + <<set _slave.trust -= 10>> + <<elseif (_slave.skill.whoring > 0)>> + <<set _slave.skill.whoring -= 10, _skillsLost++>> + <<set _slSlave = _slave>> + <<elseif (_slave.skill.entertainment > 0)>> + <<set _slave.skill.entertainment -= 10, _skillsLost++>> + <<set _slSlave = _slave>> + <<elseif (_slave.intelligence >= -50)>> + <<set _slave.intelligence -= 5>> + <<if _slave.intelligence < -50>> <<set _stupidified++>> - <<set _stSlave = $slaves[$i]>> + <<set _stSlave = _slave>> <</if>> - <<elseif ($slaves[$i].fetish != "mindbroken")>> - <<set $slaves[$i].fetish = "mindbroken", _mindbroken++>> + <<elseif (_slave.fetish != "mindbroken")>> + <<set _slave.fetish = "mindbroken", _mindbroken++>> <</if>> <</if>> <</if>> - <<if (($slaves[$i].counter.milk > 1000) && ($slaves[$i].boobs > 12000) || ($slaves[$i].counter.cum > 1000) && ($slaves[$i].balls >= 10)) && ($slaves[$i].career != "a bioreactor")>> - <<set $slaves[$i].career = "a bioreactor", _careerForgotten++>> - <<set _cfSlave = $slaves[$i]>> + <<if ((_slave.counter.milk > 1000) && (_slave.boobs > 12000) || (_slave.counter.cum > 1000) && (_slave.balls >= 10)) && (_slave.career != "a bioreactor")>> + <<set _slave.career = "a bioreactor", _careerForgotten++>> + <<set _cfSlave = _slave>> <</if>> <<if ($arcologies[0].FSBodyPuristLaw == 0) && ($healthyDrugsUpgrade == 0)>> - <<set $slaves[$i].chem += 5>> + <<set _slave.chem += 5>> <<else>> - <<set $slaves[$i].chem += 2>> + <<set _slave.chem += 2>> <</if>> <<elseif ($dairyStimulatorsSetting + $dairyFeedersSetting + $dairyPregSetting) > 3>> - <<if ($slaves[$i].devotion < 75)>> - <<if ($slaves[$i].devotion > -75)>> - <<set $slaves[$i].devotion -= 5>> - <<if ($slaves[$i].devotion < -70)>> + <<if (_slave.devotion < 75)>> + <<if (_slave.devotion > -75)>> + <<set _slave.devotion -= 5>> + <<if (_slave.devotion < -70)>> <<set _hatefilled++>> - <<set _hfSlave = $slaves[$i]>> + <<set _hfSlave = _slave>> <</if>> - <<elseif ($slaves[$i].trust > -75)>> - <<set $slaves[$i].trust -= 5>> - <<if ($slaves[$i].trust < -70)>> + <<elseif (_slave.trust > -75)>> + <<set _slave.trust -= 5>> + <<if (_slave.trust < -70)>> <<set _horrified++>> - <<set _hrSlave = $slaves[$i]>> + <<set _hrSlave = _slave>> <</if>> - <<elseif ($slaves[$i].skill.vaginal >= 20)>> - <<set $slaves[$i].skill.vaginal -= 10, _skillsLost++>> - <<set _slSlave = $slaves[$i]>> - <<elseif ($slaves[$i].skill.oral >= 20)>> - <<set $slaves[$i].skill.oral -= 10, _skillsLost++>> - <<set _slSlave = $slaves[$i]>> - <<elseif ($slaves[$i].skill.anal >= 20)>> - <<set $slaves[$i].skill.anal -= 10, _skillsLost++>> - <<set _slSlave = $slaves[$i]>> - <<elseif ($slaves[$i].career != "a bioreactor")>> - <<set $slaves[$i].career = "a bioreactor", _careerForgotten++>> - <<set _cfSlave = $slaves[$i]>> - <<elseif ($slaves[$i].intelligenceImplant > 0)>> - <<set $slaves[$i].intelligenceImplant = Math.clamp($slaves[$i].intelligenceImplant-5, 0, 30), _skillsLost++>> - <<set _slSlave = $slaves[$i]>> - <<elseif ($slaves[$i].intelligence >= -15)>> - <<set $slaves[$i].intelligence -= 5, _intelligenceLost++>> - <<elseif ($slaves[$i].devotion >= -20)>> - <<set $slaves[$i].devotion -= 8>> - <<elseif ($slaves[$i].trust >= -20)>> - <<set $slaves[$i].trust -= 8>> - <<elseif ($slaves[$i].skill.whoring >= 20)>> - <<set $slaves[$i].skill.whoring -= 10, _skillsLost++>> - <<set _slSlave = $slaves[$i]>> - <<elseif ($slaves[$i].skill.entertainment >= 20)>> - <<set $slaves[$i].skill.entertainment -= 10, _skillsLost++>> - <<set _slSlave = $slaves[$i]>> - <<elseif ($slaves[$i].intelligence >= -50)>> - <<set $slaves[$i].intelligence -= 5>> - <<if $slaves[$i].intelligence < -50>> + <<elseif (_slave.skill.vaginal >= 20)>> + <<set _slave.skill.vaginal -= 10, _skillsLost++>> + <<set _slSlave = _slave>> + <<elseif (_slave.skill.oral >= 20)>> + <<set _slave.skill.oral -= 10, _skillsLost++>> + <<set _slSlave = _slave>> + <<elseif (_slave.skill.anal >= 20)>> + <<set _slave.skill.anal -= 10, _skillsLost++>> + <<set _slSlave = _slave>> + <<elseif (_slave.career != "a bioreactor")>> + <<set _slave.career = "a bioreactor", _careerForgotten++>> + <<set _cfSlave = _slave>> + <<elseif (_slave.intelligenceImplant > 0)>> + <<set _slave.intelligenceImplant = Math.clamp(_slave.intelligenceImplant-5, 0, 30), _skillsLost++>> + <<set _slSlave = _slave>> + <<elseif (_slave.intelligence >= -15)>> + <<set _slave.intelligence -= 5, _intelligenceLost++>> + <<elseif (_slave.devotion >= -20)>> + <<set _slave.devotion -= 8>> + <<elseif (_slave.trust >= -20)>> + <<set _slave.trust -= 8>> + <<elseif (_slave.skill.whoring >= 20)>> + <<set _slave.skill.whoring -= 10, _skillsLost++>> + <<set _slSlave = _slave>> + <<elseif (_slave.skill.entertainment >= 20)>> + <<set _slave.skill.entertainment -= 10, _skillsLost++>> + <<set _slSlave = _slave>> + <<elseif (_slave.intelligence >= -50)>> + <<set _slave.intelligence -= 5>> + <<if _slave.intelligence < -50>> <<set _stupidified++>> - <<set _stSlave = $slaves[$i]>> + <<set _stSlave = _slave>> <</if>> - <<elseif ($slaves[$i].fetish != "mindbroken")>> - <<set $slaves[$i].fetish = "mindbroken", _mindbroken++>> + <<elseif (_slave.fetish != "mindbroken")>> + <<set _slave.fetish = "mindbroken", _mindbroken++>> <</if>> - <<elseif (($slaves[$i].counter.milk > 1000) && ($slaves[$i].boobs > 12000) || ($slaves[$i].counter.cum > 1000) && ($slaves[$i].balls >= 10)) && ($slaves[$i].career != "a bioreactor")>> - <<set $slaves[$i].career = "a bioreactor", _careerForgotten++>> - <<set _cfSlave = $slaves[$i]>> + <<elseif ((_slave.counter.milk > 1000) && (_slave.boobs > 12000) || (_slave.counter.cum > 1000) && (_slave.balls >= 10)) && (_slave.career != "a bioreactor")>> + <<set _slave.career = "a bioreactor", _careerForgotten++>> + <<set _cfSlave = _slave>> <</if>> <<if ($arcologies[0].FSBodyPuristLaw == 0) && ($healthyDrugsUpgrade == 0)>> - <<set $slaves[$i].chem += 2>> + <<set _slave.chem += 2>> <<else>> - <<set $slaves[$i].chem++>> + <<set _slave.chem++>> <</if>> <</if>> /* closes ($dairyStimulatorsSetting + $dairyFeedersSetting + $dairyPregSetting) > 5 */ <<if ($dairyPregUpgrade == 1) && ($dairyPregSetting > 0)>> - <<if ($slaves[$i].ovaries == 1) && ($slaves[$i].vagina > -1)>> - <<set _femCumWeek += Math.trunc((70-$slaves[$i].physicalAge)/(30-($slaves[$i].vaginaLube*10)))>> - <<if ($slaves[$i].preg == -2)>> - <<set $slaves[$i].preg = 0, _desterilized++>> - <<set _dsSlave = $slaves[$i]>> + <<if (_slave.ovaries == 1) && (_slave.vagina > -1)>> + <<set _femCumWeek += Math.trunc((70-_slave.physicalAge)/(30-(_slave.vaginaLube*10)))>> + <<if (_slave.preg == -2)>> + <<set _slave.preg = 0, _desterilized++>> + <<set _dsSlave = _slave>> <</if>> - <<if isFertile($slaves[$i])>> - <<if $slaves[$i].eggType == "human">> - <<set $slaves[$i].preg = 1, $slaves[$i].pregWeek = 1, $slaves[$i].pregKnown = 1>> + <<if isFertile(_slave)>> + <<if _slave.eggType == "human">> + <<set _slave.preg = 1, _slave.pregWeek = 1, _slave.pregKnown = 1>> <<if ($dairyPregSetting > 2)>> - <<set $slaves[$i].pregType = random(10,29)>> + <<set _slave.pregType = random(10,29)>> <<elseif ($dairyPregSetting > 1)>> - <<set $slaves[$i].pregType = random(3,6)>> + <<set _slave.pregType = random(3,6)>> <<else>> - <<set $slaves[$i].pregType = either(1, 1, 1, 1, 2, 2, 2, 3, 3, 4)>> + <<set _slave.pregType = either(1, 1, 1, 1, 2, 2, 2, 3, 3, 4)>> <</if>> - <<set $slaves[$i].pregSource = -2>> - <<set WombImpregnate($slaves[$i], $slaves[$i].pregType, -2, 1)>> + <<set _slave.pregSource = -2>> + <<set WombImpregnate(_slave, _slave.pregType, -2, 1)>> <</if>> /*closes eggType */ - <<if ($slaves[$i].vagina == 0)>> - <<set $slaves[$i].vagina++>> + <<if (_slave.vagina == 0)>> + <<set _slave.vagina++>> <</if>> - <<elseif ($slaves[$i].pregKnown == 1)>> + <<elseif (_slave.pregKnown == 1)>> <<if ($dairyPregSetting > 2)>> - <<run cashX(100, "slaveAssignmentDairy", $slaves[$i])>> + <<run cashX(100, "slaveAssignmentDairy", _slave)>> <<elseif ($dairyPregSetting > 1)>> - <<run cashX(50, "slaveAssignmentDairy", $slaves[$i])>> + <<run cashX(50, "slaveAssignmentDairy", _slave)>> <<else>> - <<run cashX(25, "slaveAssignmentDairy", $slaves[$i])>> + <<run cashX(25, "slaveAssignmentDairy", _slave)>> <</if>> - <<if ($dairyPregSetting > 1) && ($slaves[$i].vagina < 4)>> - <<set $slaves[$i].vagina++>> - <<if ($slaves[$i].vagina == 4)>> + <<if ($dairyPregSetting > 1) && (_slave.vagina < 4)>> + <<set _slave.vagina++>> + <<if (_slave.vagina == 4)>> <<set _vaginasStretched++>> <</if>> - <<elseif ($slaves[$i].vagina < 3)>> - <<set $slaves[$i].vagina++>> + <<elseif (_slave.vagina < 3)>> + <<set _slave.vagina++>> <</if>> <</if>> <</if>> @@ -1127,28 +1126,27 @@ $dairyNameCaps produced <<print _milkWeek+_outputMilk>> liters of milk<<if _cumW <</if>> <<if ($createBioreactors == 1) && ($bioreactorPerfectedID != 0)>> - <<for _dI = 0; _dI < _DL; _dI++>> - <<set $i = $slaveIndices[$DairyiIDs[_dI]]>> - <<setLocalPronouns $slaves[$i]>> - <<if ($slaves[$i].ID == $bioreactorPerfectedID)>> - <br><br> <<= SlaveFullName($slaves[$i])>>'s breasts<<if $slaves[$i].balls > 0>>, balls<</if>><<if $slaves[$i].ovaries == 1>>, belly<</if>>, body, and mind have been completely adapted to synthesize useful products. $He has been reclassified as part of the machine $he's now permanently attached to. This combination is projected to produce approximately - <<if $slaves[$i].balls > 0>><<print 1000*Math.trunc((3*52*(45-$slaves[$i].physicalAge))/1000)>> liters of cum,<</if>> - <<if $slaves[$i].ovaries == 1>><<print 100*Math.trunc((52*(45-$slaves[$i].physicalAge))/100)>> liters of vaginal secretions, <<if $dairyPregSetting == 3>><<print 13*(45-$slaves[$i].physicalAge)>><<else>><<print 5*(45-$slaves[$i].physicalAge)>><</if>> slaves,<</if>> - and <<print 1000*Math.trunc((300*52*(45-$slaves[$i].physicalAge))/1000)>> liters of milk over a <<print 45-$slaves[$i].physicalAge>> year period before its biological components must be replaced. - <<if ($slaves[$i].ovaries == 1)>> - <<if ($slaves[$i].balls == 0)>> + <<for _slave range _slaves>> + <<setLocalPronouns _slave>> + <<if (_slave.ID == $bioreactorPerfectedID)>> + <br><br> <<= SlaveFullName(_slave)>>'s breasts<<if _slave.balls > 0>>, balls<</if>><<if _slave.ovaries == 1>>, belly<</if>>, body, and mind have been completely adapted to synthesize useful products. $He has been reclassified as part of the machine $he's now permanently attached to. This combination is projected to produce approximately + <<if _slave.balls > 0>><<print 1000*Math.trunc((3*52*(45-_slave.physicalAge))/1000)>> liters of cum,<</if>> + <<if _slave.ovaries == 1>><<print 100*Math.trunc((52*(45-_slave.physicalAge))/100)>> liters of vaginal secretions, <<if $dairyPregSetting == 3>><<print 13*(45-_slave.physicalAge)>><<else>><<print 5*(45-_slave.physicalAge)>><</if>> slaves,<</if>> + and <<print 1000*Math.trunc((300*52*(45-_slave.physicalAge))/1000)>> liters of milk over a <<print 45-_slave.physicalAge>> year period before its biological components must be replaced. + <<if (_slave.ovaries == 1)>> + <<if (_slave.balls == 0)>> <<set $bioreactorsXX++>> <<else>> <<set $bioreactorsHerm++>> <</if>> <<else>> - <<if ($slaves[$i].balls == 0)>> + <<if (_slave.balls == 0)>> <<set $bioreactorsBarren++>> <<else>> <<set $bioreactorsXY++>> <</if>> <</if>> - <<set $activeSlave = $slaves[$i]>> + <<set $activeSlave = _slave>> <<= removeActiveSlave() >> <<break>> <</if>> diff --git a/src/uncategorized/freeRangeDairyAssignmentScene.tw b/src/uncategorized/freeRangeDairyAssignmentScene.tw index ad3cf8c3df054be206da4f878a85ee80d1b741dd..113cb90f27a87c8e0bc2e849f1f892a6fb4dc64a 100644 --- a/src/uncategorized/freeRangeDairyAssignmentScene.tw +++ b/src/uncategorized/freeRangeDairyAssignmentScene.tw @@ -21,7 +21,7 @@ <p> /* AROUSAL WHEN ENTERING */ <<set _aroused = false >> -<<if $DairyiIDs.length > 1 && canSee($activeSlave)>> +<<if App.Entity.facilities.dairy.employeesIDs().size > 1 && canSee($activeSlave)>> While <<if canWalk($activeSlave) >>walking<<else>>being carried<</if>> to $his designated stall, $he passes the other cows currently at their milking machines. Not being hurried, $he occasionally watches a cow in detail. <div> <<if $activeSlave.fetish == "boobs">> diff --git a/src/uncategorized/headGirlSuite.tw b/src/uncategorized/headGirlSuite.tw index 50d70b602fbeba42a89efa39764e4a336a9fef3b..7490a6dd0fa7ad3c811bf40f0cd307fea51663ca 100644 --- a/src/uncategorized/headGirlSuite.tw +++ b/src/uncategorized/headGirlSuite.tw @@ -13,7 +13,7 @@ <<if $HeadGirl == 0>> You have no Head Girl appointed to live in $HGSuiteName. <<link "Select Head Girl">><<goto "HG Select">><</link>> -<<elseif $HGSuiteiIDs.length > 0>> +<<elseif App.Entity.facilities.headGirlSuite.hasEmployees>> <<setLocalPronouns $HeadGirl>> Your Head Girl $HeadGirl.slaveName has $slaves[_i].slaveName living in $HGSuiteName with $him, as $his servant, assistant, and sexual appliance. <<link "Manage Head Girl">><<goto "HG Select">><</link>> diff --git a/src/uncategorized/masterSuite.tw b/src/uncategorized/masterSuite.tw index 804291cb4d25ffb3e9a9a22fe843637c63a61403..d74569219fa4841413084ff70b959c16abf1fabf 100644 --- a/src/uncategorized/masterSuite.tw +++ b/src/uncategorized/masterSuite.tw @@ -1,8 +1,7 @@ :: Master Suite [nobr] -<<set $nextButton = "Back to Main", $nextLink = "Main", $returnTo = "Master Suite", $showEncyclopedia = 1, $encyclopedia = "Master Suite", _SL = $slaves.length, _MsL = $MastSiIDs.length>> - -<<SlaveIDSort $MastSiIDs>> +<<set _slaves = App.Utils.sortedEmployees(App.Entity.facilities.masterSuite)>> +<<set $nextButton = "Back to Main", $nextLink = "Main", $returnTo = "Master Suite", $showEncyclopedia = 1, $encyclopedia = "Master Suite", _SL = $slaves.length, _MsL = _slaves.length>> <<if $masterSuiteName != "the Master Suite">> <<set $masterSuiteNameCaps = $masterSuiteName.replace("the ", "The ")>> @@ -18,28 +17,25 @@ <</if>> <<if _MsL > 0>> -<<for _dI = 0; _dI < _MsL; _dI++>> - <<set _i = $slaveIndices[$MastSiIDs[_dI]]>> - <<set _Slave = $slaves[_i]>> - +<<for _slave range _slaves>> <<if $masterSuiteUpgradeLuxury == 2>> - <<if canAchieveErection(_Slave)>> - <<set _masterSuiteAverageCum += _Slave.balls, _masterSuiteAverageDick += _Slave.dick>> + <<if canAchieveErection(_slave)>> + <<set _masterSuiteAverageCum += _slave.balls, _masterSuiteAverageDick += _slave.dick>> <</if>> - <<set _masterSuiteAverageMilk += _Slave.lactation*(_Slave.boobs-_Slave.boobsImplant), $masterSuiteAverageEnergy += _Slave.energy, _masterSuiteAveragePreg += _Slave.preg>> - <<if _Slave.fetish == "dom">> - <<set _masterSuiteAverageDom += _Slave.fetishStrength>> - <<elseif _Slave.fetish == "submissive">> - <<set _masterSuiteAverageDom -= _Slave.fetishStrength>> - <<elseif _Slave.fetish == "sadist">> - <<set _masterSuiteAverageSadism += _Slave.fetishStrength>> - <<elseif _Slave.fetish == "masochist">> - <<set _masterSuiteAverageSadism -= _Slave.fetishStrength>> + <<set _masterSuiteAverageMilk += _slave.lactation*(_slave.boobs-_slave.boobsImplant), $masterSuiteAverageEnergy += _slave.energy, _masterSuiteAveragePreg += _slave.preg>> + <<if _slave.fetish == "dom">> + <<set _masterSuiteAverageDom += _slave.fetishStrength>> + <<elseif _slave.fetish == "submissive">> + <<set _masterSuiteAverageDom -= _slave.fetishStrength>> + <<elseif _slave.fetish == "sadist">> + <<set _masterSuiteAverageSadism += _slave.fetishStrength>> + <<elseif _slave.fetish == "masochist">> + <<set _masterSuiteAverageSadism -= _slave.fetishStrength>> <</if>> <</if>> - <<if (_Slave.pregKnown == 1)>> + <<if (_slave.pregKnown == 1)>> <<set _masterSuitePregnantSlaves++>> - <<if _Slave.pregType > 1>> + <<if _slave.pregType > 1>> <<set _masterSuitePregnantSlavesMultiple++>> <</if>> <</if>> diff --git a/src/uncategorized/masterSuiteReport.tw b/src/uncategorized/masterSuiteReport.tw index ec5643d19685793048b99a04357f8b22395b2345..b8dd0ef788b7ce79264762c98ac62c0aed0a945b 100644 --- a/src/uncategorized/masterSuiteReport.tw +++ b/src/uncategorized/masterSuiteReport.tw @@ -1,38 +1,37 @@ :: Master Suite Report [nobr] -<<SlaveIDSort $MastSiIDs>> -<<set _DL = $MastSiIDs.length, _SL = $slaves.length, $legendaryAbolitionistID = 0, $masterSuiteAverageEnergy = 0, _masterSuiteAverageCum = 0, _masterSuiteAverageDick = 0, _masterSuiteAverageDom = 0, _masterSuiteAverageMilk = 0, _masterSuiteAveragePreg = 0, _masterSuiteAverageSadism = 0, _masterSuitePregnantSlaves = 0, _masterSuitePregnantSlavesMultiple = 0>> +<<set _slaves = App.Utils.sortedEmployees(App.Entity.facilities.masterSuite)>> +<<set _DL = _slaves.length, _SL = $slaves.length, $legendaryAbolitionistID = 0, $masterSuiteAverageEnergy = 0, _masterSuiteAverageCum = 0, _masterSuiteAverageDick = 0, _masterSuiteAverageDom = 0, _masterSuiteAverageMilk = 0, _masterSuiteAveragePreg = 0, _masterSuiteAverageSadism = 0, _masterSuitePregnantSlaves = 0, _masterSuitePregnantSlavesMultiple = 0>> <<if $Concubine != 0>> <<set _FLs = $slaveIndices[$Concubine.ID]>> <<if def _FLs>> - /% Add the Concubine to the $MastSiIDs list at the front of the array, so that $he displays first %/ - <<set $MastSiIDs.unshift($Concubine.ID), _DL++>> + /% Add the Concubine to the _slaves list at the front of the array, so that $he displays first %/ + <<set _slaves.unshift($Concubine), _DL++>> <</if>> <</if>> <<if _DL > 0>> - <<for _dI = 0; _dI < _DL; _dI++>> - <<set $i = $slaveIndices[$MastSiIDs[_dI]]>> - <<set $masterSuiteAverageEnergy += $slaves[$i].energy>> + <<for _slave range _slaves>> + <<set $masterSuiteAverageEnergy += _slave.energy>> <<if $masterSuiteUpgradeLuxury == 2>> - <<if canAchieveErection($slaves[$i])>> - <<set _masterSuiteAverageCum += $slaves[$i].balls, _masterSuiteAverageDick += $slaves[$i].dick>> + <<if canAchieveErection(_slave)>> + <<set _masterSuiteAverageCum += _slave.balls, _masterSuiteAverageDick += _slave.dick>> <</if>> - <<set _masterSuiteAverageMilk += $slaves[$i].lactation*($slaves[$i].boobs-$slaves[$i].boobsImplant), _masterSuiteAveragePreg += $slaves[$i].pregKnown>> - <<switch $slaves[$i].fetish>> + <<set _masterSuiteAverageMilk += _slave.lactation*(_slave.boobs-_slave.boobsImplant), _masterSuiteAveragePreg += _slave.pregKnown>> + <<switch _slave.fetish>> <<case "dom">> - <<set _masterSuiteAverageDom += $slaves[$i].fetishStrength>> + <<set _masterSuiteAverageDom += _slave.fetishStrength>> <<case "submissive">> - <<set _masterSuiteAverageDom -= $slaves[$i].fetishStrength>> + <<set _masterSuiteAverageDom -= _slave.fetishStrength>> <<case "sadist">> - <<set _masterSuiteAverageSadism += $slaves[$i].fetishStrength>> + <<set _masterSuiteAverageSadism += _slave.fetishStrength>> <<case "masochist">> - <<set _masterSuiteAverageSadism -= $slaves[$i].fetishStrength>> + <<set _masterSuiteAverageSadism -= _slave.fetishStrength>> <</switch>> <</if>> - <<if ($legendaryAbolitionistID == 0) && ($slaves[$i].devotion > 95) && ($slaves[$i].prestige == 0) && (($slaves[$i].origin == "You sentenced $him to enslavement as a punishment for attempted theft of a slave.") || ($slaves[$i].origin == "$He is an enslaved Daughter of Liberty.") || ($slaves[$i].origin === "You got $him at the Slave Shelter. $He is an enslaved Daughter of Liberty, caught some weeks after the failed coup. $His previous owner used $him as a punching bag and dart board, then when he was bored of $him tattooed obscenities all over $his body and threw $him away.") || ($slaves[$i].origin === "$He is an enslaved member of an anti-slavery extremist group.") || ($slaves[$i].career == "an antislavery activist"))>> - <<set $legendaryAbolitionistID = $slaves[$i].ID>> + <<if ($legendaryAbolitionistID == 0) && (_slave.devotion > 95) && (_slave.prestige == 0) && ((_slave.origin == "You sentenced $him to enslavement as a punishment for attempted theft of a slave.") || (_slave.origin == "$He is an enslaved Daughter of Liberty.") || (_slave.origin === "You got $him at the Slave Shelter. $He is an enslaved Daughter of Liberty, caught some weeks after the failed coup. $His previous owner used $him as a punching bag and dart board, then when he was bored of $him tattooed obscenities all over $his body and threw $him away.") || (_slave.origin === "$He is an enslaved member of an anti-slavery extremist group.") || (_slave.career == "an antislavery activist"))>> + <<set $legendaryAbolitionistID = _slave.ID>> <</if>> <</for>> <<set $masterSuiteAverageEnergy = $masterSuiteAverageEnergy/_DL>> @@ -95,18 +94,18 @@ <</if>> <</if>> - <<for _dI = 0; _dI < _DL; _dI++>> - <<set $i = $slaveIndices[$MastSiIDs[_dI]]>> - <<setLocalPronouns $slaves[$i]>> + <<for _slave range _slaves>> + <<set $i = $slaveIndices[_slave.ID]>> + <<setLocalPronouns _slave>> <br><br> /* 000-250-006 */ <<if $seeImages && $seeReportImages>> <div class="imageRef tinyImg"> - <<= SlaveArt($slaves[$i], 0, 0)>> + <<= SlaveArt(_slave, 0, 0)>> </div> <</if>> /* 000-250-006 */ - <<if ($slaves[$i].assignment == "be your Concubine")>> + <<if (_slave.assignment == "be your Concubine")>> <<set $Concubine = $slaves[_FLs]>> ''Your concubine <<= SlaveFullName($Concubine)>> is serving you in $masterSuiteName.'' More than any other slave, $his sexual brilliance and physical appeal are @@.green;critical@@ to your reputation. @@ -164,259 +163,253 @@ <<run repX(300, "concubine", $Concubine)>> <</if>> <<if $masterSuiteUpgradeLuxury > 0>> - <<set $slaves[$i].rules.living = "luxurious", $slaves[$i].devotion += 4, $slaves[$i].trust += 4>> + <<set _slave.rules.living = "luxurious", _slave.devotion += 4, _slave.trust += 4>> <<else>> - <<set $slaves[$i].rules.living = "normal", $slaves[$i].devotion += 2, $slaves[$i].trust += 2>> + <<set _slave.rules.living = "normal", _slave.devotion += 2, _slave.trust += 2>> <</if>> <<if $masterSuiteDecoration != "standard">> - <<set $slaves[$i].devotion++>> + <<set _slave.devotion++>> <</if>> <<run repX(Beauty($Concubine) * 5 + ($Concubine.skill.vaginal || 0) + ($Concubine.skill.anal || 0) + ($Concubine.skill.oral || 0) + ($Concubine.skill.whoring || 0) + ($Concubine.skill.entertainment || 0), "concubine", $Concubine)>> <<else>> /* not Concubine */ - <span class='slave-name'><<= SlaveFullName($slaves[$i])>></span> - <<if $slaves[$i].choosesOwnAssignment == 2>> + <span class='slave-name'><<= SlaveFullName(_slave)>></span> + <<if _slave.choosesOwnAssignment == 2>> <<include "SA chooses own job">> <<else>> sees to your pleasure in $masterSuiteName. <</if>> /* Perform facility based rule changes */ <<if ($masterSuiteUpgradeLuxury == 1)>> - <<set $slaves[$i].rules.living = "luxurious">> - <<if ($slaves[$i].devotion <= 95)>> - <<set $slaves[$i].devotion += 2>> + <<set _slave.rules.living = "luxurious">> + <<if (_slave.devotion <= 95)>> + <<set _slave.devotion += 2>> <</if>> <<if $masterSuiteDecoration != "standard">> - <<set $slaves[$i].devotion++>> + <<set _slave.devotion++>> <</if>> - <<if ($slaves[$i].trust < 60)>> - <<set $slaves[$i].trust++>> + <<if (_slave.trust < 60)>> + <<set _slave.trust++>> <</if>> <<elseif ($masterSuiteUpgradeLuxury == 2)>> - <<set $slaves[$i].rules.living = "luxurious">> - <<if ($slaves[$i].energy > 90)>> - <<if ($slaves[$i].devotion <= 95)>> - <<set $slaves[$i].devotion += 2>> + <<set _slave.rules.living = "luxurious">> + <<if (_slave.energy > 90)>> + <<if (_slave.devotion <= 95)>> + <<set _slave.devotion += 2>> <</if>> - <<if ($slaves[$i].trust <= 95)>> - <<set $slaves[$i].trust += 2>> + <<if (_slave.trust <= 95)>> + <<set _slave.trust += 2>> <</if>> <<else>> - <<if ($slaves[$i].devotion <= 60)>> - <<set $slaves[$i].devotion++>> + <<if (_slave.devotion <= 60)>> + <<set _slave.devotion++>> <</if>> - <<if ($slaves[$i].trust < 60)>> - <<set $slaves[$i].trust++>> + <<if (_slave.trust < 60)>> + <<set _slave.trust++>> <</if>> <</if>> <<else>> - <<set $slaves[$i].rules.living = "spare">> - <<if ($slaves[$i].devotion <= 20) && ($slaves[$i].trust >= -20)>> - <<set $slaves[$i].devotion -= 2, $slaves[$i].trust -= 5>> - <<elseif ($slaves[$i].devotion <= 60)>> - <<set $slaves[$i].devotion += 2>> - <<elseif ($slaves[$i].devotion > 60)>> - <<set $slaves[$i].devotion -= 2>> + <<set _slave.rules.living = "spare">> + <<if (_slave.devotion <= 20) && (_slave.trust >= -20)>> + <<set _slave.devotion -= 2, _slave.trust -= 5>> + <<elseif (_slave.devotion <= 60)>> + <<set _slave.devotion += 2>> + <<elseif (_slave.devotion > 60)>> + <<set _slave.devotion -= 2>> <</if>> - <<if ($slaves[$i].trust < 60)>> - <<set $slaves[$i].trust++>> + <<if (_slave.trust < 60)>> + <<set _slave.trust++>> <</if>> <</if>> <</if>> /% Both Concubine and other slaves %/ <<if $masterSuiteUpgradeLuxury == 2 && $masterSuiteAverageEnergy > random(50,90)>> - <<set _energy = (Math.ceil($slaves[$i].energy/5)*7)>> - <<run SimpleSexAct.Slave($slaves[$i], _energy)>> - <<if canPenetrate($slaves[$i])>> + <<set _energy = (Math.ceil(_slave.energy/5)*7)>> + <<run SimpleSexAct.Slave(_slave, _energy)>> + <<if canPenetrate(_slave)>> <<set _fuckCount = (random(1,3)*_energy)>> - <<set $slaves[$i].counter.penetrative += _fuckCount, $penetrativeTotal += _fuckCount>> + <<set _slave.counter.penetrative += _fuckCount, $penetrativeTotal += _fuckCount>> <</if>> - <<if $slaves[$i].nipples == "fuckable" && _masterSuiteAverageDick > 2>> + <<if _slave.nipples == "fuckable" && _masterSuiteAverageDick > 2>> <<set _fuckCount = (random(1,3)*_energy)>> - <<set $slaves[$i].counter.mammary += _fuckCount, $mammaryTotal += _fuckCount>> + <<set _slave.counter.mammary += _fuckCount, $mammaryTotal += _fuckCount>> <</if>> - <<if ($slaves[$i].trust >= -20) && ($slaves[$i].devotion > -10) && ($slaves[$i].fetishStrength <= 95) && $slaves[$i].fetish != "mindbroken">> - <<set _fetishChangeChance = fetishChangeChance($slaves[$i])>> + <<if (_slave.trust >= -20) && (_slave.devotion > -10) && (_slave.fetishStrength <= 95) && _slave.fetish != "mindbroken">> + <<set _fetishChangeChance = fetishChangeChance(_slave)>> <<if (_masterSuiteAverageMilk > 2000) && (_fetishChangeChance > random(0,50))>> - <<if $slaves[$i].fetish == "boobs">> - <<if $verboseDescriptions == 1>>$His<<else>>$slaves[$i].slaveName's<</if>> @@.lightcoral;boob fetish is strengthened@@ by the constant availability of milky nipples for $him to play with. - <<set $slaves[$i].fetishStrength += 4>> + <<if _slave.fetish == "boobs">> + <<if $verboseDescriptions == 1>>$His<<else>>_slave.slaveName's<</if>> @@.lightcoral;boob fetish is strengthened@@ by the constant availability of milky nipples for $him to play with. + <<set _slave.fetishStrength += 4>> <<else>> - <<if $verboseDescriptions == 1>>$He<<else>>$slaves[$i].slaveName<</if>> @@.lightcoral;acquires a boob fetish@@ after spending a lot of time in the fuckpit drinking from $his fellow fucktoys' tits. - <<set $slaves[$i].fetish = "boobs", $slaves[$i].fetishStrength = 65>> + <<if $verboseDescriptions == 1>>$He<<else>>_slave.slaveName<</if>> @@.lightcoral;acquires a boob fetish@@ after spending a lot of time in the fuckpit drinking from $his fellow fucktoys' tits. + <<set _slave.fetish = "boobs", _slave.fetishStrength = 65>> <</if>> - <<elseif (_masterSuiteAverageDick > 3) && ($slaves[$i].anus > 0) && (_fetishChangeChance > random(0,50))>> + <<elseif (_masterSuiteAverageDick > 3) && (_slave.anus > 0) && (_fetishChangeChance > random(0,50))>> $He - <<if $slaves[$i].fetish == "buttslut">> + <<if _slave.fetish == "buttslut">> @@.lightcoral;sinks farther into anal pleasure,@@ since $he spends $his time in the fuckpit with at least one of the many available cocks up $his butt. - <<set $slaves[$i].fetishStrength += 4>> + <<set _slave.fetishStrength += 4>> <<else>> @@.lightcoral;acquires an anal fetish@@ after helplessly orgasming at the mercy of your many fucktoys eager to shove their big stiff penises up $his ass. - <<set $slaves[$i].fetish = "buttslut", $slaves[$i].fetishStrength = 65>> + <<set _slave.fetish = "buttslut", _slave.fetishStrength = 65>> <</if>> <<elseif (_masterSuiteAverageCum > 3) && (_fetishChangeChance > random(0,50))>> $He - <<if $slaves[$i].fetish == "cumslut">> + <<if _slave.fetish == "cumslut">> @@.lightcoral;sinks farther into cum addiction,@@ since $he spends $his time in the fuckpit eagerly sucking down ejaculate, straight from the many sources. - <<set $slaves[$i].fetishStrength += 4>> + <<set _slave.fetishStrength += 4>> <<else>> @@.lightcoral;acquires an oral fixation@@ after orally servicing your many fucktoys eager to blow their loads down $his throat. - <<set $slaves[$i].fetish = "cumslut", $slaves[$i].fetishStrength = 65>> + <<set _slave.fetish = "cumslut", _slave.fetishStrength = 65>> <</if>> <<elseif (_masterSuiteAveragePreg > 10) && (_fetishChangeChance > random(0,50))>> $He - <<if $slaves[$i].fetish == "pregnancy">> + <<if _slave.fetish == "pregnancy">> @@.lightcoral;sinks farther into pregnancy obsession,@@ since $he never wants for a pregnant girl to make love to. - <<set $slaves[$i].fetishStrength += 4>> + <<set _slave.fetishStrength += 4>> <<else>> @@.lightcoral;acquires a pregnancy fetish,@@ since many of $his sexual partners in the fuckpit are heavily pregnant. - <<set $slaves[$i].fetish = "pregnancy", $slaves[$i].fetishStrength = 65>> + <<set _slave.fetish = "pregnancy", _slave.fetishStrength = 65>> <</if>> <<elseif (_masterSuiteAverageDom < 50) && (_fetishChangeChance > random(0,50))>> $He - <<if $slaves[$i].fetish == "dom">> + <<if _slave.fetish == "dom">> @@.lightcoral;becomes more dominant,@@ since there are so many subs in the fuckpit who beg $him to fuck them hard. - <<set $slaves[$i].fetishStrength += 4>> + <<set _slave.fetishStrength += 4>> <<else>> @@.lightcoral;becomes sexually dominant@@ after having fun satisfying the many submissive fucktoys in the fuckpit who beg $him to top them. - <<set $slaves[$i].fetish = "dom", $slaves[$i].fetishStrength = 65>> + <<set _slave.fetish = "dom", _slave.fetishStrength = 65>> <</if>> <<elseif (_masterSuiteAverageDom > 50) && (_fetishChangeChance > random(0,50))>> $He - <<if $slaves[$i].fetish == "submissive">> + <<if _slave.fetish == "submissive">> @@.lightcoral;becomes even more submissive,@@ since there are so many doms in the fuckpit that $he's often used by more than one at once. - <<set $slaves[$i].fetishStrength += 4>> + <<set _slave.fetishStrength += 4>> <<else>> @@.lightcoral;becomes sexually submissive@@ after the many dominant slaves in the fuckpit hold $him down and use $him for their pleasure. - <<set $slaves[$i].fetish = "submissive", $slaves[$i].fetishStrength = 65>> + <<set _slave.fetish = "submissive", _slave.fetishStrength = 65>> <</if>> <<elseif (_masterSuiteAverageSadism < 50) && (_fetishChangeChance > random(0,50))>> $He - <<if $slaves[$i].fetish == "sadist">> + <<if _slave.fetish == "sadist">> @@.lightcoral;becomes more sadistic,@@ since there are so many sluts in the fuckpit who will do anything for $him if $he'll only spank them. - <<set $slaves[$i].fetishStrength += 4>> + <<set _slave.fetishStrength += 4>> <<else>> @@.lightcoral;becomes a bit of a sadist@@ after $he notices that so many of $his fellow fucktoys cum harder if $he gives them a good slap. - <<set $slaves[$i].fetish = "sadist", $slaves[$i].fetishStrength = 65>> + <<set _slave.fetish = "sadist", _slave.fetishStrength = 65>> <</if>> <<elseif (_masterSuiteAverageSadism > 50) && (_fetishChangeChance > random(0,50))>> - <<if $slaves[$i].fetish == "masochist">> - <<if $verboseDescriptions == 1>>$His<<else>>$slaves[$i].slaveName's<</if>> @@.lightcoral;pain addiction deepens,@@ since the fuckpit is full of ladies happy to fuck $him while $he screams. - <<set $slaves[$i].fetishStrength += 4>> + <<if _slave.fetish == "masochist">> + <<if $verboseDescriptions == 1>>$His<<else>>_slave.slaveName's<</if>> @@.lightcoral;pain addiction deepens,@@ since the fuckpit is full of ladies happy to fuck $him while $he screams. + <<set _slave.fetishStrength += 4>> <<else>> - <<if $verboseDescriptions == 1>>$He<<else>>$slaves[$i].slaveName<</if>> @@.lightcoral;learns masochism@@ after experiencing many orgasms under the exquisite sexual torture of the sadists in the fuckpit. - <<set $slaves[$i].fetish = "masochist", $slaves[$i].fetishStrength = 65>> + <<if $verboseDescriptions == 1>>$He<<else>>_slave.slaveName<</if>> @@.lightcoral;learns masochism@@ after experiencing many orgasms under the exquisite sexual torture of the sadists in the fuckpit. + <<set _slave.fetish = "masochist", _slave.fetishStrength = 65>> <</if>> <</if>> <</if>> - <<if $slaves[$i].lactation > 0>> - <<set $slaves[$i].lactationDuration = 2>> - <<set $slaves[$i].boobs -= $slaves[$i].boobsMilk, $slaves[$i].boobsMilk = 0>> + <<if _slave.lactation > 0>> + <<set _slave.lactationDuration = 2>> + <<set _slave.boobs -= _slave.boobsMilk, _slave.boobsMilk = 0>> <</if>> - <<if $slaves[$i].energy > 40 && $slaves[$i].energy < 95>> + <<if _slave.energy > 40 && _slave.energy < 95>> Being a constant part of the fuckpit orgy @@.green;greatly heightens $his libido.@@ - <<set $slaves[$i].energy += 2>> + <<set _slave.energy += 2>> <</if>> - <<set $slaves[$i].need -= 50>> + <<set _slave.need -= 50>> <</if>> <<if $masterSuiteUpgradePregnancy == 1>> /* If they're not on fertility drugs and the toggle is active, stick them on (if they can take them). Otherwise take them off. */ - <<if ($masterSuitePregnancyFertilityDrugs == 1) && ($slaves[$i].drugs != "fertility drugs") && canGetPregnant($slaves[$i])>> - <<set $slaves[$i].drugs = "fertility drugs">> - <<elseif ($masterSuiteHyperPregnancy == 1) && ($slaves[$i].drugs != "super fertility drugs") && canGetPregnant($slaves[$i])>> - <<set $slaves[$i].drugs = "super fertility drugs">> - <<elseif ((($masterSuitePregnancyFertilityDrugs == 0) && ($slaves[$i].drugs == "fertility drugs")) || (($masterSuiteHyperPregnancy == 0) && ($slaves[$i].drugs == "super fertility drugs"))) || (!canGetPregnant($slaves[$i]) && ["fertility drugs", "super fertility drugs"].includes($slaves[$i].drugs))>> - <<set $slaves[$i].drugs = "no drugs">> + <<if ($masterSuitePregnancyFertilityDrugs == 1) && (_slave.drugs != "fertility drugs") && canGetPregnant(_slave)>> + <<set _slave.drugs = "fertility drugs">> + <<elseif ($masterSuiteHyperPregnancy == 1) && (_slave.drugs != "super fertility drugs") && canGetPregnant(_slave)>> + <<set _slave.drugs = "super fertility drugs">> + <<elseif ((($masterSuitePregnancyFertilityDrugs == 0) && (_slave.drugs == "fertility drugs")) || (($masterSuiteHyperPregnancy == 0) && (_slave.drugs == "super fertility drugs"))) || (!canGetPregnant(_slave) && ["fertility drugs", "super fertility drugs"].includes(_slave.drugs))>> + <<set _slave.drugs = "no drugs">> <</if>> /* We don't know they're pregnant for a month or so by game logic */ - <<if ($slaves[$i].pregKnown == 1)>> + <<if (_slave.pregKnown == 1)>> /* Once we know they're knocked up, get the counter going. */ <<set _masterSuitePregnantSlaves += 1>> /* Don't know about twins/triplets etc until 10 weeks. Once we do, get the counter going */ - <<if ($slaves[$i].pregType > 1) && ($slaves[$i].preg >= $slaves[$i].pregData.normalBirth/1.33)>> + <<if (_slave.pregType > 1) && (_slave.preg >= _slave.pregData.normalBirth/1.33)>> <<set _masterSuitePregnantSlavesMultiple += 1>> <</if>> /* If they're preggo and in the upgraded suite, give them extra devotion. More if they're being given lighter duties. */ - <<if ($slaves[$i].devotion <= 100)>> + <<if (_slave.devotion <= 100)>> <<if ($masterSuitePregnancySlaveLuxuries == 0)>> - <<set $slaves[$i].devotion += 2>> + <<set _slave.devotion += 2>> <<else>> - <<set $slaves[$i].devotion += 5>> + <<set _slave.devotion += 5>> <</if>> <</if>> /* If they're preggo and in the upgraded suite, give them extra trust. More if they're being given lighter duties. */ - <<if ($slaves[$i].trust <= 100)>> + <<if (_slave.trust <= 100)>> <<if ($masterSuitePregnancySlaveLuxuries == 0)>> - <<set $slaves[$i].trust += 2>> + <<set _slave.trust += 2>> <<else>> - <<set $slaves[$i].trust += 5>> + <<set _slave.trust += 5>> <</if>> <</if>> /* If they're preggo and in the upgraded suite, give them extra health. More if they're being given lighter duties. */ - <<if ($slaves[$i].health.condition < 100)>> + <<if (_slave.health.condition < 100)>> <<if ($masterSuitePregnancySlaveLuxuries == 0)>> - <<run improveCondition($slaves[$i], 15)>> + <<run improveCondition(_slave, 15)>> <<else>> - <<run improveCondition($slaves[$i], 25)>> + <<run improveCondition(_slave, 25)>> <</if>> <</if>> <</if>> <</if>> <<if $verboseDescriptions == 1>> - <br> $He <<= App.SlaveAssignment.pleaseYou($slaves[$i])>> + <br> $He <<= App.SlaveAssignment.pleaseYou(_slave)>> <br> - <<if $servantMilkers == 1 && $slaves[$i].lactation > 0 && $slaves[$i].fuckdoll == 0 && $slaves[$i].fetish != "mindbroken" && canWalk($slaves[$i]) && $slaves[$i].intelligence+$slaves[$i].intelligenceImplant >= -90>> + <<if $servantMilkers == 1 && _slave.lactation > 0 && _slave.fuckdoll == 0 && _slave.fetish != "mindbroken" && canWalk(_slave) && _slave.intelligence+_slave.intelligenceImplant >= -90>> When $his breasts begin to feel full and you aren't around, $he avails $himself to the penthouse milkers and <<set $servantMilkersMultiplier = 0.25>> - <<run App.SlaveAssignment.getMilked($slaves[$i])>> + <<run App.SlaveAssignment.getMilked(_slave)>> <<set $servantMilkersMultiplier = 1>> gives $milk liters of milk over the week, which is sold for @@.yellowgreen;<<print cashFormat($milkSale)>>.@@ <</if>> <br> - <<= App.SlaveAssignment.choosesOwnClothes($slaves[$i])>> + <<= App.SlaveAssignment.choosesOwnClothes(_slave)>> <<include "SA rules">> <<include "SA diet">> <<include "SA long term effects">> - <<= App.SlaveAssignment.drugs($slaves[$i])>> + <<= App.SlaveAssignment.drugs(_slave)>> <<include "SA relationships">> <<include "SA rivalries">> <br><<include "SA devotion">> <<else>> <<silently>> <<include "SA chooses own job">> - <<run App.SlaveAssignment.pleaseYou($slaves[$i])>> - <<if $servantMilkers == 1 && $slaves[$i].lactation > 0 && $slaves[$i].fuckdoll == 0 && $slaves[$i].fetish != "mindbroken" && canWalk($slaves[$i]) && $slaves[$i].intelligence+$slaves[$i].intelligenceImplant >= -90>> + <<run App.SlaveAssignment.pleaseYou(_slave)>> + <<if $servantMilkers == 1 && _slave.lactation > 0 && _slave.fuckdoll == 0 && _slave.fetish != "mindbroken" && canWalk(_slave) && _slave.intelligence+_slave.intelligenceImplant >= -90>> <<set $servantMilkersMultiplier = 0.25>> - <<run App.SlaveAssignment.getMilked($slaves[$i])>> + <<run App.SlaveAssignment.getMilked(_slave)>> <<set $servantMilkersMultiplier = 1>> <</if>> - <<run App.SlaveAssignment.choosesOwnClothes($slaves[$i])>> + <<run App.SlaveAssignment.choosesOwnClothes(_slave)>> <<include "SA rules">> <<include "SA diet">> <<include "SA long term effects">> - <<run App.SlaveAssignment.drugs($slaves[$i])>> + <<run App.SlaveAssignment.drugs(_slave)>> <<include "SA relationships">> <<include "SA rivalries">> <<include "SA devotion">> <</silently>> <</if>> - <<if $slaves[$i].health.condition < 80>> + <<if _slave.health.condition < 80>> <<if $masterSuiteUpgradeLuxury == 1>> - <<run improveCondition($slaves[$i], 20)>> + <<run improveCondition(_slave, 20)>> <<else>> - <<run improveCondition($slaves[$i], 10)>> + <<run improveCondition(_slave, 10)>> <</if>> <</if>> <</for>> - <<if $Concubine != 0 && def _FLs>> - /% Remove the Concubine from the $MastSiIDs list %/ - <<set $Concubine = $slaves[_FLs]>> - <<run $MastSiIDs.deleteAt(0), _DL-->> - <</if>> - <br><br> <<if $arcologies[0].FSRestart != "unset" && $propOutcome != 1 && _masterSuitePregnantSlaves > 0 && $eugenicsFullControl != 1>> diff --git a/src/uncategorized/newSlaveIntro.tw b/src/uncategorized/newSlaveIntro.tw index 1e4aaaf8e54290366c2ef77e0855ccd332ddae0e..72dcb834bff59d68cd718801de498cbdf4e539f9 100644 --- a/src/uncategorized/newSlaveIntro.tw +++ b/src/uncategorized/newSlaveIntro.tw @@ -2291,7 +2291,7 @@ The legalities completed, <span class='slave-name'><<= SlaveFullName($activeSlav <<set $activeSlave.trust -= 10>> <</link>> <<if ($activeSlave.lactation > 0 || (($dairySlimMaintainUpgrade == 0 || $dairySlimMaintain == 0) && ($activeSlave.boobs > 300 || $activeSlave.dick == 0 || $dairyImplantsSetting == 1) && $dairyImplantsSetting != 2)) || ($activeSlave.balls > 0)>> - <<if ($dairyPrepUpgrade == 1) && ($dairy > $DairyiIDs.length+$bioreactorsXY+$bioreactorsXX+$bioreactorsHerm+$bioreactorsBarren)>> + <<if ($dairyPrepUpgrade == 1) && App.Entity.facilities.dairy.hasFreeSpace>> | <<link "Send $him straight to the Industrial Dairy">> <<set $activeSlave.choosesOwnAssignment = 0>> <<set $activeSlave.anus = Math.clamp($activeSlave.anus, 3, 4)>> @@ -2303,7 +2303,7 @@ The legalities completed, <span class='slave-name'><<= SlaveFullName($activeSlav <</replace>> <</link>> <</if>> - <<if $dairy > $DairyiIDs.length+$bioreactorsXY+$bioreactorsXX+$bioreactorsHerm+$bioreactorsBarren>> + <<if App.Entity.facilities.dairy.hasFreeSpace>> | <<link "Break $him in for the Industrial Dairy">> <<set $activeSlave.choosesOwnAssignment = 0>> <<set $activeSlave.anus = Math.clamp($activeSlave.anus, 3, 4)>> @@ -2405,13 +2405,13 @@ The legalities completed, <span class='slave-name'><<= SlaveFullName($activeSlav <<set $activeSlave.trust -= 10>> <</link>> - <<if ($arcade > $ArcadeiIDs.length) || ($arcadeUpgradeFuckdolls == 2)>> + <<if (App.Entity.facilities.arcade.hasFreeSpace) || ($arcadeUpgradeFuckdolls == 2)>> | <<link "Send $him straight to the Arcade">> <<set $activeSlave.assignment = "be confined in the arcade">> <<set $activeSlave.choosesOwnAssignment = 0>> <<replace "#introResult">> You order <<if $HeadGirl == 0>>another slave<<else>>$HeadGirl.slaveName<</if>> to get $activeSlave.slaveName set up in $arcadeName. The new slave does not know what $arcadeName is, not really, and $he doesn't know what being set up there means, either. $He'll be confined inside a small space, not too different from the indignities $he's suffered already. It's only when the restraints lock into place that $he'll understand $his doom. $His mouth will be forced open and presented at one wall of $arcadeName, and $his ass will protrude from its other side, $his holes available for public relief at both ends. $He'll probably refuse to believe the truth, until the first cockhead enters $his mouth<<if $activeSlave.vagina > -1>>, parts $his pussylips,<</if>> or presses against $his poor anus. - <<if ($arcade <= $ArcadeiIDs.length)>>Mere <<if $showInches == 2>>yards<<else>>meters<</if>> away, preparations to convert the least appealing Arcade slave into a Fuckdoll begin. As $activeSlave.slaveName is broken in by $his first customers, $he's blissfully unaware that $he's $arcade new slaves away from the same fate.<</if>> + <<if ($arcade <= App.Entity.facilities.arcade.employeesIDs().size)>>Mere <<if $showInches == 2>>yards<<else>>meters<</if>> away, preparations to convert the least appealing Arcade slave into a Fuckdoll begin. As $activeSlave.slaveName is broken in by $his first customers, $he's blissfully unaware that $he's $arcade new slaves away from the same fate.<</if>> <</replace>> <</link>> <</if>> diff --git a/src/uncategorized/penthouseReport.tw b/src/uncategorized/penthouseReport.tw index 078eab1b3d43fe5a856cb8ed14e058f534cf897c..d38a718ebf40538fb8f377b18f827a989f3a354e 100644 --- a/src/uncategorized/penthouseReport.tw +++ b/src/uncategorized/penthouseReport.tw @@ -1,7 +1,13 @@ :: Penthouse Report [nobr] -<<SlaveIDSort $HGSuiteiIDs>> <<set _SL = $slaves.length>> +<<if _S.HeadGirl>> + <<set _HGID = _S.HeadGirl.ID>> +<<else>> + <<set _HGID = 0>> +<</if>> + +<<set _HGSuitSlaves = App.Utils.jobForAssignment(Job.HEADGIRLSUITE).employees()>> <<for $i = 0; $i < _SL; $i++>> <<if assignmentVisible($slaves[$i])>> @@ -13,10 +19,10 @@ <<include "Full Report">> <br><br> - <<if ($slaves[$i].assignment == "be your Head Girl") && ($HGSuiteiIDs.length > 0)>> + <<if ($slaves[$i].ID == _HGID) && (_HGSuitSlaves.length > 0)>> /% We found the Head Girl, now let's find her slave %/ <<set _iTemp = $i>> - <<set _ID = $HGSuiteiIDs[0], $i = $slaveIndices[_ID]>> + <<set _ID = _HGSuitSlaves[0].ID, $i = $slaveIndices[_ID]>> <<if $slaves[$i].assignment != "live with your Head Girl">> <br>@@.red;$slaves[$i].slaveName had been assigned to live with your Head Girl, but this week $he was assigned to $slaves[$i].assignment. $He has been released to your penthouse for reassignment.@@ @@ -38,4 +44,4 @@ <</for>> /* count open spots in facilities after all assignments have been decided for the week */ -<<set $brothelSpots = $brothel - $BrothiIDs.length, $clubSpots = $club - $ClubiIDs.length, $dairySpots = $dairy - $DairyiIDs.length, $servantsQuartersSpots = $servantsQuarters - $ServQiIDs.length>> +<<set $brothelSpots = App.Entity.facility.brothel.freeSpace, $clubSpots = App.Entity.facility.club.freeSpace, $dairySpots = App.Entity.facility.dairy.freeSpace, $servantsQuartersSpots = App.Entity.facility.servantsQuarters.freeSpace>> diff --git a/src/uncategorized/randomNonindividualEvent.tw b/src/uncategorized/randomNonindividualEvent.tw index e2a2c1732083e4fad023e8fc66cad6d242562cce..da12f5378eab89dde87d6cdf1869a77b0a2c47b8 100644 --- a/src/uncategorized/randomNonindividualEvent.tw +++ b/src/uncategorized/randomNonindividualEvent.tw @@ -280,6 +280,7 @@ <</for>> /* Multislave Events */ + <<set _L = App.Utils.countFacilityWorkers(["brothel", "clinic", "club", "dairy", "cellblock", "spa", "schoolroom", "servantsQuarters"])>> <<if $fuckSlaves > 1>> <<set $bedSlaves = $slaves.filter(function(s) { return s.devotion > 50 && (s.assignment == "please you" || s.assignment == "serve in the master suite" || s.assignment == "be your Concubine") && !isAmputee(s) && canDoAnal(s); })>> @@ -308,27 +309,27 @@ <<set $events.push("RE rebels")>> <</if>> - <<if $BrothiIDs.length > 3>> + <<if _L.brothel > 3>> <<set $events.push("RE busy brothel")>> <</if>> - <<if $BrothiIDs.length > 5>> + <<if _L.brothel > 5>> <<set $events.push("RE brothel function")>> <</if>> - <<if $ClubiIDs.length > 3>> + <<if _L.club > 3>> <<set $events.push("RE busy club")>> <</if>> - <<if $DairyiIDs.length > 3>> + <<if _L.dairy > 3>> <<if $dairyRestraintsSetting < 2>> <<set $events.push("RE busy dairy")>> <</if>> <</if>> - <<if $ServQiIDs.length > 3>> + <<if _L.servantsQuarters > 3>> <<set $events.push("RE busy servants quarters")>> <</if>> - <<if $ArcadeiIDs.length > 3>> + <<if App.Entity.facilities.arcade.employeesIDs().size > 3>> <<set $events.push("RE busy arcade")>> <</if>> - <<if $MastSiIDs.length > 3>> + <<if App.Entity.facilities.masterSuite.employeesIDs().size > 3>> <<if $Concubine != 0>> <<set $events.push("RE busy master suite")>> <</if>> @@ -406,7 +407,7 @@ <</if>> - <<if ($Milkmaid != 0) && ($DairyiIDs.length >= 5) && ($Milkmaid.health.condition >= 70)>> + <<if ($Milkmaid != 0) && (_L.dairy >= 5) && ($Milkmaid.health.condition >= 70)>> <<if ($Milkmaid.muscles > 5)>> <<set $PESSevent.push("tired milkmaid")>> <</if>> @@ -415,31 +416,31 @@ <</if>> <</if>> - <<if ($Stewardess != 0) && ($ServQiIDs.length > 0) && ($Stewardess.actualAge >= 35 || $AgePenalty == 0)>> + <<if ($Stewardess != 0) && (_L.servantsQuarters > 0) && ($Stewardess.actualAge >= 35 || $AgePenalty == 0)>> <<set $PETSevent.push("stewardess beating")>> <</if>> - <<if ($Madam != 0) && ($BrothiIDs.length >= 5) && ($Madam.actualAge >= 35 || $AgePenalty == 0) && ($Madam.skill.whoring >= 100)>> + <<if ($Madam != 0) && (_L.brothel >= 5) && ($Madam.actualAge >= 35 || $AgePenalty == 0) && ($Madam.skill.whoring >= 100)>> <<set $PESSevent.push("madam strategy")>> <</if>> - <<if ($DJ != 0) && ($ClubiIDs.length >= 5) && ($DJ.face > 95) && ($DJ.skill.entertainment >= 100)>> + <<if ($DJ != 0) && (_L.club >= 5) && ($DJ.face > 95) && ($DJ.skill.entertainment >= 100)>> <<set $PESSevent.push("DJ publicity")>> <</if>> - <<if ($Schoolteacher != 0) && ($SchlRiIDs.length > 0) && ($Schoolteacher.intelligence+$Schoolteacher.intelligenceImplant > 15) && ($Schoolteacher.actualAge >= 35)>> + <<if ($Schoolteacher != 0) && (_L.schoolroom > 0) && ($Schoolteacher.intelligence+$Schoolteacher.intelligenceImplant > 15) && ($Schoolteacher.actualAge >= 35)>> <<set $PETSevent.push("aggressive schoolteacher")>> <</if>> - <<if ($Wardeness != 0) && ($CellBiIDs.length > 0) && canTalk($Wardeness)>> + <<if ($Wardeness != 0) && (_L.cellblock > 0) && canTalk($Wardeness)>> <<set $PETSevent.push("abusive wardeness")>> <</if>> - <<if (_S.Attendant) && ($SpaiIDs.length > 0) && canTalk(_S.Attendant)>> + <<if (_S.Attendant) && (_L.spa > 0) && canTalk(_S.Attendant)>> <<set $PETSevent.push("comforting attendant")>> <</if>> - <<if ($Nurse != 0) && ($CliniciIDs.length > 0) && ($Nurse.energy > 95) || (($Nurse.fetishStrength > 60) && ($Nurse.fetish == "sadist" || $Nurse.fetish == "dom"))>> + <<if ($Nurse != 0) && (_L.clinic > 0) && ($Nurse.energy > 95) || (($Nurse.fetishStrength > 60) && ($Nurse.fetish == "sadist" || $Nurse.fetish == "dom"))>> <<set $subSlave = $slaves.find(function(s) { return s.anus != 0 && s.assignment == "get treatment in the clinic"; })>> <<if (def $subSlave)>> <<set $PETSevent.push("nurse molestation")>> diff --git a/src/uncategorized/reBusyArcade.tw b/src/uncategorized/reBusyArcade.tw index f94651bd69e7586b217d39e0cb2f07a3f6ad6640..cf3504175da09fcba2c593f132ca59a81e0c6d35 100644 --- a/src/uncategorized/reBusyArcade.tw +++ b/src/uncategorized/reBusyArcade.tw @@ -1,13 +1,6 @@ :: RE busy arcade [nobr] -<<set _rebaIDs = []>> -<<for _reba = 0; _reba < $ArcadeiIDs.length; _reba++>> - <<set _rebaIndex = $slaveIndices[$ArcadeiIDs[_reba]]>> - <<if hasAnyArms($slaves[_rebaIndex]) && $slaves[_rebaIndex].fetish != "mindbroken" && $slaves[_rebaIndex].devotion < 45>> - <<set _rebaIDs.push($slaves[_rebaIndex].ID)>> - <</if>> -<</for>> -<<set $activeSlave = getSlave(_rebaIDs.random())>> +<<set $activeSlave = App.Entity.facilities.arcade.employees().filter(s => hasAnyArms(s) && s.fetish !== "mindbroken" && s.devotion <45).random()>> <<if (ndef $activeSlave)>> <<goto "RIE Eligibility Check">> diff --git a/src/uncategorized/reBusyBrothel.tw b/src/uncategorized/reBusyBrothel.tw index ca2e1c47b183a394133e834356a26657ce5588dd..4812e27841be06f90ffe3d1fd5666653e9ce2096 100644 --- a/src/uncategorized/reBusyBrothel.tw +++ b/src/uncategorized/reBusyBrothel.tw @@ -15,51 +15,50 @@ Of course, $brothelName is the best establishment of its kind in the arcology. C <<link "Surprise the hardworking whores with a day of rest">> <<replace "#result">> The problem with assembly-line sex is that it has a tendency to destroy any sense of intimacy or fun. So, you make some simple preparations and close the brothel for a day, hiring some freelancers to cover. All your slave whores are allowed to sleep late, and then spend the day with you playing games and enjoying light amusements. The slaves are surprised by your generosity, but they have fun. Many of the games are sexually themed. One day of giggling and squealing can't completely reverse the transactionalization of sex for them, but they @@.hotpink;appreciate the effort.@@ - <<for $i = 0; $i < $BrothiIDs.length; $i++>> - <<set $slaves[$slaveIndices[$BrothiIDs[$i]]].devotion += 4>> - <<set $slaves[$slaveIndices[$BrothiIDs[$i]]].lastWeeksCashIncome += 250>> - <<set $slaves[$slaveIndices[$BrothiIDs[$i]]].lifetimeCashIncome += 250>> - <</for>> + <<run App.Entity.facilities.brothel.employees().forEach(s => { + s.devotion += 4; + s.lastWeeksCashIncome += 250; + s.lifetimeCashIncome += 250; + })>> <<run cashX(-1000, "event")>> <</replace>> <</link>> //This will cost <<print cashFormat(1000)>>// <br><<link "Hire an expert hooker to give lessons">> <<replace "#result">> - The citizen streetwalker has had her day. A few of the cleverest have avoided being driven into poverty, either by becoming madams or by finding a way to build a new career serving the slave brothel industry. One of these is touring the city, offering her long sexual experience in seminars for slave prostitutes. Her services are not cheap, but it rapidly becomes clear that they are worth it. She is a grey-haired but still elegant woman with deep crow's feet and a smoker's voice. She is not only a sexual master, but a hard-bitten and comprehensively experienced businesswoman. All of your brothel slaves with any room for improvement in their whoring skills @@.green;learn from her lessons,@@ while those who have nothing to learn @@.hotpink;gain confidence@@ from her praise. - <<for $i = 0; $i < $BrothiIDs.length; $i++>> - <<set $slaves[$slaveIndices[$BrothiIDs[$i]]].lastWeeksCashIncome += 250>> - <<set $slaves[$slaveIndices[$BrothiIDs[$i]]].lifetimeCashIncome += 250>> - <<if $slaves[$slaveIndices[$BrothiIDs[$i]]].skill.whoring < 100>> - <<set $slaves[$i].skill.whoring += 10>> - <<else>> - <<set $slaves[$slaveIndices[$BrothiIDs[$i]]].devotion += 4>> - <</if>> - <</for>> - <<run cashX(-2000, "event")>> + The citizen streetwalker has had her day. A few of the cleverest have avoided being driven into poverty, either by becoming madams or by finding a way to build a new career serving the slave brothel industry. One of these is touring the city, offering her long sexual experience in seminars for slave prostitutes. Her services are not cheap, but it rapidly becomes clear that they are worth it. She is a grey-haired but still elegant woman with deep crow's feet and a smoker's voice. She is not only a sexual master, but a hard-bitten and comprehensively experienced businesswoman. All of your brothel slaves with any room for improvement in their whoring skills @@.green;learn from her lessons,@@ while those who have nothing to learn @@.hotpink;gain confidence@@ from her praise. + <<run App.Entity.facilities.brothel.employees().forEach(s => { + s.lastWeeksCashIncome += 250; + s.lifetimeCashIncome += 250; + if (s.skill.whoring < 100) { + s.skill.whoring += 10; + } else { + s.devotion += 4; + } + })>> + <<run cashX(-2000, "event")>> <</replace>> <</link>> //This will cost <<print cashFormat(2000)>>// <br><<link "Eliminate prices for one morning to promote the brothel">> <<replace "#result">> - The news that sex will be free at the brothel travels like wildfire. Security measures are necessary to control the throng that spends the entire day entering and leaving the brothel, though as the day goes on the crowds thin. By midmorning, all the holes on offer are so fucked out that only those who fetishize that sort of thing stick around. The brothel is a real seminal sewer by noon, and it smells like it. Nevertheless, free sex is a short route to @@.green;public approval,@@ though you do miss a morning's fees. The poor slave whores are @@.red;fairly battered@@ by so much wear and tear in so little time. - <<for $i = 0; $i < $BrothiIDs.length; $i++>> - <<set _rebb = $slaveIndices[$BrothiIDs[$i]]>> - <<run healthDamage($slaves[_rebb], 10)>> - <<if canDoVaginal($slaves[_rebb])>> - <<set $slaves[_rebb].counter.vaginal += 5>> - <<set $vaginalTotal += 5>> - <<if canDoAnal($slaves[_rebb])>> - <<set $slaves[_rebb].counter.anal += 5>> - <<set $analTotal += 5>> - <</if>> - <<elseif canDoAnal($slaves[_rebb])>> - <<set $slaves[_rebb].counter.anal += 10>> - <<set $analTotal += 10>> - <</if>> - <<set $slaves[_rebb].counter.oral += 10>> - <<set $oralTotal += 10>> - <</for>> - <<run cashX(-2000, "event")>> - <<run repX(1000, "event")>> + The news that sex will be free at the brothel travels like wildfire. Security measures are necessary to control the throng that spends the entire day entering and leaving the brothel, though as the day goes on the crowds thin. By midmorning, all the holes on offer are so fucked out that only those who fetishize that sort of thing stick around. The brothel is a real seminal sewer by noon, and it smells like it. Nevertheless, free sex is a short route to @@.green;public approval,@@ though you do miss a morning's fees. The poor slave whores are @@.red;fairly battered@@ by so much wear and tear in so little time. + <<run App.Entity.facilities.brothel.employees().forEach(s => { + healthDamage(s, 10); + if (canDoVaginal(s)) { + s.counter.vaginal += 5; + V.vaginalTotal += 5; + if (canDoAnal(s)) { + s.counter.anal += 5; + V.analTotal += 5; + } + } else if (canDoAnal(s)) { + s.counter.anal += 10; + V.analTotal += 10; + } + s.counter.oral += 10; + V.oralTotal += 10; + })>> + <<run cashX(-2000, "event")>> + <<run repX(1000, "event")>> <</replace>> <</link>> //This will cost <<print cashFormat(2000)>>// </span> diff --git a/src/uncategorized/reBusyDairy.tw b/src/uncategorized/reBusyDairy.tw index dc158dbe820ea5830557a48656915bf27f0e6ddb..d0c3307746154632124c834a91f80f1955d0e281 100644 --- a/src/uncategorized/reBusyDairy.tw +++ b/src/uncategorized/reBusyDairy.tw @@ -15,17 +15,16 @@ Even with high doses of modern drugs, human cows simply do not produce a very hi <<link "Share a milk bath with the cows">> <<replace "#result">> Milk is a fashionable skin treatment in the Free Cities, and many of the cows fetishize their breasts and their milk. Many of them giggle with delight when you bring them all into a large spa room with a huge tub full of their fresh milk. A pittance will be lost from sales, but it's hard to think of such things when swimming and splashing in warm, nutty mother's milk with so many huge-breasted slaves, many of whom are milking themselves into the bath. Some of the older ones relax and luxuriate, gently milking themselves and masturbating or each other, according to taste. The younger cows prefer to rub themselves against you, taking turns being fucked. Regardless, they all @@.hotpink;appreciate such a special experience.@@ - <<for $i = 0; $i < $DairyiIDs.length; $i++>> - <<set _rebd = $slaveIndices[$DairyiIDs[$i]]>> - <<set $slaves[_rebd].devotion += 4>> - <<if canDoVaginal($slaves[_rebd])>> - <<set $slaves[_rebd].counter.vaginal += 1>> + <<for _slave range App.Utils.jobForAssignment(Job.DAIRY).employees()>> + <<set _slave.devotion += 4>> + <<if canDoVaginal(_slave)>> + <<set _slave.counter.vaginal += 1>> <<set $vaginalTotal += 1>> - <<elseif canDoAnal($slaves[_rebd])>> - <<set $slaves[_rebd].counter.anal += 1>> + <<elseif canDoAnal(_slave)>> + <<set _slave.counter.anal += 1>> <<set $analTotal += 1>> <</if>> - <<set $slaves[_rebd].counter.oral += 1>> + <<set _slave.counter.oral += 1>> <<set $oralTotal += 1>> <</for>> <<run cashX(-1000, "event")>> diff --git a/src/uncategorized/reRecruit.tw b/src/uncategorized/reRecruit.tw index 80cc3ab9c9fe8bde70a2813f9b37cea7d908af07..a3e2b22c7625da506c6ed93aa6acebe59e0ba358 100644 --- a/src/uncategorized/reRecruit.tw +++ b/src/uncategorized/reRecruit.tw @@ -2582,7 +2582,7 @@ He explains that one of his servant <<= $girl>>s was impregnated by his fool of You complete the legalities and biometric scanning quickly and without fuss. $activeSlave.slaveName participates matter-of-factly, and there's a certain sense of relief about $him. $His fate is out of $his hands now, and you get the impression $he isn't sorry about that at all. <<case "desperate birth">> You complete the legalities and biometric scanning quickly before - <<if $clinic > 0 && $clinic < $CliniciIDs.length>> + <<if App.Entity.facilities.clinic.hasFreeSpace>> rushing $him to $clinicName, <<set $activeSlave.assignment = "get treatment in the clinic">> <<else>> diff --git a/src/uncategorized/repBudget.tw b/src/uncategorized/repBudget.tw index ce03bf981b20c0ae38437923aa281ed3d04e36ae..6bfaba0cf7f9a7a77c8706061c282bb134a8b22e 100644 --- a/src/uncategorized/repBudget.tw +++ b/src/uncategorized/repBudget.tw @@ -75,13 +75,14 @@ for (var i = 0; i < State.variables.lastWeeksRepIncome.length; i++){ <h2>Structures</h2> /* TODO: using h2s doesn't fit in with the rest of the game */ </tr> - <<print budgetLine("arcade", "<<if $arcade>>[[$arcadeNameCaps|Arcade][$nextButton = \"Back to Budget\", $nextLink = \"Rep Budget\"]]<<else>>$arcadeNameCaps<</if>> ($ArcadeiIDs.length slaves)")>> + <<set _L = App.Utils.countFacilityWorkers(["arcade", "brothel", "club", "servantsQuarters", "spa"])>> + <<print budgetLine("arcade", "<<if $arcade>>[[$arcadeNameCaps|Arcade][$nextButton = \"Back to Budget\", $nextLink = \"Rep Budget\"]]<<else>>$arcadeNameCaps<</if>> (_L.arcade slaves)")>> <<print budgetLine("gloryholeArcade", "Free arcade")>> - <<print budgetLine("brothel", "<<if $brothel>>[[$brothelNameCaps|Brothel][$nextButton = \"Back to Budget\", $nextLink = \"Rep Budget\"]]<<else>>$brothelNameCaps<</if>> ($BrothiIDs.length slaves)")>> + <<print budgetLine("brothel", "<<if $brothel>>[[$brothelNameCaps|Brothel][$nextButton = \"Back to Budget\", $nextLink = \"Rep Budget\"]]<<else>>$brothelNameCaps<</if>> (_L.brothel slaves)")>> - <<print budgetLine("club", "<<if $club>>[[$clubNameCaps|Club][$nextButton = \"Back to Budget\", $nextLink = \"Rep Budget\"]]<<else>>$clubNameCaps<</if>> ($ClubiIDs.length slaves)")>> + <<print budgetLine("club", "<<if $club>>[[$clubNameCaps|Club][$nextButton = \"Back to Budget\", $nextLink = \"Rep Budget\"]]<<else>>$clubNameCaps<</if>> (_L.club slaves)")>> <<print budgetLine("publicServantClub", "Club servants")>> @@ -93,9 +94,9 @@ for (var i = 0; i < State.variables.lastWeeksRepIncome.length; i++){ <<print budgetLine("pit", "<<if $pit>>[[$pitNameCaps|Pit][$nextButton = \"Back to Budget\", $nextLink = \"Rep Budget\"]]<<else>>$pitNameCaps<</if>> ($fighterIDs.length slaves)")>> - <<print budgetLine("servantsQuarters", "<<if $servantsQuarters>>[[Servants' Quarters][$nextButton = \"Back to Budget\", $nextLink = \"Rep Budget\"]]<<else>>Servants' Quarters<</if>> ($ServQiIDs.length slaves)")>> + <<print budgetLine("servantsQuarters", "<<if $servantsQuarters>>[[Servants' Quarters][$nextButton = \"Back to Budget\", $nextLink = \"Rep Budget\"]]<<else>>Servants' Quarters<</if>> (_L.servantsQuarters slaves)")>> - <<print budgetLine("spa", "<<if $spa>>[[$spaNameCaps|Spa][$nextButton = \"Back to Budget\", $nextLink = \"Rep Budget\"]]<<else>>$spaNameCaps<</if>> ($SpaiIDs.length slaves)")>> + <<print budgetLine("spa", "<<if $spa>>[[$spaNameCaps|Spa][$nextButton = \"Back to Budget\", $nextLink = \"Rep Budget\"]]<<else>>$spaNameCaps<</if>> (_L.spa slaves)")>> <<print budgetLine("architecture", "[[Architecture|Manage Arcology][$nextButton = \"Back to Budget\", $nextLink = \"Rep Budget\"]]")>> diff --git a/src/uncategorized/saChoosesOwnJob.tw b/src/uncategorized/saChoosesOwnJob.tw index 595c2d6928e1132b61d29d3741d6d1cd048c64ed..1389233daddff5eb6ec8a2ae51bf2f4408cc2460 100644 --- a/src/uncategorized/saChoosesOwnJob.tw +++ b/src/uncategorized/saChoosesOwnJob.tw @@ -1,6 +1,6 @@ :: SA chooses own job [nobr] -<<set _clinicL = $CliniciIDs.length, _schoolL = $SchlRiIDs.length, _servQL = $ServQiIDs.length, _nurseryL = $NurseryiIDs.length, _brothelL = $BrothiIDs.length, _clubL = $ClubiIDs.length, _masterSL = $MastSiIDs.length, _spaL = $SpaiIDs.length, _dairyL = $DairyiIDs.length>> +<<set _clinicL = App.Entity.facilities.clinic.employeesIDs().size, _schoolL = App.Entity.facilities.schoolroom.employeesIDs().size, _servQL = App.Entity.facilities.servantsQuarters.employeesIDs().size, _nurseryL = App.Entity.facilities.nursery.employeesIDs().size, _brothelL = App.Entity.facilities.brothel.employeesIDs().size, _clubL = App.Entity.facilities.club.employeesIDs().size, _masterSL = App.Entity.facilities.masterSuite.employeesIDs().size, _spaL = App.Entity.facilities.spa.employeesIDs().size, _dairyL = App.Entity.facilities.dairy.employeesIDs().size>> <<setLocalPronouns $slaves[$i]>> diff --git a/src/uncategorized/saRecruitGirls.tw b/src/uncategorized/saRecruitGirls.tw index d5c32d07fd088896ec58e4b5cb3085f724e0874a..962b1d4776013671ccd0cbcaed2a07dc13345dd9 100644 --- a/src/uncategorized/saRecruitGirls.tw +++ b/src/uncategorized/saRecruitGirls.tw @@ -1,6 +1,10 @@ :: SA recruit girls [nobr] <<set _bellyAccessory = $slaves[$i].bellyAccessory>> +<<set _ClubL = App.Entity.facilities.club.employeesIDs().size>> +<<set _DairyL = App.Entity.facilities.dairy.employeesIDs().size>> +<<set _MastSL = App.Entity.facilities.masterSuite.employeesIDs().size>> + /* Note on target sum: HG and Recruiter are the initial 2 counted (no facility req'd), while HGSuite counts the HG's girl, other facilities count associated leader */ <<if $recruiterIdleRule == "number">> @@ -696,8 +700,8 @@ <</if>> <</if>> <<if $arcologies[0].FSPastoralist != "unset">> - <<if $dairy > 0 && ($slaves[$i].lactation > 0 || ($DairyiIDs.length > 0 && _FSIntMod > ($dairyRestraintsSetting+1)))>> - <<if $DairyiIDs.length > 0 && _FSIntMod > ($dairyRestraintsSetting+1)>> + <<if $dairy > 0 && ($slaves[$i].lactation > 0 || (_DairyL > 0 && _FSIntMod > ($dairyRestraintsSetting+1)))>> + <<if _DairyL > 0 && _FSIntMod > ($dairyRestraintsSetting+1)>> <<set _seed += 3, _FSdefend++>> <</if>> <<if $slaves[$i].lactation > 0>> @@ -747,7 +751,7 @@ <</if>> <</if>> <<elseif $arcologies[0].FSEdoRevivalist != "unset">> - <<if $clubDecoration != "standard" && $ClubiIDs.length > 1>> + <<if $clubDecoration != "standard" && _ClubL > 1>> <<if $clubAdsSpending > 0>> <<set _clubSeed = ($clubBonuses+Math.abs($clubAdsOld)+Math.abs($clubAdsStacked)+Math.abs($clubAdsImplanted)+Math.abs($clubAdsModded)+Math.abs($clubAdsXX))>> <<else>> @@ -758,7 +762,7 @@ <</if>> <</if>> <<elseif $arcologies[0].FSArabianRevivalist != "unset">> - <<if $masterSuiteDecoration == "Arabian Revivalist" && $masterSuiteUpgradeLuxury > 0 && $masterSuiteAverageEnergy > 60 && $MastSiIDs.length >= 3>> + <<if $masterSuiteDecoration == "Arabian Revivalist" && $masterSuiteUpgradeLuxury > 0 && $masterSuiteAverageEnergy > 60 && _MastSL >= 3>> <<set _seed += 6, _FSmatch++, $arcologies[0].FSArabianRevivalist += 0.02*$FSSingleSlaveRep>> <</if>> <<elseif $arcologies[0].FSChineseRevivalist != "unset">> @@ -1036,7 +1040,7 @@ <</if>> <<if $arcologies[0].FSPastoralist != "unset">> <<if $dairy>> - <<if $DairyiIDs.length && _FSIntMod > ($dairyRestraintsSetting+1)>> + <<if _DairyL && _FSIntMod > ($dairyRestraintsSetting+1)>> <<if $slaves[$i].lactation > 0>> $He schedules VR tours of $dairyName in order to popularize your free-range practices and quality products: the highlight each time is when $he hooks $his own teats into a milker and brings $himself to orgasm. <<else>> @@ -1137,7 +1141,7 @@ One of the most prominent features of your Egyptian Revival is an open, even expectant, attitude toward slave incest, but $he doesn't have any close family living in your household. <</if>> <<elseif $arcologies[0].FSEdoRevivalist != "unset">> - <<if $clubDecoration != "standard" && $ClubiIDs.length > 1>> + <<if $clubDecoration != "standard" && _ClubL > 1>> <<if _clubSeed >= 3>> The candid, POV-style videos of $slaves[$i].slaveName dancing, making out, and giving blowjobs alongside your regular sluts in $clubName's $clubDecoration atmosphere earn a lot of thumbs up. <<else>> @@ -1145,14 +1149,14 @@ <</if>> <<elseif $club == 0>> $He'd like to integrate $his personal profile with your cultural Revival, but there's no clear place in your arcology to focus $his attention. - <<elseif $ClubiIDs.length <= 1>> + <<elseif _ClubL <= 1>> $He travels down to $clubName for some POV video footage, but $he can't get enough reliable dance partners. <<else>> $He gets some hot POV-style footage when $he films in your nightclub, but there's nothing special about its atmosphere to distinguish it from any other bar in any other arcology. <</if>> <<elseif $arcologies[0].FSArabianRevivalist != "unset">> <<if $masterSuiteDecoration == "Arabian Revivalist" && $masterSuiteUpgradeLuxury > 0 && $masterSuiteAverageEnergy > 60>> - <<if $MastSiIDs.length >= 3>> + <<if _MastSL >= 3>> An exposé that "pulls back the curtain" on your elaborate master bedroom goes viral after several harem slaves drag $him into <<if $masterSuiteUpgradeLuxury == 1>>four-way action with their <<= properMaster()>><<else>>a fuckpit daisy chain<</if>> and another takes over the filming. <<else>> $He makes a short video essay about your elaborate master suite, but the empty space unfilled by luscious slave bodies fails to impress. diff --git a/src/uncategorized/saRules.tw b/src/uncategorized/saRules.tw index 340238bfefc89e8bd8a8c147801b5fdf2bffa830..69f0bc8c8e927cbb3027fdb93eaaa2eb8d719ed4 100644 --- a/src/uncategorized/saRules.tw +++ b/src/uncategorized/saRules.tw @@ -1,5 +1,6 @@ :: SA rules [nobr] +<<set _L = App.Utils.countFacilityWorkers()>> <<set _release = $slaves[$i].rules.release>> <<if $slaves[$i].fuckdoll == 0>> @@ -43,7 +44,7 @@ <</if>> <</if>> <<case "be the Madam">> - <<set $slaves[$i].need -= ($BrothiIDs.length*10)>> + <<set $slaves[$i].need -= (App.Entity.facilities.brothel.employeesIDs().size*10)>> <<if $slaves[$i].energy <= 20>> is frigid and has little interest in getting off<<if App.Utils.releaseRestricted($slaves[$i])>>, making the rule restricting $his sexual outlets superfluous<</if>>. <<set $slaves[$i].need = 0>> @@ -117,7 +118,7 @@ <<if ($universalRulesConsent == 0)>> <<if (_release.slaves === 1)>> <<if ($slaves[$i].energy > 95)>> - <<if $BrothiIDs.length > 2>> + <<if App.Entity.facilities.brothel.employeesIDs().size > 2>> Under the rules, $he's allowed to demand that other slaves get $him off, and $he @@.hotpink;adores@@ you for leaving plentiful outlets for $his nymphomania under $his care. <<else>> Under the rules, $he's allowed to demand that other slaves get $him off, and $he @@.hotpink;eagerly awaits@@ the day you assign more whores to $brothelName. @@ -125,14 +126,14 @@ <<set $slaves[$i].devotion += 1>> <<elseif ($slaves[$i].fetishKnown == 1) && ($slaves[$i].fetishStrength > 60)>> <<if ($slaves[$i].fetish == "sadist")>> - <<if $BrothiIDs.length > 2>> + <<if App.Entity.facilities.brothel.employeesIDs().size > 2>> Under the rules, $he's allowed to sexually abuse other slaves, and $he @@.hotpink;adores@@ you for providing a whole brothel of whores for $him to rape. <<else>> Under the rules, $he's allowed to sexually abuse other slaves, and $he @@.hotpink;eagerly awaits@@ the day you assign more whores to $brothelName for $him to rape. <</if>> <<set $slaves[$i].devotion += 1>> <<elseif ($slaves[$i].fetish == "dom")>> - <<if $BrothiIDs.length > 2>> + <<if App.Entity.facilities.brothel.employeesIDs().size > 2>> Under the rules, $he's allowed to force other slaves to have sex with $him, and $he @@.hotpink;adores@@ you for allowing $him a brothel of whores to dominate. <<else>> Under the rules, $he's allowed to force other slaves to have sex with $him, and $he @@.hotpink;eagerly awaits@@ the day you assign more whores to $his domain. @@ -180,7 +181,7 @@ <<if $spa != 0>> usually spends in $spaName<<if _S.Attendant>>, enjoying _S.Attendant.slaveName's care<</if>>. <<else>> - usually spends relaxing in $his room<<if $BrothiIDs.length > 1>> with a whore <<if hasBothLegs($slaves[$i])>>between $his legs<<else>>at $his crotch<</if>><</if>>. + usually spends relaxing in $his room<<if App.Entity.facilities.brothel.employeesIDs().size > 1>> with a whore <<if hasBothLegs($slaves[$i])>>between $his legs<<else>>at $his crotch<</if>><</if>>. <</if>> <<if $slaves[$i].relationship > 0>> <<set $subSlave = getSlave($slaves[$i].relationshipTarget)>> @@ -477,14 +478,14 @@ <<if ($universalRulesConsent == 0)>> <<if ($slaves[$i].devotion <= 20)>> <<if ($slaves[$i].trust > -10)>> - <<if $BrothiIDs.length > 2 || $Madam != 0>> + <<if App.Entity.facilities.brothel.employeesIDs().size > 2 || $Madam != 0>> Under the rules, $he finds $himself constantly molested by other slaves, and lives $his life constantly @@.gold;afraid.@@ <<else>> Under the rules, $he is free game for other slaves to molest, and lives $his life constantly @@.gold;afraid@@ of the day you assign more whores to $brothelName. <</if>> <<set $slaves[$i].trust -= 2>> <<else>> - <<if $BrothiIDs.length > 2 || $Madam != 0>> + <<if App.Entity.facilities.brothel.employeesIDs().size > 2 || $Madam != 0>> Under the rules, $he finds $himself constantly molested by other slaves, but $he's already in such constant terror it doesn't seriously affect $him. <<else>> Under the rules, $he will someday find $himself constantly molested by other slaves, but $he's already in such constant terror it that it doesn't cross $his mind. @@ -492,7 +493,7 @@ <</if>> <<elseif (_release.slaves === 1)>> <<if ($slaves[$i].energy > 95)>> - <<if $BrothiIDs.length > 2>> + <<if App.Entity.facilities.brothel.employeesIDs().size > 2>> Under the rules, $he's allowed to demand that other slaves get $him off, and $he @@.hotpink;adores@@ you for providing plentiful outlets for $his nymphomania. <<else>> Under the rules, $he's allowed to demand that other slaves get $him off, and $he @@.hotpink;eagerly awaits@@ the day you assign more whores to $brothelName to get $him off. @@ -500,14 +501,14 @@ <<set $slaves[$i].devotion += 1>> <<elseif ($slaves[$i].fetishKnown == 1) && ($slaves[$i].fetishStrength > 60)>> <<if ($slaves[$i].fetish == "sadist")>> - <<if $BrothiIDs.length > 2>> + <<if App.Entity.facilities.brothel.employeesIDs().size > 2>> Under the rules, $he's allowed to sexually abuse other slaves, and $he @@.hotpink;adores@@ you for providing a whole brothel of whores for $him to rape. <<else>> Under the rules, $he's allowed to sexually abuse other slaves, and $he @@.hotpink;eagerly awaits@@ the day you assign more whores to $brothelName for $him to rape. <</if>> <<set $slaves[$i].devotion += 1>> <<elseif ($slaves[$i].fetish == "dom")>> - <<if $BrothiIDs.length > 2>> + <<if App.Entity.facilities.brothel.employeesIDs().size > 2>> Under the rules, $he's allowed to force other slaves to have sex with $him, and $he @@.hotpink;adores@@ you for providing a whole brothel of whores for $him to dominate. <<else>> Under the rules, $he's allowed to force other slaves to have sex with $him, and $he @@.hotpink;eagerly awaits@@ the day you assign more whores to $brothelName for $him to dominate. @@ -518,7 +519,7 @@ <</if>> <<else>> <<if ($slaves[$i].devotion <= 20) && ($slaves[$i].devotion >= -20)>> - <<if $BrothiIDs.length > 2 || $Madam != 0>> + <<if App.Entity.facilities.brothel.employeesIDs().size > 2 || $Madam != 0>> Since $he's low in the slave hierarchy, @@.mediumaquamarine;$he knows@@ that the rule that slaves must get consent before having sex with $him are all that protect $him from abuse. <<else>> Since $he's low in the slave hierarchy, @@.mediumaquamarine;$he knows@@ that the rule that slaves must get consent before having sex with $him are all that protect $him from abuse. Well, that and the fact $brothelName is rather empty. @@ -708,7 +709,7 @@ <<if ($universalRulesConsent == 0)>> <<if (_release.slaves === 1)>> <<if ($slaves[$i].energy > 95)>> - <<if $ClubiIDs.length > 2>> + <<if App.Entity.facilities.club.employeesIDs().size > 2>> Under the rules, $he's allowed to demand that other slaves get $him off, and $he @@.hotpink;adores@@ you for leaving plentiful, tantalizing, outlets for $his nymphomania under $his care. <<else>> Under the rules, $he's allowed to demand that other slaves get $him off, and $he @@.hotpink;eagerly awaits@@ the day you assign more sluts to $clubName. @@ -716,14 +717,14 @@ <<set $slaves[$i].devotion += 1>> <<elseif ($slaves[$i].fetishKnown == 1) && ($slaves[$i].fetishStrength > 60)>> <<if ($slaves[$i].fetish == "sadist")>> - <<if $ClubiIDs.length > 2>> + <<if App.Entity.facilities.club.employeesIDs().size > 2>> Under the rules, $he's allowed to sexually abuse other slaves, and $he @@.hotpink;adores@@ you for providing a whole club of sluts for $him to rape. <<else>> Under the rules, $he's allowed to sexually abuse other slaves, and $he @@.hotpink;eagerly awaits@@ the day you assign more sluts to $clubName for $him to rape. <</if>> <<set $slaves[$i].devotion += 1>> <<elseif ($slaves[$i].fetish == "dom")>> - <<if $ClubiIDs.length > 2>> + <<if App.Entity.facilities.club.employeesIDs().size > 2>> Under the rules, $he's allowed to force other slaves to have sex with $him, and $he @@.hotpink;adores@@ you for allowing $him a club of sluts to dominate. <<else>> Under the rules, $he's allowed to force other slaves to have sex with $him, and $he @@.hotpink;eagerly awaits@@the day you assign more sluts to $his domain. @@ -977,7 +978,7 @@ <</if>> <<if ($slaves[$i].devotion <= 20)>> - $He shares a room with <<if $ClubiIDs.length > 4>>some of <</if>>the other sluts, preventing $him from becoming too complacent. It doesn't help that during business hours $he has to take citizens in $his own bed. + $He shares a room with <<if App.Entity.facilities.club.employeesIDs().size > 4>>some of <</if>>the other sluts, preventing $him from becoming too complacent. It doesn't help that during business hours $he has to take citizens in $his own bed. <<else>> $He likes $his personal space in $clubName, even if <<if canSmell($slaves[$i])>>it smells of<<else>>it's filled with the heat from<</if>> sex and citizens. <</if>> @@ -1036,14 +1037,14 @@ <<if ($universalRulesConsent == 0)>> <<if ($slaves[$i].devotion <= 20)>> <<if ($slaves[$i].trust > -10)>> - <<if $ClubiIDs.length > 2 || $DJ != 0>> + <<if App.Entity.facilities.club.employeesIDs().size > 2 || $DJ != 0>> Under the rules, $he finds $himself constantly molested by other slaves, and lives $his life constantly @@.gold;afraid.@@ <<else>> Under the rules, $he is free game for other slaves to molest, and lives $his life constantly @@.gold;afraid@@ of the day you assign more sluts to $clubName. <</if>> <<set $slaves[$i].trust -= 2>> <<else>> - <<if $ClubiIDs.length > 2 || $DJ != 0>> + <<if App.Entity.facilities.club.employeesIDs().size > 2 || $DJ != 0>> Under the rules, $he finds $himself constantly molested by other slaves, but $he's already in such constant terror it doesn't seriously affect $him. <<else>> Under the rules, $he will someday find $himself constantly molested by other slaves, but $he's already in such constant terror it that it doesn't cross $his mind. @@ -1051,7 +1052,7 @@ <</if>> <<elseif (_release.slaves === 1)>> <<if ($slaves[$i].energy > 95)>> - <<if $ClubiIDs.length > 2>> + <<if App.Entity.facilities.club.employeesIDs().size > 2>> Under the rules, $he's allowed to demand that other slaves get $him off, and $he @@.hotpink;adores@@ you for providing plentiful outlets for $his nymphomania. <<else>> Under the rules, $he's allowed to demand that other slaves get $him off, and $he @@.hotpink;eagerly awaits@@ the day you assign more sluts to $clubName to get $him off. @@ -1059,14 +1060,14 @@ <<set $slaves[$i].devotion += 1>> <<elseif ($slaves[$i].fetishKnown == 1) && ($slaves[$i].fetishStrength > 60)>> <<if ($slaves[$i].fetish == "sadist")>> - <<if $ClubiIDs.length > 2>> + <<if App.Entity.facilities.club.employeesIDs().size > 2>> Under the rules, $he's allowed to sexually abuse other slaves, and $he @@.hotpink;adores@@ you for providing a whole club of sluts for $him to rape. <<else>> Under the rules, $he's allowed to sexually abuse other slaves, and $he @@.hotpink;eagerly awaits@@ the day you assign more sluts to $clubName for $him to rape. <</if>> <<set $slaves[$i].devotion += 1>> <<elseif ($slaves[$i].fetish == "dom")>> - <<if $ClubiIDs.length > 2>> + <<if App.Entity.facilities.club.employeesIDs().size > 2>> Under the rules, $he's allowed to force other slaves to have sex with $him, and $he @@.hotpink;adores@@ you for providing a whole club of sluts for $him to dominate. <<else>> Under the rules, $he's allowed to force other slaves to have sex with $him, and $he @@.hotpink;eagerly awaits@@ the day you assign more sluts to $clubName for $him to dominate. @@ -1077,7 +1078,7 @@ <</if>> <<else>> <<if ($slaves[$i].devotion <= 20) && ($slaves[$i].devotion >= -20)>> - <<if $ClubiIDs.length > 2 || $DJ != 0>> + <<if App.Entity.facilities.club.employeesIDs().size > 2 || $DJ != 0>> Since $he's low in the slave hierarchy, @@.mediumaquamarine;$he knows@@ that the rule that slaves must get consent before having sex with $him are all that protect $him from abuse. <<else>> Since $he's low in the slave hierarchy, @@.mediumaquamarine;$he knows@@ that the rule that slaves must get consent before having sex with $him are all that protect $him from abuse. Well, that and the fact $clubName is rather empty. @@ -1194,7 +1195,7 @@ <</switch>> <</if>> <<case "be the Nurse">> - <<set $slaves[$i].need -= ($CliniciIDs.length*3)>> + <<set $slaves[$i].need -= (App.Entity.facilities.clinic.employeesIDs().size*3)>> <<if $slaves[$i].energy <= 20>> is frigid and has little interest in getting off<<if App.Utils.releaseRestricted($slaves[$i])>>, making the rule restricting $his sexual outlets superfluous<</if>>. <<set $slaves[$i].need = 0>> @@ -1639,7 +1640,7 @@ <</switch>> <</if>> <<case "be the Wardeness">> - <<set $slaves[$i].need -= ($CellBiIDs.length*5)>> + <<set $slaves[$i].need -= (_L.cellblock*5)>> <<if $slaves[$i].energy <= 20>> is frigid and has little interest in getting off<<if App.Utils.releaseRestricted($slaves[$i])>>, making the rule restricting $his sexual outlets superfluous<</if>>. <<set $slaves[$i].need = 0>> @@ -1737,7 +1738,7 @@ <<if $spa != 0>> usually spends in $spaName<<if _S.Attendant>>, enjoying _S.Attendant.slaveName's care<</if>>. <<else>> - usually spends relaxing in $his room<<if $CellBiIDs.length > 1>> teaching a disobedient slave how to properly use their mouth<</if>>. + usually spends relaxing in $his room<<if _L.cellblock > 1>> teaching a disobedient slave how to properly use their mouth<</if>>. <</if>> <<if $slaves[$i].relationship > 0>> <<set $subSlave = getSlave($slaves[$i].relationshipTarget)>> @@ -1924,7 +1925,7 @@ <</switch>> <</if>> <<case "be the Attendant">> - <<set $slaves[$i].need -= ($SpaiIDs.length*3)>> + <<set $slaves[$i].need -= (App.Entity.facilities.spa.employeesIDs().size*3)>> <<if $slaves[$i].energy <= 20>> is frigid and has little interest in getting off<<if App.Utils.releaseRestricted($slaves[$i])>>, making the rule restricting $his sexual outlets superfluous<</if>>. <<set $slaves[$i].need = 0>> @@ -1998,7 +1999,7 @@ <<if ($universalRulesConsent == 0)>> <<if (_release.slaves === 1)>> <<if ($slaves[$i].energy > 95)>> - <<if $SpaiIDs.length > 2>> + <<if App.Entity.facilities.spa.employeesIDs().size > 2>> Under the rules, $he's allowed to demand that other slaves get $him off, and $he @@.hotpink;adores@@ you for all the warm, moist bodies lounging around $spaName. <<else>> Under the rules, $he's allowed to demand that other slaves get $him off, and $he @@.hotpink;eagerly awaits@@ the day more vulnerable slaves enter $spaName. @@ -2006,14 +2007,14 @@ <<set $slaves[$i].devotion += 1>> <<elseif ($slaves[$i].fetishKnown == 1) && ($slaves[$i].fetishStrength > 60)>> <<if ($slaves[$i].fetish == "sadist")>> - <<if $SpaiIDs.length > 2>> + <<if App.Entity.facilities.spa.employeesIDs().size > 2>> Under the rules, $he's allowed to sexually abuse other slaves, and $he @@.hotpink;adores@@ you for providing all the warm, moist bodies lounging around $spaName. <<else>> Under the rules, $he's allowed to sexually abuse other slaves, and $he @@.hotpink;eagerly awaits@@ the day more vulnerable slaves come to $spaName for $him to rape. <</if>> <<set $slaves[$i].devotion += 1>> <<elseif ($slaves[$i].fetish == "dom")>> - <<if $SpaiIDs.length > 2>> + <<if App.Entity.facilities.spa.employeesIDs().size > 2>> Under the rules, $he's allowed to force other slaves to have sex with $him, and $he @@.hotpink;adores@@ you for allotting $him all the warm, moist bodies lounging around $spaName. <<else>> Under the rules, $he's allowed to force other slaves to have sex with $him, and $he @@.hotpink;eagerly awaits@@ the day more vulnerable slaves enter $his domain. @@ -2311,14 +2312,14 @@ <<if ($universalRulesConsent == 0)>> <<if ($slaves[$i].devotion <= 20)>> <<if ($slaves[$i].trust > -10)>> - <<if $SpaiIDs.length > 2>> + <<if App.Entity.facilities.spa.employeesIDs().size > 2>> Under the rules, $he finds $himself constantly molested by other slaves, and lives $his life constantly @@.gold;afraid.@@ <<else>> Under the rules, $he is free game for other slaves to molest, and lives $his life constantly @@.gold;afraid@@ of the day another slave grabs $him from under the water. <</if>> <<set $slaves[$i].trust -= 2>> <<else>> - <<if $SpaiIDs.length > 2>> + <<if App.Entity.facilities.spa.employeesIDs().size > 2>> Under the rules, $he finds $himself constantly molested by other slaves, but $he's already in such constant terror it doesn't seriously affect $him. <<else>> Under the rules, $he will someday find $himself constantly molested by other slaves, but $he's already in such constant terror it that it doesn't cross $his mind. @@ -2326,7 +2327,7 @@ <</if>> <<elseif (_release.slaves === 1)>> <<if ($slaves[$i].energy > 95)>> - <<if $SpaiIDs.length > 2>> + <<if App.Entity.facilities.spa.employeesIDs().size > 2>> Under the rules, $he's allowed to demand that other slaves get $him off, and $he @@.hotpink;adores@@ you for providing plentiful outlets for $his nymphomania. <<else>> Under the rules, $he's allowed to demand that other slaves get $him off, and $he @@.hotpink;eagerly awaits@@ the day <<if _S.Attendant>>more of your slaves join $him in the pool<<else>>you assign more slaves to $spaName to help $him relieve $his <<if $slaves[$i].balls > 0>>swollen balls<<else>>tension<</if>><</if>>. @@ -2334,14 +2335,14 @@ <<set $slaves[$i].devotion += 1>> <<elseif ($slaves[$i].fetishKnown == 1) && ($slaves[$i].fetishStrength > 60)>> <<if ($slaves[$i].fetish == "sadist")>> - <<if $SpaiIDs.length > 2>> + <<if App.Entity.facilities.spa.employeesIDs().size > 2>> Under the rules, $he's allowed to sexually abuse other slaves, and $he @@.hotpink;adores@@ you for providing a whole pool of slaves for $him to rape. <<else>> Under the rules, $he's allowed to sexually abuse other slaves, and $he @@.hotpink;eagerly awaits@@ the day <<if _S.Attendant>>more of your slaves join $him in the pool<<else>>you assign more slaves to $spaName to help $him unwind<</if>>. <</if>> <<set $slaves[$i].devotion += 1>> <<elseif ($slaves[$i].fetish == "dom")>> - <<if $SpaiIDs.length > 2>> + <<if App.Entity.facilities.spa.employeesIDs().size > 2>> Under the rules, $he's allowed to force other slaves to have sex with $him, and $he @@.hotpink;adores@@ you for providing a whole pool of slaves for $him to dominate. <<else>> Under the rules, $he's allowed to force other slaves to have sex with $him, and $he @@.hotpink;eagerly awaits@@ the day <<if _S.Attendant>>more of your slaves join $him in the pool<<else>>you assign more slaves to $spaName to help $him unwind<</if>>. @@ -2352,7 +2353,7 @@ <</if>> <<else>> <<if ($slaves[$i].devotion <= 20) && ($slaves[$i].devotion >= -20)>> - <<if $SpaiIDs.length > 2>> + <<if App.Entity.facilities.spa.employeesIDs().size > 2>> Since $he's low in the slave hierarchy, @@.mediumaquamarine;$he knows@@ that the rule that slaves must get consent before having sex with $him are all that protect $him from abuse. <<else>> Since $he's low in the slave hierarchy, @@.mediumaquamarine;$he knows@@ that the rule that slaves must get consent before having sex with $him are all that protect $him from abuse. Well, that and the fact $spaName is <<if _S.Attendant>>mostly frequented by other slaveowners' stock<<else>>$his little private sanctuary<</if>>. @@ -2464,7 +2465,7 @@ <</switch>> <</if>> <<case "be the Matron">> - <<set $slaves[$i].need -= ($NurseryiIDs.length*3)>> + <<set $slaves[$i].need -= (_L.nursery*3)>> <<if $slaves[$i].energy <= 20>> is frigid and has little interest in getting off<<if App.Utils.releaseRestricted($slaves[$i])>>, making the rule restricting $his sexual outlets superfluous<</if>>. <<set $slaves[$i].need = 0>> @@ -2535,7 +2536,7 @@ <<if ($universalRulesConsent == 0)>> <<if (_release.slaves === 1)>> <<if ($slaves[$i].energy > 95)>> - <<if $NurseryiIDs.length > 2>> + <<if _L.nursery > 2>> Under the rules, $he's allowed to demand that other slaves get $him off, and $he @@.hotpink;adores@@ you for all the nannies busily scurrying around $nurseryName. <<else>> Under the rules, $he's allowed to demand that other slaves get $him off, and $he @@.hotpink;eagerly awaits@@ the day more vulnerable slaves enter $nurseryName. @@ -2543,14 +2544,14 @@ <<set $slaves[$i].devotion += 1>> <<elseif ($slaves[$i].fetishKnown == 1) && ($slaves[$i].fetishStrength > 60)>> <<if ($slaves[$i].fetish == "sadist")>> - <<if $NurseryiIDs.length > 2>> + <<if _L.nursery > 2>> Under the rules, $he's allowed to sexually abuse other slaves, and $he @@.hotpink;adores@@ you for providing all the nannies busily scurrying around $nurseryName. <<else>> Under the rules, $he's allowed to sexually abuse other slaves, and $he @@.hotpink;eagerly awaits@@ the day more vulnerable slaves come to $nurseryName for $him to rape. <</if>> <<set $slaves[$i].devotion += 1>> <<elseif ($slaves[$i].fetish == "dom")>> - <<if $NurseryiIDs.length > 2>> + <<if _L.nursery > 2>> Under the rules, $he's allowed to force other slaves to have sex with $him, and $he @@.hotpink;adores@@ you for allotting $him all the nannies busily scurrying around $nurseryName. <<else>> Under the rules, $he's allowed to force other slaves to have sex with $him, and $he @@.hotpink;eagerly awaits@@ the day more vulnerable slaves enter $his domain. @@ -2848,14 +2849,14 @@ <<if ($universalRulesConsent == 0)>> <<if ($slaves[$i].devotion <= 20)>> <<if ($slaves[$i].trust > -10)>> - <<if $NurseryiIDs.length > 2>> + <<if _L.nursery > 2>> Under the rules, $he finds $himself constantly molested by other slaves, and lives $his life constantly @@.gold;afraid.@@ <<else>> Under the rules, $he is free game for other slaves to molest, and lives $his life constantly @@.gold;afraid@@ of the day another slave grabs $him from under the water. <</if>> <<set $slaves[$i].trust -= 2>> <<else>> - <<if $NurseryiIDs.length > 2>> + <<if _L.nursery > 2>> Under the rules, $he finds $himself constantly molested by other slaves, but $he's already in such constant terror it doesn't seriously affect $him. <<else>> Under the rules, $he will someday find $himself constantly molested by other slaves, but $he's already in such constant terror it that it doesn't cross $his mind. @@ -2863,7 +2864,7 @@ <</if>> <<elseif (_release.slaves === 1)>> <<if ($slaves[$i].energy > 95)>> - <<if $NurseryiIDs.length > 2>> + <<if _L.nursery > 2>> Under the rules, $he's allowed to demand that other slaves get $him off, and $he @@.hotpink;adores@@ you for providing plentiful outlets for $his nymphomania. <<else>> Under the rules, $he's allowed to demand that other slaves get $him off, and $he @@.hotpink;eagerly awaits@@ the day <<if $Matron != 0>>more of your slaves join $him in $nurseryName <<else>>you assign more nurses to $nurseryName to help $him relieve $his <<if $slaves[$i].balls > 0>>swollen balls<<else>>tension<</if>><</if>>. @@ -2871,14 +2872,14 @@ <<set $slaves[$i].devotion += 1>> <<elseif ($slaves[$i].fetishKnown == 1) && ($slaves[$i].fetishStrength > 60)>> <<if ($slaves[$i].fetish == "sadist")>> - <<if $NurseryiIDs.length > 2>> + <<if _L.nursery > 2>> Under the rules, $he's allowed to sexually abuse other slaves, and $he @@.hotpink;adores@@ you for providing a whole nursery of slaves for $him to rape. <<else>> Under the rules, $he's allowed to sexually abuse other slaves, and $he @@.hotpink;eagerly awaits@@ the day <<if $Matron != 0>>more of your slaves join $him in $nurseryName <<else>>you assign more nurses to $nurseryName to help $him unwind<</if>>. <</if>> <<set $slaves[$i].devotion += 1>> <<elseif ($slaves[$i].fetish == "dom")>> - <<if $NurseryiIDs.length > 2>> + <<if _L.nursery > 2>> Under the rules, $he's allowed to force other slaves to have sex with $him, and $he @@.hotpink;adores@@ you for providing a whole nursery of slaves for $him to dominate. <<else>> Under the rules, $he's allowed to force other slaves to have sex with $him, and $he @@.hotpink;eagerly awaits@@ the day <<if $Matron != 0>>more of your slaves join $him in $nurseryName <<else>>you assign more nurses to $nurseryName to help $him unwind<</if>>. @@ -2889,7 +2890,7 @@ <</if>> <<else>> <<if ($slaves[$i].devotion <= 20) && ($slaves[$i].devotion >= -20)>> - <<if $NurseryiIDs.length > 2>> + <<if _L.nursery > 2>> Since $he's low in the slave hierarchy, @@.mediumaquamarine;$he knows@@ that the rule that slaves must get consent before having sex with $him are all that protect $him from abuse. <<else>> Since $he's low in the slave hierarchy, @@.mediumaquamarine;$he knows@@ that the rule that slaves must get consent before having sex with $him are all that protect $him from abuse. Well, that and the fact $nurseryName is <<if $Matron != 0>>mostly frequented by other slaveowners' stock<<else>>$his little private sanctuary<</if>>. @@ -3006,8 +3007,8 @@ <</switch>> <</if>> <<case "be the Schoolteacher">> - <<set $slaves[$i].need -= $SchlRiIDs.length*10>> - <<set _sexLessons = $SchlRiIDs.length*2>> + <<set $slaves[$i].need -= _L.schoolroom*10>> + <<set _sexLessons = _L.schoolroom*2>> <<if canDoVaginal($slaves[$i]) && $slaves[$i].vagina != 0>> <<set $slaves[$i].counter.vaginal += _sexLessons, $vaginalTotal += _sexLessons>> <</if>> @@ -3089,7 +3090,7 @@ <<if ($universalRulesConsent == 0)>> <<if (_release.slaves === 1)>> <<if ($slaves[$i].energy > 95)>> - <<if $SchlRiIDs.length > 2>> + <<if _L.schoolroom > 2>> Under the rules, $he's allowed to demand that other slaves get $him off, and $he @@.hotpink;adores@@ you for giving $him plentiful teacher's assistants for $his nymphomania. <<else>> Under the rules, $he's allowed to demand that other slaves get $him off, and $he @@.hotpink;eagerly awaits@@ the day more of your slaves enroll in $schoolroomName. @@ -3097,14 +3098,14 @@ <<set $slaves[$i].devotion += 1>> <<elseif ($slaves[$i].fetishKnown == 1) && ($slaves[$i].fetishStrength > 60)>> <<if ($slaves[$i].fetish == "sadist")>> - <<if $SchlRiIDs.length > 2>> + <<if _L.schoolroom > 2>> Under the rules, $he's allowed to sexually abuse other slaves, and $he @@.hotpink;adores@@ you for providing a whole class of students for $him to rape lessons into. <<else>> Under the rules, $he's allowed to sexually abuse other slaves, and $he @@.hotpink;eagerly awaits@@ the day more of your slaves enroll in $schoolroomName. <</if>> <<set $slaves[$i].devotion += 1>> <<elseif ($slaves[$i].fetish == "dom")>> - <<if $SchlRiIDs.length > 2>> + <<if _L.schoolroom > 2>> Under the rules, $he's allowed to force other slaves to have sex with $him, and $he @@.hotpink;adores@@ you for providing a whole class of students to demonstrate proper submission with. <<else>> Under the rules, $he's allowed to force other slaves to have sex with $him, and $he @@.hotpink;eagerly awaits@@ the day more of your slaves enroll in $schoolroomName. @@ -3152,7 +3153,7 @@ <<if $spa != 0>> usually spends in $spaName<<if $AttendantID != 0>>, enjoying _S.Attendant.slaveName's care<</if>>. <<else>> - usually spends relaxing in $his room<<if $SchlRiIDs.length > 1>> giving private lessons to a student<</if>>. + usually spends relaxing in $his room<<if _L.schoolroom > 1>> giving private lessons to a student<</if>>. <</if>> <<if $slaves[$i].relationship > 0>> <<set $subSlave = getSlave($slaves[$i].relationshipTarget)>> @@ -3389,14 +3390,14 @@ <<if ($universalRulesConsent == 0)>> <<if ($slaves[$i].devotion <= 20)>> <<if ($slaves[$i].trust > -10)>> - <<if $SchlRiIDs.length > 2 || $Schoolteacher != 0>> + <<if _L.schoolroom > 2 || $Schoolteacher != 0>> Under the rules, $he finds $himself constantly molested by other slaves, and lives $his life constantly @@.gold;afraid.@@ <<else>> Under the rules, $he is free game for other slaves to molest, and lives $his life constantly @@.gold;afraid@@ of the day more students enroll in $schoolroomName. <</if>> <<set $slaves[$i].trust -= 2>> <<else>> - <<if $SchlRiIDs.length > 2 || $Schoolteacher != 0>> + <<if _L.schoolroom > 2 || $Schoolteacher != 0>> Under the rules, $he finds $himself constantly molested by other slaves, but $he's already in such constant terror it doesn't seriously affect $him. <<else>> Under the rules, $he will someday find $himself constantly molested by other slaves, but $he's already in such constant terror it that it doesn't cross $his mind. @@ -3404,7 +3405,7 @@ <</if>> <<elseif (_release.slaves === 1)>> <<if ($slaves[$i].energy > 95)>> - <<if $SchlRiIDs.length > 2>> + <<if _L.schoolroom > 2>> Under the rules, $he's allowed to demand that other slaves get $him off, and $he @@.hotpink;adores@@ you for providing plentiful outlets for $his nymphomania. <<else>> Under the rules, $he's allowed to demand that other slaves get $him off, and $he @@.hotpink;eagerly awaits@@ the day more students enroll in $schoolroomName to get $him off. @@ -3412,14 +3413,14 @@ <<set $slaves[$i].devotion += 1>> <<elseif ($slaves[$i].fetishKnown == 1) && ($slaves[$i].fetishStrength > 60)>> <<if ($slaves[$i].fetish == "sadist")>> - <<if $SchlRiIDs.length > 2>> + <<if _L.schoolroom > 2>> Under the rules, $he's allowed to sexually abuse other slaves, and $he @@.hotpink;adores@@ you for providing a whole class of students for $him to rape. <<else>> Under the rules, $he's allowed to sexually abuse other slaves, and $he @@.hotpink;eagerly awaits@@ the day more students enroll in $schoolroomName for $him to rape. <</if>> <<set $slaves[$i].devotion += 1>> <<elseif ($slaves[$i].fetish == "dom")>> - <<if $SchlRiIDs.length > 2>> + <<if _L.schoolroom > 2>> Under the rules, $he's allowed to force other slaves to have sex with $him, and $he @@.hotpink;adores@@ you for providing a whole class of students for $him to dominate. <<else>> Under the rules, $he's allowed to force other slaves to have sex with $him, and $he @@.hotpink;eagerly awaits@@ the day more students enroll in $schoolroomName for $him to dominate. @@ -3430,7 +3431,7 @@ <</if>> <<else>> <<if ($slaves[$i].devotion <= 20) && ($slaves[$i].devotion >= -20)>> - <<if $SchlRiIDs.length > 2 || $Schoolteacher != 0>> + <<if _L.schoolroom > 2 || $Schoolteacher != 0>> Since $he's low in the slave hierarchy, @@.mediumaquamarine;$he knows@@ that the rule that slaves must get consent before having sex with $him are all that protect $him from abuse. <<else>> Since $he's low in the slave hierarchy, @@.mediumaquamarine;$he knows@@ that the rule that slaves must get consent before having sex with $him are all that protect $him from abuse. Well, that and the fact $schoolroomName is rather empty. @@ -3547,7 +3548,7 @@ <</switch>> <</if>> <<case "be the Stewardess">> - <<set $slaves[$i].need -= $ServQiIDs.length*10>> + <<set $slaves[$i].need -= _L.servantsQuarters*10>> <<if $slaves[$i].energy <= 20>> is frigid and has little interest in getting off<<if App.Utils.releaseRestricted($slaves[$i])>>, making the rule restricting $his sexual outlets superfluous<</if>>. <<set $slaves[$i].need = 0>> @@ -3620,7 +3621,7 @@ <<if ($universalRulesConsent == 0)>> <<if (_release.slaves === 1)>> <<if ($slaves[$i].energy > 95)>> - <<if $ServQiIDs.length > 2>> + <<if _L.servantsQuarters > 2>> Under the rules, $he's allowed to demand that other slaves get $him off, and $he @@.hotpink;adores@@ you for leaving plentiful outlets for $his nymphomania under $his charge. <<else>> Under the rules, $he's allowed to demand that other slaves get $him off, and $he @@.hotpink;eagerly awaits@@ the day you assign more maids to $servantsQuartersName. @@ -3628,14 +3629,14 @@ <<set $slaves[$i].devotion += 1>> <<elseif ($slaves[$i].fetishKnown == 1) && ($slaves[$i].fetishStrength > 60)>> <<if ($slaves[$i].fetish == "sadist")>> - <<if $ServQiIDs.length > 2>> + <<if _L.servantsQuarters > 2>> Under the rules, $he's allowed to sexually abuse other slaves, and $he @@.hotpink;adores@@ you for providing so many maids for $him to rape. <<else>> Under the rules, $he's allowed to sexually abuse other slaves, and $he @@.hotpink;eagerly awaits@@ the day you assign more maids to $servantsQuartersName for $him to rape. <</if>> <<set $slaves[$i].devotion += 1>> <<elseif ($slaves[$i].fetish == "dom")>> - <<if $ServQiIDs.length > 2>> + <<if _L.servantsQuarters > 2>> Under the rules, $he's allowed to force other slaves to have sex with $him, and $he @@.hotpink;adores@@ you for allowing $him so many maids to dominate. <<else>> Under the rules, $he's allowed to force other slaves to have sex with $him, and $he @@.hotpink;eagerly awaits@@ the day you assign more maids to $his domain. @@ -3683,7 +3684,7 @@ <<if $spa != 0>> usually spends in $spaName<<if _S.Attendant>>, enjoying _S.Attendant.slaveName's care<</if>>. <<else>> - usually spends relaxing in $his room<<if $ServQiIDs.length > 1>> while enjoying some service from $his underlings<</if>>. + usually spends relaxing in $his room<<if _L.servantsQuarters > 1>> while enjoying some service from $his underlings<</if>>. <</if>> <<if $slaves[$i].relationship > 0>> <<set $subSlave = getSlave($slaves[$i].relationshipTarget)>> @@ -4141,7 +4142,7 @@ <</switch>> <</if>> <<case "be the Milkmaid">> - <<set $slaves[$i].need -= $DairyiIDs.length*5>> + <<set $slaves[$i].need -= _L.dairy*5>> <<if $slaves[$i].energy <= 20>> is frigid and has little interest in getting off<<if App.Utils.releaseRestricted($slaves[$i])>>, making the rule restricting $his sexual outlets superfluous<</if>>. <<set $slaves[$i].need = 0>> @@ -4213,7 +4214,7 @@ <<if ($universalRulesConsent == 0)>> <<if (_release.slaves === 1)>> <<if ($slaves[$i].energy > 95)>> - <<if $DairyiIDs.length > 2>> + <<if _L.dairy > 2>> Under the rules, $he's allowed to demand that other slaves get $him off, and $he @@.hotpink;adores@@ you for leaving plentiful outlets for $his nymphomania under $his charge. <<else>> Under the rules, $he's allowed to demand that other slaves get $him off, and $he @@.hotpink;eagerly awaits@@ the day you assign more cows to $dairyName. @@ -4221,14 +4222,14 @@ <<set $slaves[$i].devotion += 1>> <<elseif ($slaves[$i].fetishKnown == 1) && ($slaves[$i].fetishStrength > 60)>> <<if ($slaves[$i].fetish == "sadist")>> - <<if $DairyiIDs.length > 2>> + <<if _L.dairy > 2>> Under the rules, $he's allowed to sexually abuse other slaves, and $he @@.hotpink;adores@@ you for providing so many cows for $him to rape. <<else>> Under the rules, $he's allowed to sexually abuse other slaves, and $he @@.hotpink;eagerly awaits@@ the day you assign more cows to $dairyName for $him to rape. <</if>> <<set $slaves[$i].devotion += 1>> <<elseif ($slaves[$i].fetish == "dom")>> - <<if $DairyiIDs.length > 2>> + <<if _L.dairy > 2>> Under the rules, $he's allowed to force other slaves to have sex with $him, and $he @@.hotpink;adores@@ you for allowing $him so many cows to dominate. <<else>> Under the rules, $he's allowed to force other slaves to have sex with $him, and $he @@.hotpink;eagerly awaits@@ the day you assign more cows to $his domain. @@ -4271,7 +4272,7 @@ <<if $spa != 0>> usually spends in $spaName<<if _S.Attendant>>, enjoying _S.Attendant.slaveName's care<</if>>. <<else>> - usually spends relaxing in $his room<<if $DairyiIDs.length > 1>> with the softest cow available<</if>>. + usually spends relaxing in $his room<<if _L.dairy > 1>> with the softest cow available<</if>>. <</if>> <<if $slaves[$i].relationship > 0>> <<set $subSlave = getSlave($slaves[$i].relationshipTarget)>> @@ -4573,14 +4574,14 @@ <<if ($universalRulesConsent == 0)>> <<if ($slaves[$i].devotion <= 20)>> <<if ($slaves[$i].trust > -10)>> - <<if $DairyiIDs.length > 2 || $Milkmaid != 0>> + <<if _L.dairy > 2 || $Milkmaid != 0>> Under the rules, $he finds $himself constantly molested by other slaves, and lives $his life constantly @@.gold;afraid.@@ <<else>> Under the rules, $he is free game for other slaves to molest, and lives $his life constantly @@.gold;afraid@@ of the day you assign more cows to $dairyName. <</if>> <<set $slaves[$i].trust -= 2>> <<else>> - <<if $DairyiIDs.length > 2 || $Milkmaid != 0>> + <<if _L.dairy > 2 || $Milkmaid != 0>> Under the rules, $he finds $himself constantly molested by other slaves, but $he's already in such constant terror it doesn't seriously affect $him. <<else>> Under the rules, $he will someday find $himself constantly molested by other slaves, but $he's already in such constant terror it that it doesn't cross $his mind. @@ -4588,7 +4589,7 @@ <</if>> <<elseif (_release.slaves === 1)>> <<if ($slaves[$i].energy > 95)>> - <<if $DairyiIDs.length > 2>> + <<if _L.dairy > 2>> Under the rules, $he's allowed to demand that other slaves to get $him off, and $he @@.hotpink;adores@@ you for providing plentiful outlets for $his nymphomania. <<else>> Under the rules, $he's allowed to demand that other slaves to get $him off, and $he @@.hotpink;eagerly awaits@@ the day you assign more cows to $dairyName to get $him off. @@ -4596,14 +4597,14 @@ <<set $slaves[$i].devotion += 1>> <<elseif ($slaves[$i].fetishKnown == 1) && ($slaves[$i].fetishStrength > 60)>> <<if ($slaves[$i].fetish == "sadist")>> - <<if $DairyiIDs.length > 2>> + <<if _L.dairy > 2>> Under the rules, $he's allowed to sexually abuse other slaves, and $he @@.hotpink;adores@@ you for providing a whole dairy of cows for $him to rape. <<else>> Under the rules, $he's allowed to sexually abuse other slaves, and $he @@.hotpink;eagerly awaits@@ the day you assign more cows to $dairyName for $him to rape. <</if>> <<set $slaves[$i].devotion += 1>> <<elseif ($slaves[$i].fetish == "dom")>> - <<if $DairyiIDs.length > 2>> + <<if _L.dairy > 2>> Under the rules, $he's allowed to force other slaves to have sex with $him, and $he @@.hotpink;adores@@ you for providing a whole dairy of cows for $him to dominate. <<else>> Under the rules, $he's allowed to force other slaves to have sex with $him, and $he @@.hotpink;eagerly awaits@@ the day you assign more cows to $dairyName for $him to dominate. @@ -4614,7 +4615,7 @@ <</if>> <<else>> <<if ($slaves[$i].devotion <= 20) && ($slaves[$i].devotion >= -20)>> - <<if $DairyiIDs.length > 2 || $Milkmaid != 0>> + <<if _L.dairy > 2 || $Milkmaid != 0>> Since $he's low in the slave hierarchy, @@.mediumaquamarine;$he knows@@ that the rule that slaves must get consent before having sex with $him are all that protect $him from abuse. <<else>> Since $he's low in the slave hierarchy, @@.mediumaquamarine;$he knows@@ that the rule that slaves must get consent before having sex with $him are all that protect $him from abuse. Well, that and the fact $dairyName is rather empty. @@ -4727,7 +4728,7 @@ <</if>> <</if>> <<case "be the Farmer">> - <<set $slaves[$i].need -= $FarmyardiIDs.length*5>> + <<set $slaves[$i].need -= _L.farmyard*5>> <<if $slaves[$i].energy <= 20>> is frigid and has little interest in getting off<<if App.Utils.releaseRestricted($slaves[$i])>>, making the rule restricting $his sexual outlets superfluous<</if>>. <<set $slaves[$i].need = 0>> @@ -4799,7 +4800,7 @@ <<if ($universalRulesConsent == 0)>> <<if (_release.slaves === 1)>> <<if ($slaves[$i].energy > 95)>> - <<if $FarmyardiIDs.length > 2>> + <<if _L.farmyard > 2>> Under the rules, $he's allowed to demand that other slaves get $him off, and $he @@.hotpink;adores@@ you for leaving plentiful outlets for $his nymphomania under $his charge. <<else>> Under the rules, $he's allowed to demand that other slaves get $him off, and $he @@.hotpink;eagerly awaits@@ the day you assign more cows to $farmyardName. @@ -4807,14 +4808,14 @@ <<set $slaves[$i].devotion += 1>> <<elseif ($slaves[$i].fetishKnown == 1) && ($slaves[$i].fetishStrength > 60)>> <<if ($slaves[$i].fetish == "sadist")>> - <<if $FarmyardiIDs.length > 2>> + <<if _L.farmyard > 2>> Under the rules, $he's allowed to sexually abuse other slaves, and $he @@.hotpink;adores@@ you for providing so many cows for $him to rape. <<else>> Under the rules, $he's allowed to sexually abuse other slaves, and $he @@.hotpink;eagerly awaits@@ the day you assign more cows to $farmyardName for $him to rape. <</if>> <<set $slaves[$i].devotion += 1>> <<elseif ($slaves[$i].fetish == "dom")>> - <<if $FarmyardiIDs.length > 2>> + <<if _L.farmyard > 2>> Under the rules, $he's allowed to force other slaves to have sex with $him, and $he @@.hotpink;adores@@ you for allowing $him so many cows to dominate. <<else>> Under the rules, $he's allowed to force other slaves to have sex with $him, and $he @@.hotpink;eagerly awaits@@ the day you assign more cows to $his domain. @@ -4862,7 +4863,7 @@ <<if $spa != 0>> usually spends in $spaName<<if _S.Attendant>>, enjoying _S.Attendant.slaveName's care<</if>>. <<else>> - usually spends relaxing in $his room<<if $FarmyardiIDs.length > 1>> with the softest cow available<</if>>. + usually spends relaxing in $his room<<if _L.farmyard > 1>> with the softest cow available<</if>>. <</if>> <<if $slaves[$i].relationship > 0>> <<set $subSlave = getSlave($slaves[$i].relationshipTarget)>> @@ -5146,14 +5147,14 @@ <<if ($universalRulesConsent == 0)>> <<if ($slaves[$i].devotion <= 20)>> <<if ($slaves[$i].trust > -10)>> - <<if $FarmyardiIDs.length > 2 || $Farmer != 0>> + <<if _L.farmyard > 2 || $Farmer != 0>> Under the rules, $he finds $himself constantly molested by other slaves, and lives $his life constantly @@.gold;afraid.@@ <<else>> Under the rules, $he is free game for other slaves to molest, and lives $his life constantly @@.gold;afraid@@ of the day you assign more cows to $farmyardName. <</if>> <<set $slaves[$i].trust -= 2>> <<else>> - <<if $FarmyardiIDs.length > 2 || $Farmer != 0>> + <<if _L.farmyard > 2 || $Farmer != 0>> Under the rules, $he finds $himself constantly molested by other slaves, but $he's already in such constant terror it doesn't seriously affect $him. <<else>> Under the rules, $he will someday find $himself constantly molested by other slaves, but $he's already in such constant terror it that it doesn't cross $his mind. @@ -5161,7 +5162,7 @@ <</if>> <<elseif (_release.slaves === 1)>> <<if ($slaves[$i].energy > 95)>> - <<if $FarmyardiIDs.length > 2>> + <<if _L.farmyard > 2>> Under the rules, $he's allowed to demand that other slaves to get $him off, and $he @@.hotpink;adores@@ you for providing plentiful outlets for $his nymphomania. <<else>> Under the rules, $he's allowed to demand that other slaves to get $him off, and $he @@.hotpink;eagerly awaits@@ the day you assign more slaves to $farmyardName to get $him off. @@ -5169,14 +5170,14 @@ <<set $slaves[$i].devotion += 1>> <<elseif ($slaves[$i].fetishKnown == 1) && ($slaves[$i].fetishStrength > 60)>> <<if ($slaves[$i].fetish == "sadist")>> - <<if $FarmyardiIDs.length > 2>> + <<if _L.farmyard > 2>> Under the rules, $he's allowed to sexually abuse other slaves, and $he @@.hotpink;adores@@ you for providing a whole farmyard of slaves for $him to rape. <<else>> Under the rules, $he's allowed to sexually abuse other slaves, and $he @@.hotpink;eagerly awaits@@ the day you assign more slaves to $farmyardName for $him to rape. <</if>> <<set $slaves[$i].devotion += 1>> <<elseif ($slaves[$i].fetish == "dom")>> - <<if $FarmyardiIDs.length > 2>> + <<if _L.farmyard > 2>> Under the rules, $he's allowed to force other slaves to have sex with $him, and $he @@.hotpink;adores@@ you for providing a whole farmyard of slaves for $him to dominate. <<else>> Under the rules, $he's allowed to force other slaves to have sex with $him, and $he @@.hotpink;eagerly awaits@@ the day you assign more slaves to $farmyardName for $him to dominate. @@ -5187,7 +5188,7 @@ <</if>> <<else>> <<if ($slaves[$i].devotion <= 20) && ($slaves[$i].devotion >= -20)>> - <<if $FarmyardiIDs.length > 2 || $Farmer != 0>> + <<if _L.farmyard > 2 || $Farmer != 0>> Since $he's low in the slave hierarchy, @@.mediumaquamarine;$he knows@@ that the rule that slaves must get consent before having sex with $him are all that protect $him from abuse. <<else>> Since $he's low in the slave hierarchy, @@.mediumaquamarine;$he knows@@ that the rule that slaves must get consent before having sex with $him are all that protect $him from abuse. Well, that and the fact $farmyardName is rather empty. @@ -5377,7 +5378,7 @@ <<elseif $slaves[$i].energy <= 20>> is frigid and has little interest in getting off. <<set $slaves[$i].need = 0>> - <<elseif $masterSuiteUpgradeLuxury == 2 && $MastSiIDs.length > 3>> + <<elseif $masterSuiteUpgradeLuxury == 2 && _L.masterSuite > 3>> never goes unsatisfied with all the action in the fuckpit. <<set $slaves[$i].need -= 80>> <<elseif $slaves[$i].need < $slaves[$i].needCap*0.5>> diff --git a/src/uncategorized/schoolroom.tw b/src/uncategorized/schoolroom.tw index 24e18f341202ebdbcff81d88a8c76223ef470e75..10a3d7834fddf87a7d1b353fe1588b0c8537a7cd 100644 --- a/src/uncategorized/schoolroom.tw +++ b/src/uncategorized/schoolroom.tw @@ -1,6 +1,6 @@ :: Schoolroom [nobr] -<<set $nextButton = "Back to Main", $nextLink = "Main", $returnTo = "Schoolroom", $showEncyclopedia = 1, $encyclopedia = "Schoolroom">> +<<set _DL = App.Entity.facilities.schoolroom.employeesIDs().size, $nextButton = "Back to Main", $nextLink = "Main", $returnTo = "Schoolroom", $showEncyclopedia = 1, $encyclopedia = "Schoolroom">> <<if $schoolroomName != "the Schoolroom">> <<set $schoolroomNameCaps = $schoolroomName.replace("the ", "The ")>> @@ -68,9 +68,9 @@ reviewing the often complex subject of how to address citizens other that one's owner. <</switch>> - <<if $SchlRiIDs.length > 2>> + <<if _DL > 2>> $schoolroomNameCaps is busy with slaves, repeating their lessons out loud to drill the instruction home. A few students are maintaining uncomfortable positions in the corner as punishment for poor work. - <<elseif $SchlRiIDs.length > 0>> + <<elseif _DL > 0>> $schoolroomNameCaps is sparsely populated, the few students repeating their lessons out loud to drill the instruction home. One slave is maintaining an uncomfortable position in the corner as punishment for poor work. <<elseif $Schoolteacher != 0>> <<setLocalPronouns $Schoolteacher>> @@ -85,7 +85,7 @@ <div> <<set _Tmult0 = Math.trunc($schoolroom*1000*$upgradeMultiplierArcology)>> - $schoolroomNameCaps has room to house $schoolroom slaves while they learn. There <<if $SchlRiIDs.length == 1>>is<<else>>are<</if>> currently $SchlRiIDs.length slave<<if $SchlRiIDs.length != 1>>s<</if>> learning in $schoolroomName. + $schoolroomNameCaps has room to house $schoolroom slaves while they learn. There <<if _DL == 1>>is<<else>>are<</if>> currently _DL slave<<if _DL != 1>>s<</if>> learning in $schoolroomName. <div class="choices"> [[Expand the schoolroom|Schoolroom][cashX(forceNeg(_Tmult0), "capEx"), $schoolroom += 5, $PC.skill.engineering += .1]] <span class="note"> @@ -93,7 +93,7 @@ </span> </div> <div class="choices"> - <<if $SchlRiIDs.length > 0>> + <<if _DL > 0>> <<removeFacilityWorkers "schoolroom" "rest" "take classes">> <</if>> </div> diff --git a/src/uncategorized/schoolroomReport.tw b/src/uncategorized/schoolroomReport.tw index c778ddf545888b762602090dca7322d4c6999157..329c301d27b25866e673b90a6b412689add547a9 100644 --- a/src/uncategorized/schoolroomReport.tw +++ b/src/uncategorized/schoolroomReport.tw @@ -1,7 +1,7 @@ :: Schoolroom Report [nobr] -<<SlaveIDSort $SchlRiIDs>> -<<set _DL = $SchlRiIDs.length, _SL = $slaves.length, _idleBonus = 0, _FLsFetish = 0>> +<<set _slaves = App.Utils.sortedEmployees(App.Entity.facilities.schoolroom)>> +<<set _DL = _slaves.length, _SL = $slaves.length, _idleBonus = 0, _FLsFetish = 0>> <<if $schoolroomDecoration != "standard">> <<set _devBonus = 1>> @@ -75,21 +75,21 @@ $His students want to be just like their beautiful teacher. <<set _idleBonus++>> <</if>> - <<for _dI = 0; _dI < _DL; _dI++>> - <<set $i = $slaveIndices[$SchlRiIDs[_dI]]>> - <<setLocalPronouns $slaves[$i] 2>> - <<if $Schoolteacher.rivalryTarget == $slaves[$i].ID>> - Ever since $his <<print rivalryTerm($Schoolteacher)>> was enrolled, $he began stalking the classroom carrying a large paddle, much to $slaves[$i].slaveName's terror. - <<set $slaves[$i].devotion -= 4, $slaves[$i].trust -= 4>> + <<for _slave range _slaves>> + <<set $i = $slaveIndices[_slave.ID]>> + <<setLocalPronouns _slave 2>> + <<if $Schoolteacher.rivalryTarget == _slave.ID>> + Ever since $his <<print rivalryTerm($Schoolteacher)>> was enrolled, $he began stalking the classroom carrying a large paddle, much to _slave.slaveName's terror. + <<set _slave.devotion -= 4, _slave.trust -= 4>> <<if random(1,100) > 35>> - <<set $Schoolteacher.rivalry++, $slaves[_FLs].rivalry++, $slaves[$i].rivalry++>> + <<set $Schoolteacher.rivalry++, $slaves[_FLs].rivalry++, _slave.rivalry++>> <</if>> - <<elseif $Schoolteacher.relationshipTarget == $slaves[$i].ID>> - $He dedicates most of $his attention to $his <<print relationshipTerm($Schoolteacher)>>, $slaves[$i].slaveName, making sure _he2 understands that day's lesson. - <<set $slaves[$i].devotion += 2, $slaves[$i].trust += 2>> - <<elseif areRelated($Schoolteacher, $slaves[$i])>> - $He makes sure to spend extra time teaching $his <<print relativeTerm($Schoolteacher,$slaves[$i])>>, $slaves[$i].slaveName. - <<set $slaves[$i].trust++>> + <<elseif $Schoolteacher.relationshipTarget == _slave.ID>> + $He dedicates most of $his attention to $his <<print relationshipTerm($Schoolteacher)>>, _slave.slaveName, making sure _he2 understands that day's lesson. + <<set _slave.devotion += 2, _slave.trust += 2>> + <<elseif areRelated($Schoolteacher, _slave)>> + $He makes sure to spend extra time teaching $his <<print relativeTerm($Schoolteacher,_slave)>>, _slave.slaveName. + <<set _slave.trust++>> <</if>> <</for>> <<if (_DL < $schoolroom)>> @@ -143,59 +143,59 @@ <</if>> <<set _restedSlaves = 0>> -<<for _dI = 0; _dI < _DL; _dI++>> - <<set $i = $slaveIndices[$SchlRiIDs[_dI]]>> - <<setLocalPronouns $slaves[$i] 2>> - <<set $slaves[$i].devotion += _devBonus>> - <<if ($slaves[$i].health.condition < -80)>> - <<run improveCondition($slaves[$i], 20)>> - <<elseif ($slaves[$i].health.condition < -40)>> - <<run improveCondition($slaves[$i], 10)>> - <<elseif ($slaves[$i].health.condition < 0)>> - <<run improveCondition($slaves[$i], 7)>> - <<elseif ($slaves[$i].health.condition < 90)>> - <<run improveCondition($slaves[$i], 3)>> +<<for _slave range _slaves>> + <<set $i = $slaveIndices[_slave.ID]>> + <<setLocalPronouns _slave 2>> + <<set _slave.devotion += _devBonus>> + <<if (_slave.health.condition < -80)>> + <<run improveCondition(_slave, 20)>> + <<elseif (_slave.health.condition < -40)>> + <<run improveCondition(_slave, 10)>> + <<elseif (_slave.health.condition < 0)>> + <<run improveCondition(_slave, 7)>> + <<elseif (_slave.health.condition < 90)>> + <<run improveCondition(_slave, 3)>> <</if>> - <<if $slaves[$i].rules.living != "normal">> - <<set $slaves[$i].rules.living = "normal">> + <<if _slave.rules.living != "normal">> + <<set _slave.rules.living = "normal">> <</if>> /% Education done? Has to be here before we run the SA's or there will be double entries for slave %/ - <<if $slaves[$i].fetish == "mindbroken">> - <<if $assignmentRecords[$slaves[$i].ID]>> - <<= assignJobSafely($slaves[$i], $assignmentRecords[$slaves[$i].ID])>> + <<if _slave.fetish == "mindbroken">> + <<if $assignmentRecords[_slave.ID]>> + <<= assignJobSafely(_slave, $assignmentRecords[_slave.ID])>> <<else>> - <<= removeJob($slaves[$i], "learn in the schoolroom")>> + <<= removeJob(_slave, "learn in the schoolroom")>> <</if>> <<set _restedSlaves++, _dI--, _DL-->> <<continue>> <<else>> - <<if ($slaves[$i].intelligenceImplant >= 30 && $schoolroomRemodelBimbo != 1) || ($slaves[$i].intelligenceImplant <= -15 && $schoolroomRemodelBimbo == 1)>> - <<if ($slaves[$i].voice == 0) || ($slaves[$i].accent <= 1) || (($schoolroomUpgradeLanguage == 0) && ($slaves[$i].accent <= 2))>> - <<if ($slaves[$i].skill.oral > 30) || (($schoolroomUpgradeSkills == 0) && ($slaves[$i].skill.oral > 10))>> - <<if ($slaves[$i].skill.whoring > 30) || (($schoolroomUpgradeSkills == 0) && ($slaves[$i].skill.whoring > 10))>> - <<if ($slaves[$i].skill.entertainment > 30) || (($schoolroomUpgradeSkills == 0) && ($slaves[$i].skill.entertainment > 10))>> - <<if ($slaves[$i].skill.anal > 30) || (($schoolroomUpgradeSkills == 0) && ($slaves[$i].skill.anal > 10))>> - <<if ($slaves[$i].skill.vaginal > 30) || (($schoolroomUpgradeSkills == 0) && ($slaves[$i].skill.vaginal > 10)) || ($slaves[$i].vagina < 0)>> + <<if (_slave.intelligenceImplant >= 30 && $schoolroomRemodelBimbo != 1) || (_slave.intelligenceImplant <= -15 && $schoolroomRemodelBimbo == 1)>> + <<if (_slave.voice == 0) || (_slave.accent <= 1) || (($schoolroomUpgradeLanguage == 0) && (_slave.accent <= 2))>> + <<if (_slave.skill.oral > 30) || (($schoolroomUpgradeSkills == 0) && (_slave.skill.oral > 10))>> + <<if (_slave.skill.whoring > 30) || (($schoolroomUpgradeSkills == 0) && (_slave.skill.whoring > 10))>> + <<if (_slave.skill.entertainment > 30) || (($schoolroomUpgradeSkills == 0) && (_slave.skill.entertainment > 10))>> + <<if (_slave.skill.anal > 30) || (($schoolroomUpgradeSkills == 0) && (_slave.skill.anal > 10))>> + <<if (_slave.skill.vaginal > 30) || (($schoolroomUpgradeSkills == 0) && (_slave.skill.vaginal > 10)) || (_slave.vagina < 0)>> <p> - <span class="slave-name">$slaves[$i].slaveName</span> can learn little from further classes, + <span class="slave-name">_slave.slaveName</span> can learn little from further classes, <span class="noteworthy"> - <<if $assignmentRecords[$slaves[$i].ID]>> - <<set _oldJob = $assignmentRecords[$slaves[$i].ID]>> - <<= assignJobSafely($slaves[$i], _oldJob)>> - <<if $slaves[$i].choosesOwnAssignment === 1>> + <<if $assignmentRecords[_slave.ID]>> + <<set _oldJob = $assignmentRecords[_slave.ID]>> + <<= assignJobSafely(_slave, _oldJob)>> + <<if _slave.choosesOwnAssignment === 1>> and $he is resting before choosing another task. - <<elseif $slaves[$i].assignment === "rest">> + <<elseif _slave.assignment === "rest">> <<if _oldJob != "rest">> and since $he was unable to return to $his old task to <<print _oldJob>>, $his assignment has defaulted to rest. <<else>> so $he has returned to rest. <</if>> <<else>> - so $he goes back to <<print $slaves[$i].assignment>>. + so $he goes back to <<print _slave.assignment>>. <</if>> <<else>> so _his2 assignment has defaulted to rest. - <<= removeJob($slaves[$i], "learn in the schoolroom")>> + <<= removeJob(_slave, "learn in the schoolroom")>> <</if>> </span> </p> @@ -214,36 +214,36 @@ /* 000-250-006 */ <<if $seeImages && $seeReportImages>> <div class="imageRef tinyImg"> - <<= SlaveArt($slaves[$i], 0, 0)>> + <<= SlaveArt(_slave, 0, 0)>> </div> <</if>> /* 000-250-006 */ - <<setLocalPronouns $slaves[$i]>> - <span class='slave-name'>$slaves[$i].slaveName</span> - <<if $slaves[$i].choosesOwnAssignment == 2>> + <<setLocalPronouns _slave>> + <span class='slave-name'>_slave.slaveName</span> + <<if _slave.choosesOwnAssignment == 2>> <<include "SA chooses own job">> <<else>> is studying in $schoolroomName. <</if>> - <br> $He <<= App.SlaveAssignment.takeClasses($slaves[$i])>> + <br> $He <<= App.SlaveAssignment.takeClasses(_slave)>> <br> - <<= App.SlaveAssignment.choosesOwnClothes($slaves[$i])>> + <<= App.SlaveAssignment.choosesOwnClothes(_slave)>> <<include "SA rules">> <<include "SA diet">> <<include "SA long term effects">> - <<= App.SlaveAssignment.drugs($slaves[$i])>> + <<= App.SlaveAssignment.drugs(_slave)>> <<include "SA relationships">> <<include "SA rivalries">> <br><<include "SA devotion">> <<else>> <<silently>> <<include "SA chooses own job">> - <<run App.SlaveAssignment.takeClasses($slaves[$i])>> - <<run App.SlaveAssignment.choosesOwnClothes($slaves[$i])>> + <<run App.SlaveAssignment.takeClasses(_slave)>> + <<run App.SlaveAssignment.choosesOwnClothes(_slave)>> <<include "SA rules">> <<include "SA diet">> <<include "SA long term effects">> - <<run App.SlaveAssignment.drugs($slaves[$i])>> + <<run App.SlaveAssignment.drugs(_slave)>> <<include "SA relationships">> <<include "SA rivalries">> <<include "SA devotion">> diff --git a/src/uncategorized/servantsQuarters.tw b/src/uncategorized/servantsQuarters.tw index b49d6d0fb490008c0f0b4719eb242a95b6450663..66ec26328a0cee9575d2d7469821fc42d8cf4b16 100644 --- a/src/uncategorized/servantsQuarters.tw +++ b/src/uncategorized/servantsQuarters.tw @@ -1,6 +1,6 @@ :: Servants' Quarters [nobr] -<<set $nextButton = "Back to Main", $nextLink = "Main", $returnTo = "Servants' Quarters", $showEncyclopedia = 1, $encyclopedia = "Servants' Quarters">> +<<set _DL = App.Entity.facilities.servantsQuarters.employeesIDs().size, $nextButton = "Back to Main", $nextLink = "Main", $returnTo = "Servants' Quarters", $showEncyclopedia = 1, $encyclopedia = "Servants' Quarters">> <<if $servantsQuartersName != "the Servants' Quarters">> <<set $servantsQuartersNameCaps = $servantsQuartersName.replace("the ", "The ")>> @@ -68,9 +68,9 @@ are comfortable. Servants sleep together in a dormitory, eat together in a little kitchen, bathe together in a communal shower, and then head out into the penthouse to serve. <</switch>> - <<if $ServQiIDs.length > 2>> + <<if _DL > 2>> $servantsQuartersNameCaps are busy with hurrying slaves. One shift of servants is eating, cleaning the quarters, and bathing. The second is sleeping, and the third is out in the penthouse cleaning and serving. - <<elseif $ServQiIDs.length > 0>> + <<elseif _DL > 0>> A few slaves are working out of the servants' quarters. They must split their scant time between looking after their own needs and the superior needs of everyone else. <<elseif $Stewardess != 0>> $Stewardess.slaveName is alone, and seems rather bereft without anyone to order around. @@ -86,7 +86,7 @@ <div> <<set _Tmult0 = Math.trunc($servantsQuarters*1000*$upgradeMultiplierArcology)>> $servantsQuartersNameCaps has room to keep $servantsQuarters slaves while they serve. - There <<if $ServQiIDs.length == 1>>is<<else>>are<</if>> currently $ServQiIDs.length slave<<if $ServQiIDs.length != 1>>s<</if>> serving in $servantsQuartersName. + There <<if _DL == 1>>is<<else>>are<</if>> currently _DL slave<<if _DL != 1>>s<</if>> serving in $servantsQuartersName. <div class="choices"> [[Expand the Servants' Quarters|Servants' Quarters][cashX(forceNeg(_Tmult0), "capEx"), $servantsQuarters += 5, $PC.skill.engineering += .1]] <span class="note"> @@ -95,7 +95,7 @@ </div> <div class="choices"> - <<if $ServQiIDs.length > 0>> + <<if _DL > 0>> <<removeFacilityWorkers "servantsQuarters" "rest" "be a servant">> <</if>> </div> diff --git a/src/uncategorized/servantsQuartersReport.tw b/src/uncategorized/servantsQuartersReport.tw index 3c1a565c48d862d00ae31f86bd56966a74ddf5de..28abb38eff176e710cc78d5426016ef73962b9ad 100644 --- a/src/uncategorized/servantsQuartersReport.tw +++ b/src/uncategorized/servantsQuartersReport.tw @@ -1,7 +1,7 @@ :: Servants' Quarters Report [nobr] -<<SlaveIDSort $ServQiIDs>> -<<set _DL = $ServQiIDs.length, _SL = $slaves.length, _FLsFetish = 0, $stewardessBonus = 0>> +<<set _slaves = App.Utils.sortedEmployees(App.Entity.facilities.servantsQuarters)>> +<<set _DL = _slaves.length, _SL = $slaves.length, _FLsFetish = 0, $stewardessBonus = 0>> <<if $servantsQuartersDecoration != "standard">> <<set _devBonus = 1>> @@ -47,14 +47,13 @@ <<= SlaveFullName($Stewardess)>> is serving as your Stewardess.<<if $Stewardess.relationship == -3 && $Stewardess.devotion > 50>> $He does $his best to be your perfect lovely house<<= $wife>>.<</if>> <<if ($stewardessImpregnates == 1) && (_DL > 0) && (canPenetrate($Stewardess)) && $Stewardess.pubertyXY == 1>> <<set _stewardessImpregnated = 0>> - <<for _dI = 0; _dI < _DL; _dI++>> - <<set $i = $slaveIndices[$ServQiIDs[_dI]]>> - <<if (canImpreg($slaves[$i], $Stewardess))>> - <<= knockMeUp($slaves[$i], 100, 2, $Stewardess.ID)>> - <<set $slaves[$i].preg = 1, $slaves[$i].pregKnown = 1, $slaves[$i].pregWeek = 1, $slaves[$i].pregSource = $Stewardess.ID>><<set $slaves[$i].pregType = setPregType($slaves[$i])>> - <<set WombImpregnate($slaves[$i], $slaves[$i].pregType, $slaves[$i].pregSource, 1)>> - <<set $slaves[$i].vagina = Math.clamp($slaves[$i].vagina,1,10), _stewardessImpregnated++, $slaves[$i].counter.vaginal += 10, $vaginalTotal += 10>> - <<set $slaves[$i].need = 0>> + <<for _slave range _slaves>> + <<if (canImpreg(_slave, $Stewardess))>> + <<= knockMeUp(_slave, 100, 2, $Stewardess.ID)>> + <<set _slave.preg = 1, _slave.pregKnown = 1, _slave.pregWeek = 1, _slave.pregSource = $Stewardess.ID>><<set _slave.pregType = setPregType(_slave)>> + <<set WombImpregnate(_slave, _slave.pregType, _slave.pregSource, 1)>> + <<set _slave.vagina = Math.clamp(_slave.vagina,1,10), _stewardessImpregnated++, _slave.counter.vaginal += 10, $vaginalTotal += 10>> + <<set _slave.need = 0>> <</if>> <</for>> <<if _stewardessImpregnated > 0>> @@ -110,50 +109,49 @@ <<else>> <<set _BonusToggle = 0>> <</if>> - <<for _dI = 0; _dI < _DL; _dI++>> - <<set $i = $slaveIndices[$ServQiIDs[_dI]]>> - <<setLocalPronouns $slaves[$i] 2>> - <<if $Stewardess.rivalryTarget == $slaves[$i].ID>> - $He bears down on $his <<print rivalryTerm($Stewardess)>>, $slaves[$i].slaveName, forcing _him2 to work extra hard or suffer punishment. - <<set $slaves[$i].devotion--, $slaves[$i].trust-->> + <<for _slave range _slaves>> + <<setLocalPronouns _slave 2>> + <<if $Stewardess.rivalryTarget == _slave.ID>> + $He bears down on $his <<print rivalryTerm($Stewardess)>>, _slave.slaveName, forcing _him2 to work extra hard or suffer punishment. + <<set _slave.devotion--, _slave.trust-->> <<if random(1,100) > 65>> - <<set $Stewardess.rivalry++, $slaves[_FLs].rivalry++, $slaves[$i].rivalry++>> + <<set $Stewardess.rivalry++, $slaves[_FLs].rivalry++, _slave.rivalry++>> <</if>> - <<elseif $Stewardess.relationshipTarget == $slaves[$i].ID>> - $He dotes over $his <<print relationshipTerm($Stewardess)>>, $slaves[$i].slaveName, making sure _he2 knows how to do a good job and keeping _him2 well stocked with everything _he2 needs. - <<set $slaves[$i].devotion++>> - <<elseif areRelated($Stewardess, $slaves[$i])>> - $He pays special attention to $his <<print relativeTerm($Stewardess,$slaves[$i])>>, $slaves[$i].slaveName, making sure _he2 doesn't slack off just because they are related. - <<set $slaves[$i].trust++>> + <<elseif $Stewardess.relationshipTarget == _slave.ID>> + $He dotes over $his <<print relationshipTerm($Stewardess)>>, _slave.slaveName, making sure _he2 knows how to do a good job and keeping _him2 well stocked with everything _he2 needs. + <<set _slave.devotion++>> + <<elseif areRelated($Stewardess, _slave)>> + $He pays special attention to $his <<print relativeTerm($Stewardess,_slave)>>, _slave.slaveName, making sure _he2 doesn't slack off just because they are related. + <<set _slave.trust++>> <</if>> - <<switch $slaves[$i].prestigeDesc>> + <<switch _slave.prestigeDesc>> <<case "$He is a famed Free Cities whore, and commands top prices.">> - $He does $his best to motivate the famous whore, $slaves[$i].slaveName, though $he is uncertain why _he2 is here. + $He does $his best to motivate the famous whore, _slave.slaveName, though $he is uncertain why _he2 is here. <<case "$He is a famed Free Cities slut, and can please anyone.">> - $He ignores $his duties in order the fawn over the famous entertainer, $slaves[$i].slaveName. + $He ignores $his duties in order the fawn over the famous entertainer, _slave.slaveName. <<case "$He is remembered for winning best in show as a cockmilker.">> - <<if ($slaves[$i].dick != 0) && ($slaves[$i].balls != 0) && ($slaves[$i].prostate > 1)>> - $slaves[$i].slaveName leaves a trail of cum wherever _he2 goes and frequently stops to masturbate, greatly annoying $Stewardess.slaveName. - <<if random(1,100) > 90 && $Stewardess.rivalry == 0 && $slaves[$i].rivalry == 0>> - <<set $Stewardess.rivalryTarget = $slaves[$i].ID, $Stewardess.rivalry++, $slaves[_FLs].rivalryTarget = $slaves[$i].ID, $slaves[_FLs].rivalry++>> - <<set $slaves[$i].rivalryTarget = $Stewardess.ID, $slaves[$i].rivalry++>> + <<if (_slave.dick != 0) && (_slave.balls != 0) && (_slave.prostate > 1)>> + _slave.slaveName leaves a trail of cum wherever _he2 goes and frequently stops to masturbate, greatly annoying $Stewardess.slaveName. + <<if random(1,100) > 90 && $Stewardess.rivalry == 0 && _slave.rivalry == 0>> + <<set $Stewardess.rivalryTarget = _slave.ID, $Stewardess.rivalry++, $slaves[_FLs].rivalryTarget = _slave.ID, $slaves[_FLs].rivalry++>> + <<set _slave.rivalryTarget = $Stewardess.ID, _slave.rivalry++>> <</if>> <</if>> <<case "$He is remembered for winning best in show as a dairy cow.">> - <<if ($slaves[$i].lactation > 0) && (($slaves[$i].boobs-$slaves[$i].boobsImplant) > 6000)>> - $slaves[$i].slaveName's huge breasts frequently get in the way of _his2 work and _he2 leaks milk everywhere, greatly annoying $Stewardess.slaveName. - <<if random(1,100) > 90 && $Stewardess.rivalry == 0 && $slaves[$i].rivalry == 0>> - <<set $Stewardess.rivalryTarget = $slaves[$i].ID, $Stewardess.rivalry++, $slaves[_FLs].rivalryTarget = $slaves[$i].ID, $slaves[_FLs].rivalry++>> - <<set $slaves[$i].rivalryTarget = $Stewardess.ID, $slaves[$i].rivalry++>> + <<if (_slave.lactation > 0) && ((_slave.boobs-_slave.boobsImplant) > 6000)>> + _slave.slaveName's huge breasts frequently get in the way of _his2 work and _he2 leaks milk everywhere, greatly annoying $Stewardess.slaveName. + <<if random(1,100) > 90 && $Stewardess.rivalry == 0 && _slave.rivalry == 0>> + <<set $Stewardess.rivalryTarget = _slave.ID, $Stewardess.rivalry++, $slaves[_FLs].rivalryTarget = _slave.ID, $slaves[_FLs].rivalry++>> + <<set _slave.rivalryTarget = $Stewardess.ID, _slave.rivalry++>> <</if>> <</if>> <<case "$He is remembered for winning best in show as a breeder.">> - <<if $slaves[$i].bellyPreg >= 10000>> - $slaves[$i].slaveName's big pregnant belly frequently gets in the way of _his2 work. However, $Stewardess.slaveName is willing to overlook it, as well as allow _him2 easy jobs, due to how valuable _his2 womb is. + <<if _slave.bellyPreg >= 10000>> + _slave.slaveName's big pregnant belly frequently gets in the way of _his2 work. However, $Stewardess.slaveName is willing to overlook it, as well as allow _him2 easy jobs, due to how valuable _his2 womb is. <</if>> <</switch>> - <<if (_BonusToggle == 1) && ($slaves[$i].devotion < 45)>> - <<set $slaves[$i].devotion += 5>> + <<if (_BonusToggle == 1) && (_slave.devotion < 45)>> + <<set _slave.devotion += 5>> <</if>> <</for>> <<if (_DL > 0)>> @@ -173,7 +171,7 @@ <<set $failedElite += 10>> <</if>> <<if (_DL > 0)>> - <<setLocalPronouns $slaves[$slaveIndices[$ServQiIDs[0]]]>> + <<setLocalPronouns _slaves[0]>> <<if (_DL != 1)>>''There are _DL slaves working out of the servants' quarters.'' They work to<<else>>''There is one slave working out of the servants' quarters.'' $He works to<</if>> @@.yellowgreen;reduce@@ your household expenses; having a well-staffed house slightly @@.green;increases@@ your reputation. <</if>> @@ -217,98 +215,99 @@ <<set $servantMilkersMultiplier = 0.5, _SQMilk = 0, _SQMilkSale = 0>> -<<for _dI = 0; _dI < _DL; _dI++>> - <<set $i = $slaveIndices[$ServQiIDs[_dI]], $slaves[$i].devotion += _devBonus>> - <<setLocalPronouns $slaves[$i] 2>> - <<if ($slaves[$i].devotion <= 20) && ($slaves[$i].trust >= -20)>> - <<set $slaves[$i].devotion -= 5, $slaves[$i].trust -= 5>> - <<elseif ($slaves[$i].devotion <= 10)>> - <<set $slaves[$i].devotion += 2>> - <<elseif ($slaves[$i].devotion >= 80)>> - <<set $slaves[$i].devotion -= 2>> +<<for _slave range _slaves>> + <<set $i = $slaveIndices[_slave.ID]>> + <<set _slave.devotion += _devBonus>> + <<setLocalPronouns _slave 2>> + <<if (_slave.devotion <= 20) && (_slave.trust >= -20)>> + <<set _slave.devotion -= 5, _slave.trust -= 5>> + <<elseif (_slave.devotion <= 10)>> + <<set _slave.devotion += 2>> + <<elseif (_slave.devotion >= 80)>> + <<set _slave.devotion -= 2>> <</if>> - <<if ($slaves[$i].devotion < -20)>> - <<set $slaves[$i].trust += 3>> - <<elseif ($slaves[$i].trust < -50)>> - <<set $slaves[$i].trust += 2>> - <<elseif ($slaves[$i].trust < -30)>> - <<set $slaves[$i].trust += 1>> + <<if (_slave.devotion < -20)>> + <<set _slave.trust += 3>> + <<elseif (_slave.trust < -50)>> + <<set _slave.trust += 2>> + <<elseif (_slave.trust < -30)>> + <<set _slave.trust += 1>> <</if>> - <<if ($slaves[$i].health.condition < -80)>> - <<run improveCondition($slaves[$i], 20)>> - <<elseif ($slaves[$i].health.condition < -40)>> - <<run improveCondition($slaves[$i], 10)>> - <<elseif ($slaves[$i].health.condition < 0)>> - <<run improveCondition($slaves[$i], 7)>> - <<elseif ($slaves[$i].health.condition < 90)>> - <<run improveCondition($slaves[$i], 3)>> + <<if (_slave.health.condition < -80)>> + <<run improveCondition(_slave, 20)>> + <<elseif (_slave.health.condition < -40)>> + <<run improveCondition(_slave, 10)>> + <<elseif (_slave.health.condition < 0)>> + <<run improveCondition(_slave, 7)>> + <<elseif (_slave.health.condition < 90)>> + <<run improveCondition(_slave, 3)>> <</if>> <<switch $servantsQuartersDecoration>> <<case "Arabian Revivalist" "Aztec Revivalist" "Chattel Religionist" "Chinese Revivalist" "Degradationist" "Edo Revivalist" "Egyptian Revivalist" "Roman Revivalist" "Subjugationist" "Supremacist">> - <<set $slaves[$i].rules.living = "spare">> + <<set _slave.rules.living = "spare">> <<case "Slave Professionalism">> - <<if $slaves[$i].intelligence+$slaves[$i].intelligenceImplant > 15>> - <<set $slaves[$i].rules.living = "normal">> + <<if _slave.intelligence+_slave.intelligenceImplant > 15>> + <<set _slave.rules.living = "normal">> <<else>> - <<set $slaves[$i].rules.living = "spare">> + <<set _slave.rules.living = "spare">> <</if>> <<case "Petite Admiration">> - <<if heightPass($slaves[$i])>> - <<set $slaves[$i].rules.living = "normal">> + <<if heightPass(_slave)>> + <<set _slave.rules.living = "normal">> <<else>> - <<set $slaves[$i].rules.living = "spare">> + <<set _slave.rules.living = "spare">> <</if>> <<case "Statuesque Glorification">> - <<if heightPass($slaves[$i])>> - <<set $slaves[$i].rules.living = "normal">> + <<if heightPass(_slave)>> + <<set _slave.rules.living = "normal">> <<else>> - <<set $slaves[$i].rules.living = "spare">> + <<set _slave.rules.living = "spare">> <</if>> <<default>> - <<set $slaves[$i].rules.living = "normal">> + <<set _slave.rules.living = "normal">> <</switch>> <<if $showEWD != 0>> <br><br> /* 000-250-006 */ <<if $seeImages && $seeReportImages>> <div class="imageRef tinyImg"> - <<= SlaveArt($slaves[$i], 0, 0)>> + <<= SlaveArt(_slave, 0, 0)>> </div> <</if>> /* 000-250-006 */ - <span class='slave-name'><<= SlaveFullName($slaves[$i])>></span> - <<if $slaves[$i].choosesOwnAssignment == 2>> + <span class='slave-name'><<= SlaveFullName(_slave)>></span> + <<if _slave.choosesOwnAssignment == 2>> <<include "SA chooses own job">> <<else>> is working out of $servantsQuartersName. <</if>> - <br> _He2 <<= App.SlaveAssignment.servant($slaves[$i])>> - <<if ($servantMilkers == 1) && ($slaves[$i].lactation > 0)>> - <br> _He2 <<= App.SlaveAssignment.getMilked($slaves[$i])>> + <br> _He2 <<= App.SlaveAssignment.servant(_slave)>> + <<if ($servantMilkers == 1) && (_slave.lactation > 0)>> + <br> _He2 <<= App.SlaveAssignment.getMilked(_slave)>> <<set _SQMilk += $milk, _SQMilkSale += $milkSale>> <</if>> <br> - <<= App.SlaveAssignment.choosesOwnClothes($slaves[$i])>> + <<= App.SlaveAssignment.choosesOwnClothes(_slave)>> <<include "SA rules">> <<include "SA diet">> <<include "SA long term effects">> - <<= App.SlaveAssignment.drugs($slaves[$i])>> + <<= App.SlaveAssignment.drugs(_slave)>> <<include "SA relationships">> <<include "SA rivalries">> <br><<include "SA devotion">> <<else>> <<silently>> <<include "SA chooses own job">> - <<run App.SlaveAssignment.servant($slaves[$i])>> - <<if ($servantMilkers == 1) && ($slaves[$i].lactation > 0)>> - <<run App.SlaveAssignment.getMilked($slaves[$i])>> + <<run App.SlaveAssignment.servant(_slave)>> + <<if ($servantMilkers == 1) && (_slave.lactation > 0)>> + <<run App.SlaveAssignment.getMilked(_slave)>> <<set _SQMilk += $milk, _SQMilkSale += $milkSale>> <</if>> - <<run App.SlaveAssignment.choosesOwnClothes($slaves[$i])>> + <<run App.SlaveAssignment.choosesOwnClothes(_slave)>> <<include "SA rules">> <<include "SA diet">> <<include "SA long term effects">> - <<run App.SlaveAssignment.drugs($slaves[$i])>> + <<run App.SlaveAssignment.drugs(_slave)>> <<include "SA relationships">> <<include "SA rivalries">> <<include "SA devotion">> diff --git a/src/uncategorized/slaveAssignmentsReport.tw b/src/uncategorized/slaveAssignmentsReport.tw index 103c5fabf0ad67f5323b3f71ee669a02af97efa8..405c0746ccb4976e83a513fafae1db61bcafae54 100644 --- a/src/uncategorized/slaveAssignmentsReport.tw +++ b/src/uncategorized/slaveAssignmentsReport.tw @@ -6,7 +6,7 @@ /*Spa room*/ <<if $spa > 0>> - <<set $spaSpots = ($spa - $SpaiIDs.length) * 20>> + <<set $spaSpots = ($spa - App.Entity.facilities.spa.employeesIDs().size) * 20>> <<if _S.Attendant>> <<set $spaSpots = Math.trunc($spaSpots * (1 + (_S.Attendant.skill.attendant / 400)))>> /*A skilled attendant improves available space by 25%*/ <</if>> @@ -1062,41 +1062,47 @@ $sexDemandResult.topClass = Math.trunc((($NPCSexSupply.topClass + $slaveJobValue * @todo Figure out why we're using variable space with capitalized facility names when we can parse it from true name */ -<<set _penthouseReportLength = App.Entity.facilities.penthouse.employees().length + $HGSuiteiIDs.length>> +<<set _penthouseReportLength = App.Entity.facilities.penthouse.hostedSlaves + App.Entity.facilities.headGirlSuite.hostedSlaves +>> <<set _facListArr = [ - ["Arcade Report", $arcadeNameCaps, $arcade, $ArcadeiIDs.length, -1, -1], - ["Brothel Report", $brothelNameCaps, $brothel, $BrothiIDs.length, $Madam, "Madam"], - ["Cellblock Report", $cellblockNameCaps, $cellblock, $CellBiIDs.length, $Wardeness, "Wardeness"], - ["Clinic Report", $clinicNameCaps, $clinic, $CliniciIDs.length, $Nurse, "Nurse"], - ["Club Report", $clubNameCaps, $club, $ClubiIDs.length, $DJ, "DJ"], - ["Dairy Report", $dairyNameCaps, $dairy, $DairyiIDs.length, $Milkmaid, "Milkmaid"], - ["Farmyard Report", $farmyardNameCaps, $farmyard, $FarmyardiIDs.length, $Farmer, "Farmer"], - ["Schoolroom Report", $schoolroomNameCaps, $schoolroom, $SchlRiIDs.length, $Schoolteacher, "Schoolteacher"], - ["Spa Report", $spaNameCaps, $spa, $SpaiIDs.length, $AttendantID, "Attendant"], - ["Nursery Report", $nurseryNameCaps, $nurseryNannies, $NurseryiIDs.length, $Matron, "Matron"], - ["Servants' Quarters Report", $servantsQuartersNameCaps, $servantsQuarters, $ServQiIDs.length, $Stewardess, "Stewardess"], - ["Children Report", "Nursery Children", $nursery, $nurseryBabies, -1, -1], - ["Incubator Report", $incubatorNameCaps, $incubator, $incubatorSlaves, -1, -1], - ["Master Suite Report", $masterSuiteNameCaps, $masterSuite, $MastSiIDs.length, $Concubine, "Concubine"], - ["Penthouse Report", "The Penthouse", 1, _penthouseReportLength, -1, -1], - ["Rules Assistant Report", "Rules Assistant", $rulesAssistantAuto, 1, -1, -1] /** should be last — may reassign slaves **/ + ["Arcade Report", App.Entity.facilities.arcade], + ["Brothel Report", App.Entity.facilities.brothel], + ["Cellblock Report", App.Entity.facilities.cellblock], + ["Clinic Report", App.Entity.facilities.clinic], + ["Club Report", App.Entity.facilities.club], + ["Dairy Report", App.Entity.facilities.dairy], + ["Farmyard Report", App.Entity.facilities.farmyard], + ["Schoolroom Report", App.Entity.facilities.schoolroom], + ["Spa Report", App.Entity.facilities.spa], + ["Nursery Report", App.Entity.facilities.nursery], + ["Servants' Quarters Report", App.Entity.facilities.servantsQuarters], + ["Children Report", "Nursery Children", $nursery, $nurseryBabies], + ["Incubator Report", $incubatorNameCaps, $incubator, $incubatorSlaves], + ["Master Suite Report", App.Entity.facilities.masterSuite], + ["Penthouse Report", "The Penthouse", 1, _penthouseReportLength] + ["Rules Assistant Report", "Rules Assistant", $rulesAssistantAuto, 1] /** should be last — may reassign slaves **/ ]>> -<<for _ii = 0; _ii < _facListArr.length; _ii++>> - <<set _facSubArr = _facListArr[_ii], _accText = "", _disTxt = " disabled='disabled'">> /** Chunk the row from our array we're working on to make reading code easier, null some text vars we'll need */ +<<for _facSubArr range _facListArr>> + <<set _accText = "", _disTxt = " disabled='disabled'">> /** Chunk the row from our array we're working on to make reading code easier, null some text vars we'll need */ + <<if typeof _facSubArr[1] == "string">> + <<set _name = _facSubArr[1], _established = _facSubArr[2] > 0, _entriesNumber = _facSubArr[3], _manager = null>> + <<else>> + <<set _name = _facSubArr[1].nameCaps, _established = _facSubArr[1].established, _entriesNumber = _facSubArr[1].hostedSlaves, _manager = _facSubArr[1].manager>> + <</if>> <<set _str = _facSubArr[0].replace(/\W+/g, '-').toLowerCase()>> /** Normalize the passage name to use as an element ID */ - <<if _facSubArr[2] > 0>> /** Do we have one of these facilities? */ + <<if _established>> /** Do we have one of these facilities? */ <<if $useAccordion > 0>> <<set _accText = " accordion", _disTxt = "">> <</if>> /** Is Accordion turned on? */ - <<if (_facSubArr[3] == 0) && (_facSubArr[4] <= 0)>> /** Is there anyone inside the facility? */ - ''_facSubArr[1] Report''<hr style="margin:0"> /** No — it's empty, so we display the heading without a button and with a thinner bar under it */ - @@.gray;_facSubArr[1] is currently empty.@@ + <<if _entriesNumber == 0 && !_manager>> /** Is there anyone inside the facility? */ + ''_name Report''<hr style="margin:0"> /** No — it's empty, so we display the heading without a button and with a thinner bar under it */ + @@.gray;_name is currently empty.@@ <br><br> /** Old code: <<= '<div id="button-' + _str + '" class="unStaffed">' + _facSubArr[1] + ' is currently unstaffed</div>'>> */ <<else>> - <<if _facSubArr[1] == "Rules Assistant">> - <<= '<button type="button"' + _disTxt + ' id="button-' + _str + '" class="buttonBar' + _accText + '" data-after="' + '">' + _facSubArr[1] + ' Report</button>'>> /** Yes, display the bar with information */ + <<if _name == "Rules Assistant">> + <<= '<button type="button"' + _disTxt + ' id="button-' + _str + '" class="buttonBar' + _accText + '" data-after="' + '">' + _name + ' Report</button>'>> /** Yes, display the bar with information */ <<else>> - <<= '<button type="button"' + _disTxt + ' id="button-' + _str + '" class="buttonBar' + _accText + '" data-after="' + _facSubArr[3] + ' slaves in ' + _facSubArr[1] + '">' + _facSubArr[1] + ' Report</button>'>> /** Yes, display the bar with information */ + <<= '<button type="button"' + _disTxt + ' id="button-' + _str + '" class="buttonBar' + _accText + '" data-after="' + _entriesNumber + ' slaves in ' + _name + '">' + _name + ' Report</button>'>> /** Yes, display the bar with information */ <</if>> <<if $useAccordion == 0>> <br> @@ -1110,7 +1116,6 @@ $sexDemandResult.topClass = Math.trunc((($NPCSexSupply.topClass + $slaveJobValue <</if>> </div> <</if>> - <<unset _facSubArr>> <</for>> /* IMPORTANT FOR REASONS!!! */ diff --git a/src/uncategorized/spa.tw b/src/uncategorized/spa.tw index 0b0c95cdaa65706a88657e2f1c43a48993b3d348..b303ae697776f895b4233c47e5cc6666b5d531fd 100644 --- a/src/uncategorized/spa.tw +++ b/src/uncategorized/spa.tw @@ -1,6 +1,6 @@ :: Spa [nobr] -<<set $nextButton = "Back to Main", $nextLink = "Main", $returnTo = "Spa", $showEncyclopedia = 1, $encyclopedia = "Spa">> +<<set _DL = App.Entity.facilities.spa.employeesIDs().size, $nextButton = "Back to Main", $nextLink = "Main", $returnTo = "Spa", $showEncyclopedia = 1, $encyclopedia = "Spa">> <<if $spaName != "the Spa">> <<set $spaNameCaps = $spaName.replace("the ", "The ")>> @@ -75,9 +75,9 @@ It's busy in here. Slaves are relaxing in the warm water, splashing around or just floating. Here and there some of the more sex-starved are in the early stages of intercourse, but most prefer to take time off from it all. <<elseif _spaUtilization > 0>> It's sparsely populated; though the few slaves here have little company they like having the water to themselves. - <<elseif $SpaiIDs.length / $spa > 0.5>> + <<elseif _DL / $spa > 0.5>> It's busy in here. Slaves are relaxing in the warm water, splashing around or just floating. Here and there some of the more sex-starved are in the early stages of intercourse, but most prefer to take time off from it all. - <<elseif $SpaiIDs.length > 0>> + <<elseif _DL > 0>> It's sparsely populated; though the few slaves here have little company they like having the water to themselves. <<elseif _S.Attendant>> <<setLocalPronouns _S.Attendant>> @@ -85,7 +85,7 @@ <<else>> It's empty and quiet. <</if>> - <<if $SpaiIDs.length == 0 && !_S.Attendant>> + <<if _DL == 0 && !_S.Attendant>> <div class="choices" style="font-style:normal"> [[Decommission the Spa|Main][$spa = 0, $spaDecoration = "standard", $spaUpgrade = 0, $spaFix = 0]] </div> @@ -94,7 +94,7 @@ <div> <<set _Tmult0 = Math.trunc($spa*1000*$upgradeMultiplierArcology)>> - $spaNameCaps can house $spa slaves while they recuperate here. There <<if $SpaiIDs.length == 1>>is<<else>>are<</if>> currently $SpaiIDs.length slave<<if $SpaiIDs.length != 1>>s<</if>> recuperating in $spaName. + $spaNameCaps can house $spa slaves while they recuperate here. There <<if _DL == 1>>is<<else>>are<</if>> currently _DL slave<<if _DL != 1>>s<</if>> recuperating in $spaName. <div class="choices"> [[Expand the spa|Spa][cashX(forceNeg(_Tmult0), "capEx"), $spa += 5]] <span class="note"> @@ -102,7 +102,7 @@ </span> </div> <div class="choices"> - <<if $SpaiIDs.length > 0>> + <<if _DL > 0>> <<removeFacilityWorkers "spa" "rest" "rest">> <</if>> </div> diff --git a/src/uncategorized/spaReport.tw b/src/uncategorized/spaReport.tw index c5f0677838c68800983cd2131351736086b88596..6f249933801e47e74112daf37445a59ecc6acbab 100644 --- a/src/uncategorized/spaReport.tw +++ b/src/uncategorized/spaReport.tw @@ -1,7 +1,7 @@ :: Spa Report [nobr] -<<SlaveIDSort $SpaiIDs>> -<<set _DL = $SpaiIDs.length, _SL = $slaves.length, _bonusToggle = 0, _healthBonus = 0, _idleBonus = 0, _restedSlaves = 0, _trustBonus = 0>> +<<set _slaves = App.Utils.sortedEmployees(App.Entity.facilities.spa)>> +<<set _DL = _slaves.length, _SL = $slaves.length, _bonusToggle = 0, _healthBonus = 0, _idleBonus = 0, _restedSlaves = 0, _trustBonus = 0>> <<if $spaDecoration != "standard">> <<set _devBonus = 1>> @@ -80,120 +80,120 @@ <<set _idleBonus++, _healthBonus++>> <</if>> <<set _attendantUsedCure = 0>> - <<for _dI = 0; _dI < _DL; _dI++>> - <<set $i = $slaveIndices[$SpaiIDs[_dI]]>> - <<setLocalPronouns $slaves[$i] 2>> - <<if ($slaves[$i].fetish == "mindbroken") && ($slaves[$i].health.condition > 20) && (_attendantUsedCure == 0) && ($spaFix != 2)>> + <<for _slave range _slaves>> + <<set $i = $slaveIndices[_slave.ID]>> + <<setLocalPronouns _slave 2>> + <<if (_slave.fetish == "mindbroken") && (_slave.health.condition > 20) && (_attendantUsedCure == 0) && ($spaFix != 2)>> <<set _attendantUsedCure = 1>> <<if (random(1,100) > 90-_S.Attendant.devotion)>> - <br> @@.green;Something almost miraculous has happened.@@ _S.Attendant.slaveName has always refused to believe that $slaves[$i].slaveName could not be reached, and has lavished patient tenderness on _him2 in $spaName. $slaves[$i].slaveName has begun to respond, and is stirring from _his2 mental torpor. - <<set $slaves[$i].devotion = -3, $slaves[$i].sexualFlaw = "apathetic", $slaves[$i].behavioralFlaw = either("hates men", "odd"), $slaves[$i].fetish = "none", $slaves[$i].fetishKnown = 1>> - <<set _spr = $genePool.findIndex(function(s) { return s.ID == $slaves[$i].ID; })>> + <br> @@.green;Something almost miraculous has happened.@@ _S.Attendant.slaveName has always refused to believe that _slave.slaveName could not be reached, and has lavished patient tenderness on _him2 in $spaName. _slave.slaveName has begun to respond, and is stirring from _his2 mental torpor. + <<set _slave.devotion = -3, _slave.sexualFlaw = "apathetic", _slave.behavioralFlaw = either("hates men", "odd"), _slave.fetish = "none", _slave.fetishKnown = 1>> + <<set _spr = $genePool.findIndex(function(s) { return s.ID == _slave.ID; })>> <<if $genePool[_spr].intelligence >= -95>> - <<set $slaves[$i].intelligence = $genePool[_spr].intelligence-30>> + <<set _slave.intelligence = $genePool[_spr].intelligence-30>> <</if>> <<if ($arcologies[0].FSPaternalist > 0)>> - Society @@.green;strongly approves@@ of $slaves[$i].slaveName being restored to sanity, which advances ideals about enlightened slaveownership. + Society @@.green;strongly approves@@ of _slave.slaveName being restored to sanity, which advances ideals about enlightened slaveownership. <<set $arcologies[0].FSPaternalist += 0.01*$FSSingleSlaveRep>> - <<run repX(2*$FSSingleSlaveRep*($arcologies[0].FSPaternalist/$FSLockinLevel), "spa", $slaves[$i])>> + <<run repX(2*$FSSingleSlaveRep*($arcologies[0].FSPaternalist/$FSLockinLevel), "spa", _slave)>> <</if>> <</if>> <</if>> <<set _seed = _bonusToggle * 10>> - <<if _bonusToggle == 1 && $slaves[$i].trust < 60>> - <<set $slaves[$i].trust++>> + <<if _bonusToggle == 1 && _slave.trust < 60>> + <<set _slave.trust++>> <</if>> - <<if _S.Attendant.rivalryTarget == $slaves[$i].ID>> - $He constantly harasses $his <<print rivalryTerm(_S.Attendant)>>, $slaves[$i].slaveName, preventing _him2 from getting comfortable and forcing _him2 to keep _his2 guard up. - <<set $slaves[$i].devotion -= 4, $slaves[$i].trust -= 4>> + <<if _S.Attendant.rivalryTarget == _slave.ID>> + $He constantly harasses $his <<print rivalryTerm(_S.Attendant)>>, _slave.slaveName, preventing _him2 from getting comfortable and forcing _him2 to keep _his2 guard up. + <<set _slave.devotion -= 4, _slave.trust -= 4>> <<if random(1,100) > 35>> - <<set _S.Attendant.rivalry++, _S.Attendant.rivalry++, $slaves[$i].rivalry++>> + <<set _S.Attendant.rivalry++, _S.Attendant.rivalry++, _slave.rivalry++>> <</if>> - <<elseif _S.Attendant.relationshipTarget == $slaves[$i].ID>> - $He dedicates most of $his attention to $his <<print relationshipTerm(_S.Attendant)>>, $slaves[$i].slaveName, making _his2 stress, both physical and mental, wash away. - <<set $slaves[$i].devotion += 3, $slaves[$i].trust += 3>> - <<elseif areRelated(_S.Attendant, $slaves[$i])>> - $He makes sure to spend extra time caring for $his <<print relativeTerm(_S.Attendant,$slaves[$i])>>, $slaves[$i].slaveName. - <<set $slaves[$i].trust++>> - <<run improveCondition($slaves[$i], 1)>> + <<elseif _S.Attendant.relationshipTarget == _slave.ID>> + $He dedicates most of $his attention to $his <<print relationshipTerm(_S.Attendant)>>, _slave.slaveName, making _his2 stress, both physical and mental, wash away. + <<set _slave.devotion += 3, _slave.trust += 3>> + <<elseif areRelated(_S.Attendant, _slave)>> + $He makes sure to spend extra time caring for $his <<print relativeTerm(_S.Attendant,_slave)>>, _slave.slaveName. + <<set _slave.trust++>> + <<run improveCondition(_slave, 1)>> <</if>> - <<switch $slaves[$i].prestigeDesc>> + <<switch _slave.prestigeDesc>> <<case "$He is a famed Free Cities whore, and commands top prices.">> - $He does $his best to relax the famous whore, $slaves[$i].slaveName, making sure to - <<if $slaves[$i].vagina > 2 || $slaves[$i].anus > 2>> + $He does $his best to relax the famous whore, _slave.slaveName, making sure to + <<if _slave.vagina > 2 || _slave.anus > 2>> pay special attention to _his2 worn holes. <<else>> get _him2 clean and relaxed for _his2 next usage. <</if>> - <<set $slaves[$i].devotion += 3, $slaves[$i].trust += 3>> + <<set _slave.devotion += 3, _slave.trust += 3>> <<case "$He is a famed Free Cities slut, and can please anyone.">> - $He does $his best to soothe the famous entertainer, $slaves[$i].slaveName, letting _him2 relax in blissful peace. - <<set $slaves[$i].devotion += 3, $slaves[$i].trust += 3>> + $He does $his best to soothe the famous entertainer, _slave.slaveName, letting _him2 relax in blissful peace. + <<set _slave.devotion += 3, _slave.trust += 3>> <<case "$He is remembered for winning best in show as a cockmilker.">> - <<if ($slaves[$i].balls > 6) && ($slaves[$i].dick != 0)>> + <<if (_slave.balls > 6) && (_slave.dick != 0)>> <<if _S.Attendant.fetish == "cumslut">> - $He can't keep $his hand<<if hasBothArms(_S.Attendant)>>s<</if>> off $slaves[$i].slaveName's cock and balls, but _he2 doesn't mind being milked constantly. Before long, strands of cum can be found floating all throughout the bath. + $He can't keep $his hand<<if hasBothArms(_S.Attendant)>>s<</if>> off _slave.slaveName's cock and balls, but _he2 doesn't mind being milked constantly. Before long, strands of cum can be found floating all throughout the bath. <<set _S.Attendant.fetishStrength += 4>> <<else>> - $He does $his best to accommodate $slaves[$i].slaveName's massive genitals and tends to _him2 whenever _he2 feels a need for release. + $He does $his best to accommodate _slave.slaveName's massive genitals and tends to _him2 whenever _he2 feels a need for release. <<if random(1,100) > 65 && _S.Attendant.fetish == "none">> After taking several massive loads to the face, _S.Attendant.slaveName begins to find satisfaction in being coated in cum. <<set _S.Attendant.fetish = "cumslut">> <</if>> <</if>> <</if>> - <<set $slaves[$i].devotion += 3, $slaves[$i].trust += 3>> + <<set _slave.devotion += 3, _slave.trust += 3>> <<case "$He is remembered for winning best in show as a dairy cow.">> - <<if ($slaves[$i].lactation > 0) && (($slaves[$i].boobs-$slaves[$i].boobsImplant) > 6000)>> + <<if (_slave.lactation > 0) && ((_slave.boobs-_slave.boobsImplant) > 6000)>> <<if _S.Attendant.fetish == "boobs">> - $He can't keep $his hand<<if hasBothArms(_S.Attendant)>>s<</if>> off $slaves[$i].slaveName's huge breasts, but _he2 doesn't mind being milked constantly. Before long the bath gains a white tint. + $He can't keep $his hand<<if hasBothArms(_S.Attendant)>>s<</if>> off _slave.slaveName's huge breasts, but _he2 doesn't mind being milked constantly. Before long the bath gains a white tint. <<set _S.Attendant.fetishStrength += 4, _S.Attendant.fetishStrength += 4>> <<else>> - $He does $his best to accommodate $slaves[$i].slaveName's massive breasts and tends to _him2 whenever _he2 feels a need for release. + $He does $his best to accommodate _slave.slaveName's massive breasts and tends to _him2 whenever _he2 feels a need for release. <<if random(1,100) > 65 && _S.Attendant.fetish == "none">> After multiple milking sessions, _S.Attendant.slaveName begins to find $himself fantasizing about having giant milky breasts too. <<set _S.Attendant.fetish = "boobs">> <</if>> <</if>> - <<set $slaves[$i].devotion += 3, $slaves[$i].trust += 3, $slaves[$i].lactationDuration = 2, $slaves[$i].boobs -= $slaves[$i].boobsMilk, $slaves[$i].boobsMilk = 0>> + <<set _slave.devotion += 3, _slave.trust += 3, _slave.lactationDuration = 2, _slave.boobs -= _slave.boobsMilk, _slave.boobsMilk = 0>> <</if>> <<case "$He is remembered for winning best in show as a breeder.">> - <<if $slaves[$i].bellyPreg >= 5000>> + <<if _slave.bellyPreg >= 5000>> <<if _S.Attendant.fetish == "pregnancy">> - $He can't keep $his hand<<if hasBothArms(_S.Attendant)>>s<</if>> off $slaves[$i].slaveName's pregnancy, but _he2 doesn't mind _his2 full belly being fondled. + $He can't keep $his hand<<if hasBothArms(_S.Attendant)>>s<</if>> off _slave.slaveName's pregnancy, but _he2 doesn't mind _his2 full belly being fondled. <<set _S.Attendant.fetishStrength += 4, _S.Attendant.fetishStrength += 4>> <<else>> - $He does $his best to accommodate $slaves[$i].slaveName's pregnancy and to make sure the mother-to-be is happy and comfortable. + $He does $his best to accommodate _slave.slaveName's pregnancy and to make sure the mother-to-be is happy and comfortable. <<if random(1,100) > 65 && _S.Attendant.fetish == "none">> - After massaging $slaves[$i].slaveName's growing belly multiple times, _S.Attendant.slaveName begins to find $himself fantasizing about being swollen with life too. + After massaging _slave.slaveName's growing belly multiple times, _S.Attendant.slaveName begins to find $himself fantasizing about being swollen with life too. <<set _S.Attendant.fetish = "pregnancy">> <</if>> <</if>> - <<set $slaves[$i].devotion += 3, $slaves[$i].trust += 3>> + <<set _slave.devotion += 3, _slave.trust += 3>> <<else>> <<if _S.Attendant.fetish == "pregnancy">> - $He can't help but pester $slaves[$i].slaveName with questions about _his2 famous pregnancy, limiting _his2 ability to truly relax. - <<set $slaves[$i].devotion += 1, $slaves[$i].trust += 1>> - <<elseif canGetPregnant($slaves[$i])>> - $He does $his best to encourage $slaves[$i].slaveName's fertilization by performing any fertility boosting actions $he can. - <<set $slaves[$i].devotion += 3, $slaves[$i].trust += 3>> + $He can't help but pester _slave.slaveName with questions about _his2 famous pregnancy, limiting _his2 ability to truly relax. + <<set _slave.devotion += 1, _slave.trust += 1>> + <<elseif canGetPregnant(_slave)>> + $He does $his best to encourage _slave.slaveName's fertilization by performing any fertility boosting actions $he can. + <<set _slave.devotion += 3, _slave.trust += 3>> <</if>> <</if>> <</switch>> <<if (_S.Attendant.intelligence+_S.Attendant.intelligenceImplant > 15) && (_attendantUsedCure == 0) && ((_S.Attendant.intelligence+_S.Attendant.intelligenceImplant)+_seed) > random(1,200) && ($spaFix == 0)>> - <<if $slaves[$i].behavioralFlaw != "none">> - <<run SoftenBehavioralFlaw($slaves[$i])>> + <<if _slave.behavioralFlaw != "none">> + <<run SoftenBehavioralFlaw(_slave)>> <<set _attendantUsedCure += 1>> - <br> _S.Attendant.slaveName works carefully with $slaves[$i].slaveName, and successfully @@.green;softens _his2 behavioral flaw@@ into an appealing quirk. - <<elseif $slaves[$i].sexualFlaw != "none">> - <<run SoftenSexualFlaw($slaves[$i])>> + <br> _S.Attendant.slaveName works carefully with _slave.slaveName, and successfully @@.green;softens _his2 behavioral flaw@@ into an appealing quirk. + <<elseif _slave.sexualFlaw != "none">> + <<run SoftenSexualFlaw(_slave)>> <<set _attendantUsedCure += 1>> - <br> _S.Attendant.slaveName works carefully with $slaves[$i].slaveName, and successfully @@.green;softens _his2 sexual flaw@@ into an appealing quirk. + <br> _S.Attendant.slaveName works carefully with _slave.slaveName, and successfully @@.green;softens _his2 sexual flaw@@ into an appealing quirk. <</if>> <</if>> - <<if $slaves[$i].lactation > 0>> - _S.Attendant.slaveName takes care to keep $slaves[$i].slaveName's breasts comfortably drained. - <<set $slaves[$i].lactationDuration = 2, $slaves[$i].boobs -= $slaves[$i].boobsMilk, $slaves[$i].boobsMilk = 0>> + <<if _slave.lactation > 0>> + _S.Attendant.slaveName takes care to keep _slave.slaveName's breasts comfortably drained. + <<set _slave.lactationDuration = 2, _slave.boobs -= _slave.boobsMilk, _slave.boobsMilk = 0>> <</if>> <</for>> <<if (_DL < $spa)>> @@ -227,25 +227,25 @@ </div> <</if>> /* 000-250-006 */ - <span class='slave-name'><<= SlaveFullName($slaves[$i])>></span> is serving as the Attendant in $spaName. + <span class='slave-name'><<= SlaveFullName(_S.Attendant)>></span> is serving as the Attendant in $spaName. <br> - <<= App.SlaveAssignment.choosesOwnClothes($slaves[$i])>> - <<run tired($slaves[$i])>> + <<= App.SlaveAssignment.choosesOwnClothes(_S.Attendant)>> + <<run tired(_S.Attendant)>> <<include "SA rules">> <<include "SA diet">> <<include "SA long term effects">> - <<= App.SlaveAssignment.drugs($slaves[$i])>> + <<= App.SlaveAssignment.drugs(_S.Attendant)>> <<include "SA relationships">> <<include "SA rivalries">> <br><<include "SA devotion">> <<else>> <<silently>> - <<run App.SlaveAssignment.choosesOwnClothes($slaves[$i])>> - <<run tired($slaves[$i])>> + <<run App.SlaveAssignment.choosesOwnClothes(_S.Attendant)>> + <<run tired(_S.Attendant)>> <<include "SA rules">> <<include "SA diet">> <<include "SA long term effects">> - <<run App.SlaveAssignment.drugs($slaves[$i])>> + <<run App.SlaveAssignment.drugs(_S.Attendant)>> <<include "SA relationships">> <<include "SA rivalries">> <<include "SA devotion">> @@ -253,57 +253,57 @@ <</if>> <</if>> -<<for _dI = 0; _dI < _DL; _dI++>> - <<set $i = $slaveIndices[$SpaiIDs[_dI]]>> - <<setLocalPronouns $slaves[$i]>> - <<set $slaves[$i].devotion += _devBonus, $slaves[$i].trust += _trustBonus>> - <<run improveCondition($slaves[$i], 5 + _healthBonus)>> - <<if ($slaves[$i].health.condition < -80)>> - <<run improveCondition($slaves[$i], 15)>> - <<elseif $slaves[$i].health.condition < -40>> - <<run improveCondition($slaves[$i], 10)>> - <<elseif $slaves[$i].health.condition < 0>> - <<run improveCondition($slaves[$i], 5)>> +<<for _slave range _slaves>> + <<set $i = $slaveIndices[_slave.ID]>> + <<setLocalPronouns _slave>> + <<set _slave.devotion += _devBonus, _slave.trust += _trustBonus>> + <<run improveCondition(_slave, 5 + _healthBonus)>> + <<if (_slave.health.condition < -80)>> + <<run improveCondition(_slave, 15)>> + <<elseif _slave.health.condition < -40>> + <<run improveCondition(_slave, 10)>> + <<elseif _slave.health.condition < 0>> + <<run improveCondition(_slave, 5)>> <</if>> - <<if ($spaUpgrade == 1) && ($slaves[$i].health.condition < 100)>> - <<run improveCondition($slaves[$i], normalRandInt(8))>> + <<if ($spaUpgrade == 1) && (_slave.health.condition < 100)>> + <<run improveCondition(_slave, normalRandInt(8))>> <</if>> - <<if ($slaves[$i].devotion < 60) && ($slaves[$i].trust < 60)>> - <<set $slaves[$i].devotion++, $slaves[$i].trust++>> - <<elseif ($slaves[$i].trust < 40)>> - <<set $slaves[$i].trust += 10>> - <<elseif ($slaves[$i].devotion < 40)>> - <<set $slaves[$i].devotion += 10>> + <<if (_slave.devotion < 60) && (_slave.trust < 60)>> + <<set _slave.devotion++, _slave.trust++>> + <<elseif (_slave.trust < 40)>> + <<set _slave.trust += 10>> + <<elseif (_slave.devotion < 40)>> + <<set _slave.devotion += 10>> <</if>> <<switch $spaDecoration>> <<case "Chattel Religionist" "Chinese Revivalist">> - <<set $slaves[$i].rules.living = "normal">> + <<set _slave.rules.living = "normal">> <<case "Degradationist">> - <<set $slaves[$i].rules.living = "spare">> + <<set _slave.rules.living = "spare">> <<default>> - <<set $slaves[$i].rules.living = "luxurious">> + <<set _slave.rules.living = "luxurious">> <</switch>> - <<if ($slaves[$i].health.condition >= 20) && ($slaves[$i].health.tired < 20) && ($slaves[$i].trust > 60) && ($slaves[$i].devotion > 60) && ($slaves[$i].fetish != "mindbroken") && ($slaves[$i].sexualFlaw == "none") && ($slaves[$i].behavioralFlaw == "none")>> + <<if (_slave.health.condition >= 20) && (_slave.health.tired < 20) && (_slave.trust > 60) && (_slave.devotion > 60) && (_slave.fetish != "mindbroken") && (_slave.sexualFlaw == "none") && (_slave.behavioralFlaw == "none")>> <p> - <span class="slave-name">$slaves[$i].slaveName</span> is feeling well enough to leave $spaName, + <span class="slave-name">_slave.slaveName</span> is feeling well enough to leave $spaName, <span class="noteworthy"> - <<if $assignmentRecords[$slaves[$i].ID]>> - <<set _oldJob = $assignmentRecords[$slaves[$i].ID]>> - <<= assignJobSafely($slaves[$i], _oldJob)>> - <<if $slaves[$i].choosesOwnAssignment === 1>> + <<if $assignmentRecords[_slave.ID]>> + <<set _oldJob = $assignmentRecords[_slave.ID]>> + <<= assignJobSafely(_slave, _oldJob)>> + <<if _slave.choosesOwnAssignment === 1>> and $he is resting before choosing another task. - <<elseif $slaves[$i].assignment === "rest">> + <<elseif _slave.assignment === "rest">> <<if _oldJob != "rest">> and since $he was unable to return to $his old task to <<print _oldJob>>, $his assignment has defaulted to rest. <<else>> so $he has returned to rest. <</if>> <<else>> - so $he goes back to <<print $slaves[$i].assignment>>. + so $he goes back to <<print _slave.assignment>>. <</if>> <<else>> so $his assignment has defaulted to rest. - <<= removeJob($slaves[$i], "rest in the spa")>> + <<= removeJob(_slave, "rest in the spa")>> <</if>> </span> </p> @@ -315,44 +315,44 @@ /* 000-250-006 */ <<if $seeImages && $seeReportImages>> <div class="imageRef smlImg"> - <<= SlaveArt($slaves[$i], 0, 0)>> + <<= SlaveArt(_slave, 0, 0)>> </div> <</if>> /* 000-250-006 */ - <span class='slave-name'><<= SlaveFullName($slaves[$i])>></span> - <<if $slaves[$i].choosesOwnAssignment == 2>> + <span class='slave-name'><<= SlaveFullName(_slave)>></span> + <<if _slave.choosesOwnAssignment == 2>> <<include "SA chooses own job">> <<else>> is resting in $spaName. <</if>> - <br> $He <<= App.SlaveAssignment.rest($slaves[$i])>> - <<if ($slaves[$i].fetish == "mindbroken")>> + <br> $He <<= App.SlaveAssignment.rest(_slave)>> + <<if (_slave.fetish == "mindbroken")>> $He remains in the Spa, completely mindbroken. - <<elseif($slaves[$i].sexualFlaw != "none") || ($slaves[$i].behavioralFlaw != "none")>> + <<elseif(_slave.sexualFlaw != "none") || (_slave.behavioralFlaw != "none")>> $He remains in the Spa, stubborn in $his flaw. - <<elseif ($slaves[$i].trust < 60) || ($slaves[$i].devotion < 60)>> + <<elseif (_slave.trust < 60) || (_slave.devotion < 60)>> $He remains in the Spa, as $he is still learning to accept life as a slave. - <<elseif ($slaves[$i].health.condition < 20)>> + <<elseif (_slave.health.condition < 20)>> $He remains in the Spa, as $he is benefiting from its healing properties. <</if>> <br> - <<= App.SlaveAssignment.choosesOwnClothes($slaves[$i])>> + <<= App.SlaveAssignment.choosesOwnClothes(_slave)>> <<include "SA rules">> <<include "SA diet">> <<include "SA long term effects">> - <<= App.SlaveAssignment.drugs($slaves[$i])>> + <<= App.SlaveAssignment.drugs(_slave)>> <<include "SA relationships">> <<include "SA rivalries">> <br><<include "SA devotion">> <<else>> <<silently>> <<include "SA chooses own job">> - <<run App.SlaveAssignment.choosesOwnClothes($slaves[$i])>> - <<run App.SlaveAssignment.rest($slaves[$i])>> + <<run App.SlaveAssignment.choosesOwnClothes(_slave)>> + <<run App.SlaveAssignment.rest(_slave)>> <<include "SA rules">> <<include "SA diet">> <<include "SA long term effects">> - <<run App.SlaveAssignment.drugs($slaves[$i])>> + <<run App.SlaveAssignment.drugs(_slave)>> <<include "SA relationships">> <<include "SA rivalries">> <<include "SA devotion">> diff --git a/src/utility/birthWidgets.tw b/src/utility/birthWidgets.tw index f25fefd6d25b6bb3577b6fdbed8131f8bff8f058..89bc38f44955ea95687a2a3729863d13a8db4e71 100644 --- a/src/utility/birthWidgets.tw +++ b/src/utility/birthWidgets.tw @@ -378,7 +378,7 @@ $He waddles to $his maternity ward and strips before laying on an open bed. $He makes $himself comfortable and begins working on birthing $his bab<<if $slaves[$i].pregType > 1>>ies<<else>>y<</if>> as $his assistants watch. $His child<<if $slaves[$i].pregType > 1>>ren are<<else>> is<</if>> promptly taken and $he is helped to the recovery ward until $he recovers enough to take over $clinicName again. <<case "be your Head Girl">> -<<set _HGL = $HGSuiteiIDs.length>> +<<set _HGL = App.Entity.facilities.headGirlSuite.hostedSlaves>> $He returns to <<if $HGSuite == 1>>$his room's bed<<else>>$his bed<</if>> and strips before slipping into it. $He makes $himself comfortable<<if _HGL != 0>> as $his slave rushes to $his side,<</if>> and begins working on birthing $his bab<<if $slaves[$i].pregType > 1>>ies<<else>>y<</if>>. $His child<<if $slaves[$i].pregType > 1>>ren are<<else>> is<</if>> promptly taken<<if _HGL != 0>> by $his roommate<</if>> and $he rests awhile before returning to managing your slaves. <<case "guard you">>