diff --git a/src/endWeek/saSharedVariables.js b/src/endWeek/saSharedVariables.js index dce35fec271d5fd534abd96b96af81fff0333a07..67d1dbc0bd714ee11f025a500e93f50f432e4b42 100644 --- a/src/endWeek/saSharedVariables.js +++ b/src/endWeek/saSharedVariables.js @@ -26,10 +26,6 @@ App.EndWeek.SASharedVariables = class { this.freeSexualEnergy = 0; /** How big is the average dick on a slave? */ this.averageDick = 0; - /** Why was the madam fired this week? */ - this.unMadam = 0; - /** Why was the DJ fired this week? */ - this.unDJ = 0; /** Who are your subordinate slaves actually assigned to? * @type {Map<number, Array<number>>} - key is sub target, value is list of sub slaves (by ID) assigned to that target */ diff --git a/src/endWeek/sexualServices.js b/src/endWeek/sexualServices.js index 8b23262f427fe1bdd586b8a2116a5879047048c9..5db92e5c7b73c1898bedbfd1c7de738535d81f8b 100644 --- a/src/endWeek/sexualServices.js +++ b/src/endWeek/sexualServices.js @@ -309,8 +309,7 @@ App.EndWeek.computeSexualServicesModel = function(renderContainer) { * @param {ParentNode} c */ function _printDebugInfo(c) { - c.append(document.createElement("br")); - c.append("Slave services supply and demand this week:"); + App.UI.DOM.appendNewElement("div", c, "Slave services supply and demand this week:"); const table = App.UI.DOM.appendNewElement("table", c, null, "finance"); table.style.border = "1"; diff --git a/src/endWeek/slaveAssignmentReport.js b/src/endWeek/slaveAssignmentReport.js index e51c6c9832e072a8245d48e63de851c1663dd193..66e04ff3a7434370cd096d808e27c48e8f3cbc2c 100644 --- a/src/endWeek/slaveAssignmentReport.js +++ b/src/endWeek/slaveAssignmentReport.js @@ -2,9 +2,6 @@ App.EndWeek.slaveAssignmentReport = function() { const facilities = App.Entity.facilities; const arcology = V.arcologies[0]; - // V.nextLink = "Economics"; - // V.nextButton = "Continue"; - const initialEmployeesCount = App.Utils.countFacilityWorkers(); // will be used to show differences after all the assignment changes const initialPenthouseTotalEmployeesCount = _countPenthousePopulation(); @@ -19,20 +16,6 @@ App.EndWeek.slaveAssignmentReport = function() { } } - /** silent pass for any reassignments before generating reports */ - for (const slave of V.slaves) { - if (slave.choosesOwnAssignment === 1) { - App.SlaveAssignment.choosesOwnJob(slave); - } - } - - const res = document.createDocumentFragment(); - - App.EndWeek.computeSexualServicesModel(res); - - res.appendChild(document.createElement("br")); - res.appendChild(document.createElement("br")); - const skillsToTest = { whoring: "whore", entertainment: "entertain", @@ -41,7 +24,9 @@ App.EndWeek.slaveAssignmentReport = function() { oral: "oral" }; - let slavesWithWorkingDicks = 0; + const res = document.createDocumentFragment(); + + /* perform reassignments before generating reports */ for (const slave of V.slaves) { for (const sk in skillsToTest) { if (_.isNil(slave.skill[sk])) { @@ -50,6 +35,19 @@ App.EndWeek.slaveAssignmentReport = function() { } } + // fire unqualified special slaves + _ensureEmployeeMeetsJobRequirements(slave); + + // first pass on choosesOwnJob is silent + if (slave.choosesOwnAssignment === 1) { + App.SlaveAssignment.choosesOwnJob(slave); + } + } + + App.EndWeek.computeSexualServicesModel(res); + + let slavesWithWorkingDicks = 0; + for (const slave of V.slaves) { if ((V.seeDicks > 0) && canPenetrate(slave) && App.Utils.hasNonassignmentSex(slave)) { App.EndWeek.saVars.averageDick += slave.dick; slavesWithWorkingDicks++; @@ -59,8 +57,6 @@ App.EndWeek.slaveAssignmentReport = function() { slave.lactationDuration--; } - _ensureEmployeeMeetsJobRequirements(slave); // this can fire special slaves - switch (slave.assignment) { case Job.HEADGIRLSUITE: if (slave.devotion >= random(-30, 20)) { @@ -334,8 +330,8 @@ App.EndWeek.slaveAssignmentReport = function() { if (stats.entriesNumber > 0) { App.UI.DOM.appendNewElement("span", header, `${stats.entriesNumber}${diffText} slave${stats.entriesNumber !== 1 ? "s" : ""} ${ - stats.manager && stats.manager.currentEmployee ? `and ${capFirstChar( - stats.manager.desc.position)}` : "" + stats.manager && stats.manager.currentEmployee ? + `and ${capFirstChar(stats.manager.desc.position)}` : "" } in ${stats.name}`, ["info", "green"]); } else if (stats.manager && stats.manager.currentEmployee) { App.UI.DOM.appendNewElement("span", header, @@ -435,36 +431,48 @@ App.EndWeek.slaveAssignmentReport = function() { } break; case Job.MADAM: - if (App.EndWeek.saVars.unMadam === 1) { + if (!canTalk(slave)) { _printSlaveUnassignedNote(slave, "can't give whores verbal orders"); - } else if (App.EndWeek.saVars.unMadam === 2) { + V.MadamID = 0; + } else if (slave.preg > 37 && slave.broodmother === 2) { _printSlaveUnassignedNote(slave, "spends so much time giving birth and laboring that", `${getPronouns(slave).he} cannot effectively serve as your Madam any longer`); - } else if (App.EndWeek.saVars.unMadam === 3) { + V.MadamID = 0; + } else if (slave.fetish === "mindbroken") { _printSlaveUnassignedNote(slave, "is mindbroken"); - } else if (App.EndWeek.saVars.unMadam === 4) { + V.MadamID = 0; + } else if (!canWalk(slave)) { _printSlaveUnassignedNote(slave, "is no longer independently mobile"); - } else if (App.EndWeek.saVars.unMadam === 5) { + V.MadamID = 0; + } else if (!canSee(slave)) { _printSlaveUnassignedNote(slave, "can no longer see"); - } else if (App.EndWeek.saVars.unMadam === 6) { + V.MadamID = 0; + } else if (!canHear(slave)) { _printSlaveUnassignedNote(slave, "can no longer hear"); - } else if (App.EndWeek.saVars.unMadam === 7) { + V.MadamID = 0; + } else if (!canHold(slave)) { _printSlaveUnassignedNote(slave, `can no longer handle ${getPronouns(slave).his} underlings`); + V.MadamID = 0; } if (V.MadamID === 0) { removeJob(slave, Job.MADAM); } break; case Job.DJ: - if (App.EndWeek.saVars.unDJ === 1) { + if (!canTalk(slave)) { _printSlaveUnassignedNote(slave, "can't speak"); - } else if (App.EndWeek.saVars.unDJ === 2) { + V.djID = 0; + } else if (slave.preg > 37 && slave.broodmother === 2) { _printSlaveUnassignedNote(slave, "spends so much time giving birth and laboring that", `${getPronouns(slave).he} cannot effectively serve as your DJ any longer`); - } else if (App.EndWeek.saVars.unDJ === 3) { + V.djID = 0; + } else if (slave.fetish === "mindbroken") { _printSlaveUnassignedNote(slave, "is mindbroken"); - } else if (App.EndWeek.saVars.unDJ === 4) { + V.djID = 0; + } else if (!canWalk(slave)) { _printSlaveUnassignedNote(slave, "is no longer independently mobile"); - } else if (App.EndWeek.saVars.unDJ === 5) { + V.djID = 0; + } else if (!canHear(slave)) { _printSlaveUnassignedNote(slave, "can no longer hear"); + V.djID = 0; } if (V.djID === 0) { removeJob(slave, Job.DJ); diff --git a/src/js/economyJS.js b/src/js/economyJS.js index c9598e0107891f79c516ee4047b67357ef51622e..43a99301566eb0762cc5956c5bb69eb59b3a3ed9 100644 --- a/src/js/economyJS.js +++ b/src/js/economyJS.js @@ -1410,25 +1410,7 @@ globalThis.slaveJobValues = function(lowerClassSexDemandRef, middleClassSexDeman slaveJobValues.arcade += (V.fuckdolls - (V.arcade - AL)) * 150 + (V.arcade - AL) * (200 + 20 * V.arcadeUpgradeInjectors); } - // Accounting for the DJ. - if (S.DJ) { - if (!canTalk(S.DJ)) { - V.djID = 0; - V.unDJ = 1; - } else if (S.DJ.preg > 37 && S.DJ.broodmother === 2) { - V.djID = 0; - V.unDJ = 2; - } else if (S.DJ.fetish === "mindbroken") { - V.djID = 0; - V.unDJ = 3; - } else if (!canWalk(S.DJ)) { - V.djID = 0; - V.unDJ = 4; - } else if (!canHear(S.DJ)) { - V.djID = 0; - V.unDJ = 5; - } - } + // Accounting for the DJ if (S.DJ) { // The DJ adding to 'club' SJVClub(S.DJ); @@ -1440,31 +1422,6 @@ globalThis.slaveJobValues = function(lowerClassSexDemandRef, middleClassSexDeman } // Accounting for the Madam - if (V.MadamID !== 0) { - const madam = S.Madam; - if (!canTalk(madam)) { - V.MadamID = 0; - V.unMadam = 1; - } else if (madam.preg > 37 && madam.broodmother === 2) { - V.MadamID = 0; - V.unMadam = 2; - } else if (madam.fetish === "mindbroken") { - V.MadamID = 0; - V.unMadam = 3; - } else if (!canWalk(madam)) { - V.MadamID = 0; - V.unMadam = 4; - } else if (!canSee(madam)) { - V.MadamID = 0; - V.unMadam = 5; - } else if (!canHear(madam)) { - V.MadamID = 0; - V.unMadam = 6; - } else if (!canHold(madam)) { - V.MadamID = 0; - V.unMadam = 7; - } - } if (V.MadamID !== 0) { const madam = S.Madam; const madamIntel = madam.intelligence + madam.intelligenceImplant;