diff --git a/js/003-data/gameVariableData.js b/js/003-data/gameVariableData.js index 080fb6da52f225f9796fdea8c9a0e15360a32f61..3bae3e47e6a64655128ba2a4687bc6da9b0fd723 100644 --- a/js/003-data/gameVariableData.js +++ b/js/003-data/gameVariableData.js @@ -608,6 +608,9 @@ App.Data.resetOnNGPlus = { brothelName: "the Brothel", brothelNameCaps: "The Brothel", brothel: 0, + brothelBoost: { + selected: 0, eligable: 0 + }, dairyDecoration: "standard", dairyPrepUpgrade: 0, dairyStimulatorsUpgrade: 0, diff --git a/src/data/backwardsCompatibility/datatypeCleanup.js b/src/data/backwardsCompatibility/datatypeCleanup.js index 1d0bb8872d66e27b4626af6fb2c2e7ded50cc8c0..c60a6ff8ae67fb32cff8fe64febd60cc7492b04d 100644 --- a/src/data/backwardsCompatibility/datatypeCleanup.js +++ b/src/data/backwardsCompatibility/datatypeCleanup.js @@ -2079,6 +2079,8 @@ window.FacilityDatatypeCleanup = (function() { /* upgrades */ 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; /* 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/endWeek/saWhore.js b/src/endWeek/saWhore.js index 733c022ed7be826d845990f1ba1192a32c253861..008de40707c9a17c1ce3767313ba500eb88df3c5 100644 --- a/src/endWeek/saWhore.js +++ b/src/endWeek/saWhore.js @@ -133,6 +133,13 @@ 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 + if (maxBrothelBoost < V.slaveJobValues.brothel.boost) { + FuckResult = Math.trunc(FuckResult * (1 + V.brothelBoost.eligable / 20) * maxBrothelBoost / V.slaveJobValues.brothel.boost); + } else { + FuckResult = Math.trunc(FuckResult * (1 + V.brothelBoost.eligable / 20)); + } + } // ads if (V.brothelAdsSpending !== 0) { @@ -1294,20 +1301,7 @@ window.saWhore = (function saWhore() { * @param {App.Entity.SlaveState} slave */ function addCash(slave) { - let whoreScore = slave.sexAmount * slave.sexQuality; // The standard amount of money the whore is expected to make in a week - if (slave.effectiveWhoreClass === 4) { - cash = Math.trunc(whoreScore * V.whorePriceAdjustment.topClass); // final price adjustment for supply and demand - slave.sexQuality = Math.trunc(slave.sexQuality); // rounding it after we're done with it - } else if (slave.effectiveWhoreClass === 3) { - cash = Math.trunc(whoreScore * V.whorePriceAdjustment.upperClass); - slave.sexQuality = Math.trunc(slave.sexQuality); - } else if (slave.effectiveWhoreClass === 2) { - cash = Math.trunc(whoreScore * V.whorePriceAdjustment.middleClass); - slave.sexQuality = Math.trunc(slave.sexQuality); - } else { - cash = Math.trunc(whoreScore * V.whorePriceAdjustment.lowerClass); - slave.sexQuality = Math.trunc(slave.sexQuality); - } + cash = slave.sexAmount * FuckResult; // The standard amount of money the whore is expected to make in a week if (slave.assignment === window.Job.WHORE) { cashX(cash, "slaveAssignmentWhore", slave); } else if (slave.assignment === window.Job.MADAM) { diff --git a/src/js/economyJS.js b/src/js/economyJS.js index e3f157a91bd906657f74e6c9a5ade615640c3b6b..633796f47d79c9a3af0086591d8522015d04d7bb 100644 --- a/src/js/economyJS.js +++ b/src/js/economyJS.js @@ -1450,8 +1450,9 @@ window.slaveJobValues = function(lowerClassSexDemandRef, middleClassSexDemandRef lowerClass: 0, middleClass: 0, upperClass: 0, - topClass: 0 - } // A list of values for each tier of whore (low, middle, upper, top) + topClass: 0, + boost: 0 + } // A list of values for each tier of whore (low, middle, upper, top) and a variable for the amount of money earned through the boost }; let clubSpots; let brothelSpots; @@ -1956,6 +1957,9 @@ window.slaveJobValues = function(lowerClassSexDemandRef, middleClassSexDemandRef let income = s.sexAmount * s.sexQuality; let sexMin; let sexBudget; + let targetBudget; // Finding the right budget target + let fuckMin; // minimum amount of fucks + let fuckDev = 3; // standard deviation of fucks const initialHealthPenalty = healthPenalty(s); s.effectiveWhoreClass = effectiveWhoreClass(s); s.maxWhoreClass = s.effectiveWhoreClass; @@ -1972,6 +1976,14 @@ window.slaveJobValues = function(lowerClassSexDemandRef, middleClassSexDemandRef const lowerClubSupply = slaveJobValues.club * slaveJobValues.clubSP * (lowerClassSexDemandRef / (lowerClassSexDemandRef + middleClassSexDemandRef)); const lowerSupply = slaveJobValues.brothel.lowerClass + lowerClubSupply; const lowerSDRatio = lowerSupply / (lowerClassSexDemandRef - V.NPCSexSupply.lowerClass); + let demandBoost = 1; + let priceBoost = 1; + + if (toTheBrothel === 1 || s.assignment === "work in the brothel") { + demandBoost += V.brothelBoost.eligable / 50; + priceBoost += V.brothelBoost.eligable / 20; + } + if (s.effectiveWhoreClass === 4 && topSDRatio > 1 && topSDRatio > upperSDRatio) { s.effectiveWhoreClass -= 1; } @@ -1982,75 +1994,69 @@ window.slaveJobValues = function(lowerClassSexDemandRef, middleClassSexDemandRef s.effectiveWhoreClass -= 1; } - // Calculate the stats - if (s.effectiveWhoreClass === 4) { - sexMin = normalRandInt(30, 2); // The minimum of fucks per week; can increase if needed - sexBudget = Math.trunc(V.whoreBudget.topClass * 0.2); // initial maximum price per fuck; can increase if needed - while (income > sexBudget * sexMin) { // if the income can not be caught within the initial values of sexMin and sexBudget we increase both as needed in this loop - sexMin = Math.trunc(sexMin * 1.1); - if (income > sexBudget * sexMin) { - sexBudget = Math.trunc(sexBudget * 1.1); - } - } - s.sexAmount = sexMin; - 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.trunc(income / s.sexAmount); - slaveJobValues.brothel.topClass += s.sexAmount * s.sexQuality; // Registering the job value in the right slot - } else if (s.effectiveWhoreClass === 3) { - sexMin = normalRandInt(40, 3); - sexBudget = Math.trunc(V.whoreBudget.upperClass * 0.5); - while (income > sexBudget * sexMin) { - sexMin = Math.trunc(sexMin * 1.1); - if (income > sexBudget * sexMin) { - sexBudget = Math.trunc(sexBudget * 1.1); - } - } - s.sexAmount = sexMin; - tiredFucks(s); - if (healthPenalty(s) < initialHealthPenalty) { - income *= healthPenalty(s) / initialHealthPenalty; - } - s.sexQuality = Math.trunc(income / s.sexAmount); - slaveJobValues.brothel.upperClass += s.sexAmount * s.sexQuality; - } else if (s.effectiveWhoreClass === 2) { - sexMin = normalRandInt(50, 3); - sexBudget = V.whoreBudget.middleClass; - while (income > sexBudget * sexMin) { - sexMin = Math.trunc(sexMin * 1.1); - if (income > sexBudget * sexMin) { - sexBudget = Math.trunc(sexBudget * 1.1); - } - } - s.sexAmount = sexMin; - tiredFucks(s); - if (healthPenalty(s) < initialHealthPenalty) { - income *= healthPenalty(s) / initialHealthPenalty; - } - s.sexQuality = Math.trunc(income / s.sexAmount); - slaveJobValues.brothel.middleClass += s.sexAmount * s.sexQuality; - } else { - sexMin = normalRandInt(60, 3); - sexBudget = V.whoreBudget.lowerClass * 3; - while (income > sexBudget * sexMin) { - sexMin = Math.trunc(sexMin * 1.1); - if (income > sexBudget * sexMin) { - sexBudget = Math.trunc(sexBudget * 1.1); - } - } - s.sexAmount = sexMin; - tiredFucks(s); - if (healthPenalty(s) < initialHealthPenalty) { - income *= healthPenalty(s) / initialHealthPenalty; + switch (s.effectiveWhoreClass) { + case 1: + targetBudget = V.whoreBudget.lowerClass * 3; + fuckMin = 60; + break; + case 2: + targetBudget = V.whoreBudget.middleClass; + fuckMin = 50; + break; + case 3: + targetBudget = V.whoreBudget.upperClass * 0.5; + fuckMin = 40; + break; + case 4: + targetBudget = V.whoreBudget.topClass * 0.2; + fuckMin = 30; + fuckDev = 2; + break; + default: + targetBudget = V.whoreBudget.lowerClass * 3; + fuckMin = 60; + } + + sexMin = normalRandInt(fuckMin, fuckDev); // The minimum of fucks per week; can increase if needed + sexBudget = Math.trunc(targetBudget); // initial maximum price per fuck; can increase if needed + while (income > sexBudget * sexMin) { // if the income can not be caught within the initial values of sexMin and sexBudget we increase both as needed in this loop + sexMin = Math.trunc(sexMin * 1.1); + if (income > sexBudget * sexMin) { + sexBudget = Math.trunc(sexBudget * 1.1); } - s.sexQuality = Math.max(Math.trunc(income / s.sexAmount), 2); // The lower class will pay a minimum of 2 per fuck - slaveJobValues.brothel.lowerClass += s.sexAmount * s.sexQuality; + } + + s.sexAmount = Math.round(sexMin * demandBoost); + 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.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) { + 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. + } + + switch (s.effectiveWhoreClass) { + case 1: + slaveJobValues.brothel.lowerClass += incomeBoostCorrected; // Registering the job value in the right slot + break; + case 2: + slaveJobValues.brothel.middleClass += incomeBoostCorrected; + break; + case 3: + slaveJobValues.brothel.upperClass += incomeBoostCorrected; + break; + case 4: + slaveJobValues.brothel.topClass += incomeBoostCorrected; + break; + default: + slaveJobValues.brothel.lowerClass += incomeBoostCorrected; } } - whoreScore(s, lowerClassSexDemandRef, middleClassSexDemandRef, upperClassSexDemandRef, topClassSexDemandRef); + whoreScore(s, lowerClassSexDemandRef, middleClassSexDemandRef, upperClassSexDemandRef, topClassSexDemandRef, toTheBrothel); if (s.assignment === "be the Madam") { if ((BL + toTheBrothelTotal > 0) && (BL + toTheBrothelTotal < 10)) { diff --git a/src/uncategorized/brothel.tw b/src/uncategorized/brothel.tw index 17898fb95ca4bd032502f407490a8fc34c27510f..9c4a618f6158cb0202033ebb11ea90f9c26ab1a9 100644 --- a/src/uncategorized/brothel.tw +++ b/src/uncategorized/brothel.tw @@ -151,6 +151,9 @@ <</link>> </div> <</if>> + <br>The brothel could be more profitable if 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. </p> <div> diff --git a/src/uncategorized/slaveAssignmentsReport.tw b/src/uncategorized/slaveAssignmentsReport.tw index 162e3e5550b7a3a356192cce1db9f9b8c8c51bce..d0374933238cc3a7a5cbf929b833d06cd3ad32e0 100644 --- a/src/uncategorized/slaveAssignmentsReport.tw +++ b/src/uncategorized/slaveAssignmentsReport.tw @@ -28,6 +28,16 @@ Depending on the conditions they may derive more or less 'utility' out of their credits spent 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>> + <</if>> +<<else>> + <<set $brothelBoost.eligable = $brothelBoost.selected>> +<</if>> +<<run repX(forceNeg(50 * $brothelBoost.eligable), "brothel")>> + <<set _lowerClassSexDemand = Math.trunc($lowerClass * $whoreBudget.lowerClass) * 2, _lowerClassSexDemandRef = Math.max(_lowerClassSexDemand, 1), _visitorsSexDemand = Math.trunc($visitors) * 40, @@ -105,7 +115,8 @@ _middleClassClubRatio = _middleClassSexDemand / _clubDemand>> <<set _clubSupply.lowerClass = Math.trunc($slaveJobValues.club * $slaveJobValues.clubSP * _lowerClassClubRatio), _clubSupply.middleClass = Math.trunc($slaveJobValues.club * $slaveJobValues.clubSP * _middleClassClubRatio)>> -/*Brothel or street whore sex supply*/ +/* Brothel or street whore sex supply */ +boost: <<print $slaveJobValues.brothel.boost>> <<if _lowerClassSexDemand < $slaveJobValues.brothel.lowerClass>> <<set $whorePriceAdjustment.lowerClass = Math.max(Math.pow(_lowerClassSexDemand / ($slaveJobValues.brothel.lowerClass + $NPCSexSupply.lowerClass), 1.513), 0.3), _lowerClassSexDemand = 0>> /*This accounts for people having too much choice and getting more picky how they spend their money*/