diff --git a/src/endWeek/healthFunctions.js b/src/endWeek/healthFunctions.js index 038b065e26b669ca2c2a8ab314197167c2d3036f..f2fb12898520dd23a7470bc29d510b6c98fd1cd3 100644 --- a/src/endWeek/healthFunctions.js +++ b/src/endWeek/healthFunctions.js @@ -245,11 +245,11 @@ window.tired = function tired(slave) { // Run at the end of the week to take car if (V.Attendant !== 0) { assignment -= Math.trunc(V.Attendant.skill.attendant / 10); // Maximum of 10 extra points of negative tiredness due to attendant skill } - } else if (slave.assignment === "be confined in the arcade") { - assignment += normalRandInt(15, 2); // Increases tired by an average of 15 points while on an overwhelmingly demanding assignment - } else if (slave.assignment === "work a glory hole" || slave.assignment === "work as a farmhand") { + } else if (slave.assignment === "whore" || slave.assignment === "work in the brothel" || slave.assignment === "work a glory hole" || slave.assignment === "be confined in the arcade" || slave.assignment === "serve the public" || slave.assignment === "serve in the club") { + assignment += 0; // These assignments get their tiredness increase from tiredFucks() + } else if (slave.assignment === "work as a farmhand") { assignment += normalRandInt(10, 2); // Increases tired by an average of 10 points while on a very demanding assignment - } else if (slave.assignment === "whore" || slave.assignment === "be a servant" || slave.assignment === "serve the public" || slave.assignment === "work in the brothel" || slave.assignment === "serve in the club" || slave.assignment === "work as a servant") { + } else if (slave.assignment === "be a servant") { assignment += normalRandInt(5); // Increases tired by an average of 5 points while on a demanding assignment } else if (slave.assignment === "be your agent" || slave.assignment === "live with your agent") { assignment -= normalRandInt(15, 2); // Making sure agents don't get exhausted, surely they can afford to do some relaxing @@ -319,6 +319,10 @@ window.tired = function tired(slave) { // Run at the end of the week to take car } }; +/** + * @param {App.Entity.SlaveState} slave + * @returns {void} + */ window.tiredFucks = function tiredFucks(slave) { - slave.health.tired += Math.trunc(slave.sexAmount / 25); + slave.health.tired += Math.trunc(slave.sexAmount * (1 + normalRandInt(0, 5) / 100) / 25); }; diff --git a/src/js/economyJS.js b/src/js/economyJS.js index 8db8e1c1d8faf6b0dea9d515f17c8d9c27483462..0d28ca91da540378e29aced3dd34c23c05b57576 100644 --- a/src/js/economyJS.js +++ b/src/js/economyJS.js @@ -1226,6 +1226,7 @@ window.slaveJobValues = function(lowerClassSexDemandRef, middleClassSexDemandRef V.JobIDArray["work a glory hole"].forEach(ID => { const s = V.slaves[V.slaveIndices[ID]]; s.sexAmount = Math.trunc((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; }); @@ -1233,6 +1234,7 @@ window.slaveJobValues = function(lowerClassSexDemandRef, middleClassSexDemandRef V.ArcadeiIDs.forEach(ID => { const s = V.slaves[V.slaveIndices[ID]]; 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)); + tiredFucks(s); slaveJobValues.arcade += s.sexAmount; }); @@ -1422,6 +1424,9 @@ window.slaveJobValues = function(lowerClassSexDemandRef, middleClassSexDemandRef } s.sexAmount = Math.trunc(s.sexAmount * beautyMultiplier); + // The effect of sexual acts on tiredness + tiredFucks(s); + // The quality/value of each sexual act s.sexQuality = FResult(s); if (!App.Utils.hasNonassignmentSex(s) && s.rules.reward !== "orgasm" && s.energy >= 20) { @@ -1634,9 +1639,11 @@ window.slaveJobValues = function(lowerClassSexDemandRef, middleClassSexDemandRef // whoreClass is the MAXIMUM player set class the whore is allowed to service, if the whore is not eligable it will service the highest it is capable of servicing properly. A whoreClass of 0 means it is on auto (always service the highest possible class). function whoreScore(s, lowerClassSexDemandRef, middleClassSexDemandRef, upperClassSexDemandRef, topClassSexDemandRef) { let income = s.sexAmount * s.sexQuality; + const initialHealthPenalty = healthPenalty(s); s.effectiveWhoreClass = effectiveWhoreClass(s); s.maxWhoreClass = s.effectiveWhoreClass; - income *= healthPenalty(s); + income *= initialHealthPenalty; + // Automatically changing effectiveWhoreClass // what is the initial effective whore class? Are we providing more sex than overal demand? Is the ratio of supply/demand for this tier higher than the one below it? @@ -1662,18 +1669,34 @@ window.slaveJobValues = function(lowerClassSexDemandRef, middleClassSexDemandRef // Calculate the stats if (s.effectiveWhoreClass === 4) { s.sexAmount = Math.clamp(Math.trunc(s.sexAmount * (1/3)), normalRandInt(30, 2), normalRandInt(60, 3)); // Bringing sex amount into the desired range. Beauty improves use amount between values of aprox. 90 and 180. + tiredFucks(s); // adding tiredness based on number of fucks and then adjusting income in case the tiredness penalty changed as a result. + if (healthPenalty(s) < initialHealthPenalty) { + income *= healthPenalty(s) / initialHealthPenalty; + } s.sexQuality = Math.min(Math.trunc(Math.min((income * 1.2) / s.sexAmount, V.whoreBudget.topClass * 0.2)), Math.trunc(V.whoreBudget.topClass * (1/3))); // Adjusting the price to the correct sex amount with 20% bonus for being of the highest tier. The top class will pay a maximum of 33% of their weekly budget per service. slaveJobValues.brothel.topClass += Math.trunc(Math.min(s.sexAmount * s.sexQuality, s.sexAmount * V.whoreBudget.topClass * 0.2)); // Registering the job value in the right slot } else if (s.effectiveWhoreClass === 3) { s.sexAmount = Math.clamp(Math.trunc(s.sexAmount * (2/3)), normalRandInt(40, 3), normalRandInt(80, 3)); // Beauty improves use amount between values of aprox. 60 and 120. + tiredFucks(s); + if (healthPenalty(s) < initialHealthPenalty) { + income *= healthPenalty(s) / initialHealthPenalty; + } s.sexQuality = Math.min(Math.trunc((income * 1.05) / s.sexAmount), V.whoreBudget.upperClass * 0.5); // The upper class will pay a maximum of 50% of their weekly budget per service slaveJobValues.brothel.upperClass += Math.trunc(Math.min(s.sexAmount * s.sexQuality, s.sexAmount * V.whoreBudget.upperClass * 0.6)); } else if (s.effectiveWhoreClass === 2) { s.sexAmount = Math.clamp(Math.trunc(s.sexAmount * 1.25), normalRandInt(50, 3), normalRandInt(120, 3)); // Beauty improves use amount between values of aprox. 40 and 96. + tiredFucks(s); + if (healthPenalty(s) < initialHealthPenalty) { + income *= healthPenalty(s) / initialHealthPenalty; + } s.sexQuality = Math.min(Math.trunc((income * 0.9) / s.sexAmount), V.whoreBudget.middleClass); // The middle class will pay a maximum of 125% of their weekly budget per service slaveJobValues.brothel.middleClass += Math.trunc(Math.min(s.sexAmount * s.sexQuality, s.sexAmount * V.whoreBudget.middleClass * 1.25)); } else { s.sexAmount = Math.clamp(s.sexAmount * 2, normalRandInt(60, 3), normalRandInt(150, 3)); // Beauty improves use amount between values of approx. 30 and 75. + tiredFucks(s); + if (healthPenalty(s) < initialHealthPenalty) { + income *= healthPenalty(s) / initialHealthPenalty; + } s.sexQuality = Math.clamp(Math.trunc((income * 0.75) / s.sexAmount), 2, V.whoreBudget.lowerClass * 3); // The lower class will pay a maximum of 300% of their weekly budget per service and a minimum of 2 slaveJobValues.brothel.lowerClass += Math.trunc(Math.min(s.sexAmount * s.sexQuality, s.sexAmount * V.whoreBudget.lowerClass * 3)); }