From f177917671df1f5b381f8b61bbdd9daec0fe1a6b Mon Sep 17 00:00:00 2001 From: Svornost <11434-svornost@users.noreply.gitgud.io> Date: Sun, 5 Apr 2020 17:42:06 -0700 Subject: [PATCH] Fix some things --- js/003-data/gameVariableData.js | 2 +- src/data/backwardsCompatibility/datatypeCleanup.js | 6 +++++- src/descriptions/familySummaries.js | 4 ++-- src/endWeek/saWhore.js | 6 +++--- src/js/economyJS.js | 10 +++++----- src/uncategorized/brothel.tw | 2 +- src/uncategorized/slaveAssignmentsReport.tw | 10 +++++----- src/utility/extendedFamilyWidgets.tw | 2 +- 8 files changed, 23 insertions(+), 19 deletions(-) diff --git a/js/003-data/gameVariableData.js b/js/003-data/gameVariableData.js index 3bae3e47e6a..fcbca4509a8 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 c60a6ff8ae6..08d293890fa 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 7307cc0f375..d59f952dc45 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 2a087e5757f..0c769d45b38 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/js/economyJS.js b/src/js/economyJS.js index 633796f47d7..7b0d4b94d14 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/uncategorized/brothel.tw b/src/uncategorized/brothel.tw index 0a833ece797..e8268bf1fdf 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 2f1c0adc1fb..e47eccc4507 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 38d3529ddaa..1349aaf6cb1 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>> -- GitLab