diff --git a/src/endWeek/healthFunctions.js b/src/endWeek/healthFunctions.js index 67df7a923975d3d2341b90ee1c759e410c287ada..fa68975f0b9038b52116dc1bf2cb3bb2a7b4f4cf 100644 --- a/src/endWeek/healthFunctions.js +++ b/src/endWeek/healthFunctions.js @@ -481,18 +481,15 @@ window.tired = function tired(slave) { assignment += 20; } } else if (["serve in the club", "serve the public", "whore", "work in the brothel"].includes(slave.assignment)) { // Moderate assignments - if (!willWorkToDeath(slave)) { - if (slave.tired > 90) { - assignment += 1; - } else if (slave.tired > 70) { - assignment += 7; - } + if (slaveResting(slave)) { + assignment -= 20; + V.slaveUsedRest = 1; + } else if (slave.tired + 15 >= 90 && !willWorkToDeath(slave)) { + assignment += 1; + } else if (slave.devotion > 20) { + assignment += 10; } else { - if (slave.devotion > 20) { - assignment += 10; - } else { - assignment += 15; - } + assignment += 15; } } else if (["serve in the master suite", "please you", "be a servant"].includes(slave.assignment)) { // Easy assignments if (slave.tired > 75) { @@ -649,11 +646,10 @@ window.restEffects = function restEffects(slave, exhaustion) { return .25; } else if (slave.tired + exhaustion >= 90 && !willWorkToDeath(slave)) { return .10; - } else if (slave.tired > 90 && slave.assignment !== "work a glory hole") { - return .75; + } else { + return healthPenalty(slave); } } - return 1; }; /** diff --git a/src/endWeek/saWorkAGloryHole.js b/src/endWeek/saWorkAGloryHole.js index 6b4a2db418828f10ed8e2068109ef77e12510047..e6cb7614f78a82ffae0150d9812e99799d16a5bc 100644 --- a/src/endWeek/saWorkAGloryHole.js +++ b/src/endWeek/saWorkAGloryHole.js @@ -175,7 +175,7 @@ window.saWorkAGloryHole = (function saWorkAGloryHole() { r += ` ${He} attempts to refuse work due to ${his} exhaustion, but can do little to stop it or the resulting <span class="trust dec">severe punishment.</span> ${He} <span class="devotion dec">purposefully underperforms,</span> choosing ${his} overall well-being over the consequences, <span class="reputation dec">aggravating customers and damaging the establishment's image.</span>`; slave.devotion -= 10; slave.trust -= 5; - repX(forceNeg(50), "gloryhole", slave); + repX(forceNeg(50), "disobedience", slave); } else { r += ` ${He} spends long hours cooped up in a small box with nothing to rest on. Even if ${he} where to try to lean against its side, it won't be long before another dick pokes through the hole demanding service. By the time ${he} is released, ${he} is <span class="red">utterly exhausted.</span>`; } diff --git a/src/endWeek/saWorkTheFarm.js b/src/endWeek/saWorkTheFarm.js index 4e8fb47425fff2d0fc6b5f7731f52495e407bd58..c486f3f079ca88d7e9aaa76836456deebb6daf82 100644 --- a/src/endWeek/saWorkTheFarm.js +++ b/src/endWeek/saWorkTheFarm.js @@ -17,9 +17,9 @@ window.saWorkTheFarm = function(slave) { const foodTotal = (slave, food) => { t += foodFarmer(); t += foodDevotion(slave); - t += foodHealth(slave); t += foodMuscles(slave); t += foodWeight(slave); + t += foodHealth(slave); t += foodSight(slave); t += foodHearing(slave); @@ -77,6 +77,7 @@ window.saWorkTheFarm = function(slave) { } t += `.</span> `; + t += foodTired(slave); return t; } @@ -89,6 +90,23 @@ window.saWorkTheFarm = function(slave) { return ` being tired`; } }; + + const foodTired = slave => { + if (!slave.fuckdoll) { + if (slaveResting(slave)) { + t = ` ${He} spends reduced hours working the soil in order to <span class="green">offset ${his} lack of rest.</span>`; + } else if (slave.tired + 20 >= 90 && !willWorkToDeath(slave)) { + t = ` ${He} attempts to refuse work due to ${his} exhaustion, but can do little to stop it or the resulting <span class="trust dec">severe punishment.</span> ${He} <span class="devotion dec">purposefully underperforms,</span> choosing ${his} overall well-being over the consequences, <span class="red">greatly reducing yields.</span>`; + slave.devotion -= 10; + slave.trust -= 5; + } else { + t = ` Hours of manual labor quickly add up, leaving ${him} <span class="red">physically drained</span> by the end of the day.`; + } + } + tired(slave); + + return t; + }; const foodMuscles = slave => { if (slave.muscles > 50) { diff --git a/src/js/food.js b/src/js/food.js index ab0f896d381ba75a22f407be84f4e25c6232eb86..34c908b82fd8199f0c0e9e9c88d5ccbb9ce9bad6 100644 --- a/src/js/food.js +++ b/src/js/food.js @@ -57,7 +57,7 @@ App.Facilities.Farmyard.foodAmount = function(slave) { } else if (slave.hears < -1) { // slave is deaf food *= 0.6; } - food *= healthPenalty(slave); + food *= restEffects(slave, 20); food = Math.trunc(food); food = Math.clamp(food, 1, 1000000000000000000); return food; diff --git a/src/js/health.js b/src/js/health.js index 8da70fc209bbc2fc8962332afa99627e74bc192e..0fe0e9595af614b13c7200b4d86b628e368b9c45 100644 --- a/src/js/health.js +++ b/src/js/health.js @@ -1,19 +1,32 @@ /** - * checks for illness and reduces the effectiveness of the slave accordingly -- 10, 25, 50, 85, 95% reduced - * also checks for tiredness and reduces effectiveness from that as well -- 10% reduction at 80+ and 5% at 50-80 + * checks for illness and reduces the effectiveness of the slave accordingly -- 5, 10, 25, 50, 90% reduced + * also checks for tiredness and reduces effectiveness from that as well -- 25% reduction at 90+ and 10% at 60-90 * @param {App.Entity.SlaveState} slave * @returns {number} */ window.healthPenalty = function healthPenalty(slave) { const H = slave.health; let penalty = 100; - if (H.illness > 0) { - penalty *= 1 - (100 - Math.min(Math.pow(H.illness, 2) * 5 + 5, 95)) / 100; - } - if (H.tired > 90) { - penalty *= 0.9; - } else if (H.tired > 60) { - penalty *= 0.95; + if (slave.assignment !== "work a glory hole") { + if (H.illness > 0) { + // penalty *= 1 - (100 - Math.min(Math.pow(H.illness, 2) * 5 + 5, 95)) / 100; Needs checking! + if (H.illness === 5) { + penalty *= 0.10; + } else if (H.illness === 4) { + penalty *= 0.50; + } else if (H.illness === 3) { + penalty *= 0.75; + } else if (H.illness === 2) { + penalty *= 0.90; + } else if (H.illness === 1) { + penalty *= 0.95; + } + } + if (H.tired > 90) { + penalty *= 0.75; + } else if (H.tired > 60) { + penalty *= 0.90; + } } penalty = Math.trunc(penalty) / 100; return penalty; diff --git a/src/uncategorized/slaveInteract.tw b/src/uncategorized/slaveInteract.tw index ff492afca56eb001cec9f782233f677da74b1239..43864863a587b1c31625f7e42026891773d2c440 100644 --- a/src/uncategorized/slaveInteract.tw +++ b/src/uncategorized/slaveInteract.tw @@ -473,12 +473,14 @@ <<link "Situational">><<set $slaves[_i].rules.reward = "situational">><<replace "#standardReward">>$slaves[_i].rules.reward<</replace>><</link>> /* - <br>Sleep Rules: ''<span id="restRules">$slaves[_i].rules.rest</span>.'' - <<link "None">><<set $slaves[_i].rules.rest = "none">><<replace "#restRules">>$slaves[_i].rules.rest<</replace>><</link>> | - <<link "Cruel">><<set $slaves[_i].rules.rest = "cruel">><<replace "#restRules">>$slaves[_i].rules.rest<</replace>><</link>> | - <<link "Restrictive">><<set $slaves[_i].rules.rest = "restrictive">><<replace "#restRules">>$slaves[_i].rules.rest<</replace>><</link>> | - <<link "Permissive">><<set $slaves[_i].rules.rest = "permissive">><<replace "#restRules">>$slaves[_i].rules.rest<</replace>><</link>> | - <<link "Mandatory">><<set $slaves[_i].rules.rest = "mandatory">><<replace "#restRules">>$slaves[_i].rules.rest<</replace>><</link>> | + <<if ["work a glory hole", "work as a farmhand"].includes($activeSlave.assignment)>> + <br>Sleep Rules: ''<span id="restRules">$slaves[_i].rules.rest</span>.'' + <<link "None">><<set $slaves[_i].rules.rest = "none">><<replace "#restRules">>$slaves[_i].rules.rest<</replace>><</link>> | + <<link "Cruel">><<set $slaves[_i].rules.rest = "cruel">><<replace "#restRules">>$slaves[_i].rules.rest<</replace>><</link>> | + <<link "Restrictive">><<set $slaves[_i].rules.rest = "restrictive">><<replace "#restRules">>$slaves[_i].rules.rest<</replace>><</link>> | + <<link "Permissive">><<set $slaves[_i].rules.rest = "permissive">><<replace "#restRules">>$slaves[_i].rules.rest<</replace>><</link>> | + <<link "Mandatory">><<set $slaves[_i].rules.rest = "mandatory">><<replace "#restRules">>$slaves[_i].rules.rest<</replace>><</link>> + <</if>> */ <<if setup.facilityHeads.includes($slaves[_i].assignment)>>