diff --git a/js/003-data/gameVariableData.js b/js/003-data/gameVariableData.js index 3bae3e47e6a64655128ba2a4687bc6da9b0fd723..fcbca4509a864daf2959048ac7551d1ff1a7634e 100644 --- a/js/003-data/gameVariableData.js +++ b/js/003-data/gameVariableData.js @@ -609,7 +609,7 @@ App.Data.resetOnNGPlus = { brothelNameCaps: "The Brothel", brothel: 0, brothelBoost: { - selected: 0, eligable: 0 + selected: 0, eligible: 0 }, dairyDecoration: "standard", dairyPrepUpgrade: 0, diff --git a/src/data/backwardsCompatibility/datatypeCleanup.js b/src/data/backwardsCompatibility/datatypeCleanup.js index c60a6ff8ae67fb32cff8fe64febd60cc7492b04d..08d293890faf3fe712766541c66c2da0eafa31d7 100644 --- a/src/data/backwardsCompatibility/datatypeCleanup.js +++ b/src/data/backwardsCompatibility/datatypeCleanup.js @@ -2080,7 +2080,11 @@ window.FacilityDatatypeCleanup = (function() { V.brothel = Math.max(+V.brothel, 0) || 0; V.brothelUpgradeDrugs = Math.clamp(+V.brothelUpgradeDrugs, 0, 2) || 0; V.brothelBoost.selected = Math.clamp(+V.brothelBoost.selected, 0, 10) || 0; - V.brothelBoost.eligable = Math.clamp(+V.brothelBoost.eligable, 0, 10) || 0; + if (typeof V.brothelBoost.eligable !== "undefined") { // FFS, spell it right... + V.brothelBoost.eligible = V.brothelBoost.eligable; + delete V.brothelBoost.eligable; + } + V.brothelBoost.eligible = Math.clamp(+V.brothelBoost.eligible, 0, 10) || 0; /* madam */ V.Madam = V.slaves.find(s => s.assignment === "be the Madam") || 0; V.MadamIgnoresFlaws = Math.clamp(+V.MadamIgnoresFlaws, 0, 1) || 0; diff --git a/src/descriptions/familySummaries.js b/src/descriptions/familySummaries.js index 7307cc0f375f4de200ead12f7d17a9758018d914..d59f952dc45cfa50792a1f10b748f1a1b828fe89 100644 --- a/src/descriptions/familySummaries.js +++ b/src/descriptions/familySummaries.js @@ -25,7 +25,7 @@ App.Desc.family = (function() { */ function splitBySex(slaves) { let r = {m: [], f: []}; - for (s of slaves) { + for (const s of slaves) { if (s.genes === "XX") { r.f.push(s); } else { @@ -207,7 +207,7 @@ App.Desc.family = (function() { r.push(`${He} has`); if (children.length > 2) { r.push(`<span class="lightgreen">many grandchildren, ${slaveListToText(children)}, amongst your slaves.</span>`); - } else if ($children.length > 1) { + } else if (children.length > 1) { r.push(`<span class="lightgreen">two grandchildren, ${slaveListToText(children)}, amongst your slaves.</span>`); } else { r.push(`a <span class="lightgreen">grandchild, ${slaveListToText(children)}, as your slave.</span>`); diff --git a/src/endWeek/saWhore.js b/src/endWeek/saWhore.js index 2a087e5757fc33c19ebce60f8440aaf6b8830f2d..0c769d45b381eacdc715121d03a5f520b5bf5134 100644 --- a/src/endWeek/saWhore.js +++ b/src/endWeek/saWhore.js @@ -133,11 +133,11 @@ window.saWhore = (function saWhore() { if ((V.universalRulesFacilityWork === 1 && slave.assignment === "whore" && V.brothelSpots > 0) || (slave.assignment === "work in the brothel")) { if (slave.assignment === "whore") { r += ` Since there's extra space in ${V.brothelName}, ${he} sells ${himself} there.`; - const maxBrothelBoost = Math.max(Math.trunc(100 * Math.pow(1.26, V.brothelBoost.eligable - 1)) * 50 * V.brothelBoost.eligable, 1); // Correcting prices in case benefits outgrow the cap + const maxBrothelBoost = Math.max(Math.trunc(100 * Math.pow(1.26, V.brothelBoost.eligible - 1)) * 50 * V.brothelBoost.eligible, 1); // Correcting prices in case benefits outgrow the cap if (maxBrothelBoost < V.slaveJobValues.brothel.boost) { - FuckResult = Math.trunc(FuckResult * (1 + V.brothelBoost.eligable / 20) * maxBrothelBoost / V.slaveJobValues.brothel.boost); + FuckResult = Math.trunc(FuckResult * (1 + V.brothelBoost.eligible / 20) * maxBrothelBoost / V.slaveJobValues.brothel.boost); } else { - FuckResult = Math.trunc(FuckResult * (1 + V.brothelBoost.eligable / 20)); + FuckResult = Math.trunc(FuckResult * (1 + V.brothelBoost.eligible / 20)); } } diff --git a/src/endWeek/saWorkTheFarm.js b/src/endWeek/saWorkTheFarm.js index c486f3f079ca88d7e9aaa76836456deebb6daf82..9df9ad1a7a17bd82e1b0e9fcde1225c842661442 100644 --- a/src/endWeek/saWorkTheFarm.js +++ b/src/endWeek/saWorkTheFarm.js @@ -30,6 +30,7 @@ window.saWorkTheFarm = function(slave) { if (V.Farmer) { return `${V.Farmer.slaveName} watches over ${him}, making sure that ${he} doesn't slack off and works as hard as ${he} should. `; } + return ``; }; const foodDevotion = slave => { @@ -38,13 +39,12 @@ window.saWorkTheFarm = function(slave) { } else if (slave.devotion < -50) { return `${He}'s so resistant that ${he} doesn't work as hard, and thus produces less food. `; } else { - // TODO: third case for neutral? + return ``; // TODO: third case for neutral? } }; const foodHealth = slave => { - foodHealthCondition(slave); - foodHealthIllness(slave); + return foodHealthCondition(slave) + foodHealthIllness(slave); }; const foodHealthCondition = slave => { @@ -53,13 +53,14 @@ window.saWorkTheFarm = function(slave) { } else if (slave.health.condition < -50) { return `${His} poor health impedes ${his} ability to work efficiently. `; } else { - // TODO: third case? + return ``; // TODO: third case? } }; const foodHealthIllness = slave => { + let t = ``; if (slave.health.illness > 0 || slave.health.tired > 60) { - let t = ` ${He} performed worse this week due to<span class="red">`; + t += ` ${He} performed worse this week due to<span class="red">`; if (slave.health.illness === 1) { t += ` feeling under the weather`; } else if (slave.health.illness === 2) { @@ -78,9 +79,8 @@ window.saWorkTheFarm = function(slave) { t += `.</span> `; t += foodTired(slave); - - return t; } + return t; }; const foodHealthTired = slave => { @@ -89,9 +89,11 @@ window.saWorkTheFarm = function(slave) { } else if (slave.health.tired > 60) { return ` being tired`; } + return ``; }; - + const foodTired = slave => { + let t = ``; 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>`; @@ -114,21 +116,21 @@ window.saWorkTheFarm = function(slave) { } else if (slave.muscles < -50) { return `${He} is so weak that ${he} is not able to work effectively. `; } else { - // TODO: third case? + return ``; // TODO: third case? } }; const foodWeight = slave => { - return slave.weight > 95 ? `${He} is so overweight that ${he} has to stop every few minutes to catch ${his} breath, and so ${his} productivity suffers. ` : null; + return slave.weight > 95 ? `${He} is so overweight that ${he} has to stop every few minutes to catch ${his} breath, and so ${his} productivity suffers. ` : ``; }; const foodSight = slave => { if (!canSee(slave)) { - t += `${His} blindness makes it extremely difficult for ${him} to work, severely limiting ${his} production. `; + return `${His} blindness makes it extremely difficult for ${him} to work, severely limiting ${his} production. `; } else if (!canSeePerfectly(slave)) { - t += `${His} nearsightedness makes it harder for ${him} to work as hard as ${he} otherwise would. `; + return `${His} nearsightedness makes it harder for ${him} to work as hard as ${he} otherwise would. `; } else { - // TODO: third case? + return ``; // TODO: third case? } }; @@ -138,7 +140,7 @@ window.saWorkTheFarm = function(slave) { } else if (slave.hears < -1) { return `${He} is deaf, which gets in the way of ${his} work whenever ${he} misses directions${V.Farmer ? ` from ${V.Farmer.slaveName}` : ``}. `; } else { - // TODO: third case? + return ``; // TODO: third case? } }; diff --git a/src/js/economyJS.js b/src/js/economyJS.js index 633796f47d79c9a3af0086591d8522015d04d7bb..7b0d4b94d14a37777e2d303b8a5c083e306469ec 100644 --- a/src/js/economyJS.js +++ b/src/js/economyJS.js @@ -1946,7 +1946,7 @@ window.slaveJobValues = function(lowerClassSexDemandRef, middleClassSexDemandRef /** * The whoreScore function finds the appropriate customer class and then calculates the whore income stats associated with that class and adds to the class supply. - * 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). + * whoreClass is the MAXIMUM player set class the whore is allowed to service, if the whore is not eligible 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). * @param {App.Entity.SlaveState} s * @param {number} lowerClassSexDemandRef * @param {number} middleClassSexDemandRef @@ -1980,8 +1980,8 @@ window.slaveJobValues = function(lowerClassSexDemandRef, middleClassSexDemandRef let priceBoost = 1; if (toTheBrothel === 1 || s.assignment === "work in the brothel") { - demandBoost += V.brothelBoost.eligable / 50; - priceBoost += V.brothelBoost.eligable / 20; + demandBoost += V.brothelBoost.eligible / 50; + priceBoost += V.brothelBoost.eligible / 20; } if (s.effectiveWhoreClass === 4 && topSDRatio > 1 && topSDRatio > upperSDRatio) { @@ -2034,7 +2034,7 @@ window.slaveJobValues = function(lowerClassSexDemandRef, middleClassSexDemandRef s.sexQuality = Math.trunc((income * demandBoost * priceBoost) / s.sexAmount); const incomeBoostCorrected = Math.trunc(s.sexAmount * s.sexQuality / priceBoost); - if ((toTheBrothel === 1 || s.assignment === "work in the brothel") && V.brothelBoost.eligable > 0) { + if ((toTheBrothel === 1 || s.assignment === "work in the brothel") && V.brothelBoost.eligible > 0) { slaveJobValues.brothel.boost += Math.max(Math.trunc(s.sexAmount * s.sexQuality / demandBoost) - Math.trunc(income), 0); // Keeping track of additional benefits from boosting the brothel on the price side and not the amount side. } @@ -2081,7 +2081,7 @@ window.effectiveWhoreClass = function(s) { } else { result = s.whoreClass; } - // Find maximum eligable class + // Find maximum eligible class // these could be refined further if needed. if (result === 4 && !(score > 5000 && s.skill.whoring > 80 && s.skill.entertainment > 50)) { result -= 1; diff --git a/src/js/food.js b/src/js/food.js index 34c908b82fd8199f0c0e9e9c88d5ccbb9ce9bad6..ef90c684006d7137d2a53e8e9713ace85fc109ec 100644 --- a/src/js/food.js +++ b/src/js/food.js @@ -19,49 +19,45 @@ App.Facilities.Farmyard.foodAmount = function(slave) { if (V.farmyardUpgrade.machinery === 1) { food += 65; // machinery upgrade for farmyard } - if (V.Farmer === 0) { - return null; - } else { - if (V.Farmer !== 0) { // if a farmer is assigned - food *= 1.1; // TODO: expand this to account for farmer XP and skill - if (V.Farmer.skill.farmer >= V.masteredXP) { // if farmer is master - food *= 1.1; - } - } - if (slave.devotion > 50) { + if (V.Farmer !== 0) { // if a farmer is assigned + food *= 1.1; // TODO: expand this to account for farmer XP and skill + if (V.Farmer.skill.farmer >= V.masteredXP) { // if farmer is master food *= 1.1; - } else if (slave.devotion < -50) { - food *= 0.8; } - if (slave.muscles > 30) { // slave is muscular or more - food *= 1.1; - } else if (slave.muscles <= -6) { // slave is weak or less - food *= 0.8; - } - if (slave.weight > 95) { // slave is overweight or more - food *= 0.9; - } else if (slave.weight > 130) { // slave is fat or more - food *= 0.8; - } else if (slave.weight > 160) { // slave is obese or more - food *= 0.7; - } else if (slave.weight > 190) { // slave is very obese or more - food *= 0.6; - } - if (!canSee(slave)) { // slave is blind - food *= 0.6; - } else if (!canSeePerfectly(slave)) { // slave is nearsighted - food *= 0.8; - } - if (slave.hears === -1) { // slave is hard of hearing - food *= 0.8; - } else if (slave.hears < -1) { // slave is deaf - food *= 0.6; - } - food *= restEffects(slave, 20); - food = Math.trunc(food); - food = Math.clamp(food, 1, 1000000000000000000); - return food; } + if (slave.devotion > 50) { + food *= 1.1; + } else if (slave.devotion < -50) { + food *= 0.8; + } + if (slave.muscles > 30) { // slave is muscular or more + food *= 1.1; + } else if (slave.muscles <= -6) { // slave is weak or less + food *= 0.8; + } + if (slave.weight > 95) { // slave is overweight or more + food *= 0.9; + } else if (slave.weight > 130) { // slave is fat or more + food *= 0.8; + } else if (slave.weight > 160) { // slave is obese or more + food *= 0.7; + } else if (slave.weight > 190) { // slave is very obese or more + food *= 0.6; + } + if (!canSee(slave)) { // slave is blind + food *= 0.6; + } else if (!canSeePerfectly(slave)) { // slave is nearsighted + food *= 0.8; + } + if (slave.hears === -1) { // slave is hard of hearing + food *= 0.8; + } else if (slave.hears < -1) { // slave is deaf + food *= 0.6; + } + food *= restEffects(slave, 20); + food = Math.trunc(food); + food = Math.clamp(food, 1, 1000000000000000000); + return food; }; /** diff --git a/src/uncategorized/brothel.tw b/src/uncategorized/brothel.tw index 0a833ece797b41b6da13d140f062a755e6e20dac..e8268bf1fdf16ff8bea7ab31ea127284ca5013c3 100644 --- a/src/uncategorized/brothel.tw +++ b/src/uncategorized/brothel.tw @@ -153,7 +153,7 @@ <</if>> <br>The brothel could be more profitable if you started spending time in the brothel you would otherwise spend in public. Your reputation will suffer, but paying customers may seek out your whores if they think it means you'll lend them your ear. <br>Boost: <<if $brothelBoost.selected != 0>>[[None|Brothel][$brothelBoost.selected = 0]]<<else>>None<</if>> | <<if $brothelBoost.selected != 1>>[[5%|Brothel][$brothelBoost.selected = 1]]<<else>>5%<</if>> | <<if $brothelBoost.selected != 2>>[[10%|Brothel][$brothelBoost.selected = 2]]<<else>>10%<</if>> | <<if $brothelBoost.selected != 3>>[[15%|Brothel][$brothelBoost.selected = 3]]<<else>>15%<</if>> | <<if $brothelBoost.selected != 4>>[[20%|Brothel][$brothelBoost.selected = 4]]<<else>>20%<</if>> | <<if $brothelBoost.selected != 5>>[[25%|Brothel][$brothelBoost.selected = 5]]<<else>>25%<</if>> | <<if $brothelBoost.selected != 6>>[[30%|Brothel][$brothelBoost.selected = 6]]<<else>>30%<</if>> | <<if $brothelBoost.selected != 7>>[[35%|Brothel][$brothelBoost.selected = 7]]<<else>>35%<</if>> | <<if $brothelBoost.selected != 8>>[[40%|Brothel][$brothelBoost.selected = 8]]<<else>>40%<</if>> | <<if $brothelBoost.selected != 9>>[[45%|Brothel][$brothelBoost.selected = 9]]<<else>>45%<</if>> | <<if $brothelBoost.selected != 10>>[[50%|Brothel][$brothelBoost.selected = 10]]<<else>>50%<</if>> - <br>Every 5% you attempt to boost income also increases the amount of customers by 2% and costs 50 reputation more. A minimum of 2500 reputation is required and every additional level increases this by another 500. You may choose whichever level you please, only the highest level you are eligable for will be used at any time. + <br>Every 5% you attempt to boost income also increases the amount of customers by 2% and costs 50 reputation more. A minimum of 2500 reputation is required and every additional level increases this by another 500. You may choose whichever level you please, only the highest level you are eligible for will be used at any time. </p> <div> diff --git a/src/uncategorized/slaveAssignmentsReport.tw b/src/uncategorized/slaveAssignmentsReport.tw index 2f1c0adc1fb8fd315ed5171f3c4d96956751a217..e47eccc45077f10bfaf6e53a31687ac356eaca9c 100644 --- a/src/uncategorized/slaveAssignmentsReport.tw +++ b/src/uncategorized/slaveAssignmentsReport.tw @@ -29,14 +29,14 @@ Depending on the conditions they may derive more or less 'utility' out of their i.e. a highly paternalist arcology with little choice for its lower class but Fuckdolls may still put money into them but not get the same satisfaction out of it*/ /*Low rent increases demand/available money for sexual services, high rent decreases it*/ <<if $brothelBoost.selected > 0 && $rep < $brothelBoost.selected * 500 + 2000>> - <<set $brothelBoost.eligable = Math.trunc((rep - 2000) / 500)>> - <<if $brothelBoost.eligable < 0>> - <<set $brothelBoost.eligable = 0>> + <<set $brothelBoost.eligible = Math.trunc((rep - 2000) / 500)>> + <<if $brothelBoost.eligible < 0>> + <<set $brothelBoost.eligible = 0>> <</if>> <<else>> - <<set $brothelBoost.eligable = $brothelBoost.selected>> + <<set $brothelBoost.eligible = $brothelBoost.selected>> <</if>> -<<run repX(forceNeg(50 * $brothelBoost.eligable), "brothel")>> +<<run repX(forceNeg(50 * $brothelBoost.eligible), "brothel")>> <<set _lowerClassSexDemand = Math.trunc($lowerClass * $whoreBudget.lowerClass) * 2, _lowerClassSexDemandRef = Math.max(_lowerClassSexDemand, 1), diff --git a/src/utility/extendedFamilyWidgets.tw b/src/utility/extendedFamilyWidgets.tw index 38d3529ddaa817c4dadd9ecde785df948565f747..1349aaf6cb15df3846a5adc926cea827772e79f6 100644 --- a/src/utility/extendedFamilyWidgets.tw +++ b/src/utility/extendedFamilyWidgets.tw @@ -139,7 +139,7 @@ <</if>> <</for>> -<br>''Same father as:'' <span id="sameFatherNames"><<listOfSlavesWithParent 'father' activeSlave.father>></span> +<br>''Same father as:'' <span id="sameFatherNames"><<listOfSlavesWithParent 'father' $activeSlave.father>></span> <<link "Reset">> <<set $activeSlave.father = 0>> <<replace '#fatherName'>><</replace>>