diff --git a/src/js/economyJS.js b/src/js/economyJS.js index 4a707dceb4b9ce00938651141c3ff4c369ab7799..dd42512f64612c5344a81bc20b386d57763b3820 100644 --- a/src/js/economyJS.js +++ b/src/js/economyJS.js @@ -943,12 +943,12 @@ window.NPCSexSupply = function(lowerDemandLeft, lowerTotalDemand, middleDemandLe // Top class calculations const topClassNPCRatio = NPCSexSupply.topClass / topDemandLeft; - const topClassOptimalRatio = 0.5 + V.sexSubsidies.topClass / 10 - V.sexSupplyBarriers.topClass / 10; + const topClassOptimalRatio = 0.5 + V.sexSubsidies.topClass / 8 - V.sexSupplyBarriers.topClass / 10; const topClassOptimal = topDemandLeft * topClassOptimalRatio; if (NPCSexSupply.topClass > topTotalDemand * (0.3 - V.sexSupplyBarriers.topClass / 20)) { - if (topClassNPCRatio >= topClassOptimalRatio + 0.05) { + if (topClassNPCRatio >= topClassOptimalRatio + 0.025) { NPCSexSupply.topClass -= Math.min(NPCSexSupply.topClass - Math.trunc((NPCSexSupply.topClass * 4 + topClassOptimal) / 5), Math.trunc(NPCSexSupply.topClass * 0.1)); - } else if (topClassNPCRatio <= topClassOptimalRatio - 0.05) { + } else if (topClassNPCRatio <= topClassOptimalRatio - 0.025) { NPCSexSupply.topClass += Math.trunc(Math.clamp((NPCSexSupply.topClass * 4 + topClassOptimal) / 5 - NPCSexSupply.topClass, 500, NPCSexSupply.topClass * 0.1) * (1 - V.sexSupplyBarriers.topClass / 5)); } else { NPCSexSupply.topClass = Math.trunc(NPCSexSupply.topClass * (1 + normalRandInt(0, 20) / 1000)); @@ -1599,14 +1599,14 @@ window.slaveJobValues = function(lowerClassSexDemandRef, middleClassSexDemandRef // 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? // This also takes into consideration public sluts and ignores the NPC market and arcades - const topSDRatio = slaveJobValues.brothel.topClass / topClassSexDemandRef; - const upperSDRatio = slaveJobValues.brothel.upperClass / upperClassSexDemandRef; + const topSDRatio = slaveJobValues.brothel.topClass / (topClassSexDemandRef - V.NPCSexSupply.topClass); + const upperSDRatio = slaveJobValues.brothel.upperClass / (upperClassSexDemandRef - V.NPCSexSupply.upperClass); const middleClubSupply = slaveJobValues.club * slaveJobValues.clubSP * (middleClassSexDemandRef / (lowerClassSexDemandRef + middleClassSexDemandRef)); const middleSupply = slaveJobValues.brothel.middleClass + middleClubSupply; - const middleSDRatio = middleSupply / middleClassSexDemandRef; + const middleSDRatio = middleSupply / (middleClassSexDemandRef - V.NPCSexSupply.middleClass); const lowerClubSupply = slaveJobValues.club * slaveJobValues.clubSP * (lowerClassSexDemandRef / (lowerClassSexDemandRef + middleClassSexDemandRef)); const lowerSupply = slaveJobValues.brothel.lowerClass + lowerClubSupply; - const lowerSDRatio = lowerSupply / lowerClassSexDemandRef; + const lowerSDRatio = lowerSupply / (lowerClassSexDemandRef - V.NPCSexSupply.lowerClass); if (s.effectiveWhoreClass === 4 && topSDRatio > 1 && topSDRatio > upperSDRatio) { s.effectiveWhoreClass -= 1; } @@ -1619,20 +1619,20 @@ window.slaveJobValues = function(lowerClassSexDemandRef, middleClassSexDemandRef // Calculate the stats if (s.effectiveWhoreClass === 4) { - s.sexAmount = normalRandInt(50, 4); // Bringing sex amount into the desired range - s.sexQuality = Math.trunc(Math.min((income * 1.2) / s.sexAmount, V.whoreBudget.topClass * 0.2)); // Adjusting the price to the correct sex amount with 20% bonus for being of the highest tier + 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. + 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 = normalRandInt(60, 5); - s.sexQuality = Math.min(Math.trunc((income * 1.05) / s.sexAmount), V.whoreBudget.upperClass * 0.5); // The upper class will pay a maximum of 60% of their weekly budget per service + 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. + 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 = normalRandInt(70, 6); + 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. 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 = normalRandInt(80, 7); - s.sexQuality = Math.clamp((income * 0.75) / s.sexAmount, 2, V.whoreBudget.lowerClass * 2); // The lower class will pay a maximum of 300% of their weekly budget per service and a minimum of 2 + s.sexAmount = Math.clamp(s.sexAmount * 2, normalRandInt(60, 3), normalRandInt(150, 3)); // Beauty improves use amount between values of approx. 30 and 75. + s.sexQuality = Math.clamp((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)); } } diff --git a/src/uncategorized/arcmgmt.tw b/src/uncategorized/arcmgmt.tw index 9882b86c4cd962a6503b0154767405edb201c911..edebd87d70bf2b8138bd307e5631bb87750b5128 100644 --- a/src/uncategorized/arcmgmt.tw +++ b/src/uncategorized/arcmgmt.tw @@ -18,14 +18,14 @@ You are providing your citizens with an adequate amount of slaves to be used as sexual objects, as is expected in your degradationist society.<br> <</if>> <</if>> -<<if $sexDemandResult.lowerClass < 400>> +<<if $sexDemandResult.lowerClass < 350>> Your lower class citizens have @@.red;far too few options for sexual relief@@ inside your arcology. <<if $classSatisfied.lowerClass == 0>> They trust you will take care of this issue as soon as you are settled in.<br> <<else>> It is @@.red;causing dissatisfaction@@ among your lower class.<br> <</if>> -<<elseif $sexDemandResult.lowerClass < 600>> +<<elseif $sexDemandResult.lowerClass < 550>> Your lower class citizens need @@.red;some more avenues for sexual relief@@ inside your arcology. <<if $classSatisfied.lowerClass == 1>> They see @@.green;you are on the right track@@ and anticipate further improvements.<br> @@ -34,16 +34,16 @@ <<else>> It is @@.red;causing dissatisfaction@@ among your lower class.<br> <</if>> -<<elseif $sexDemandResult.lowerClass < 800>> +<<elseif $sexDemandResult.lowerClass < 750>> Your lower class citizens have no issue finding the sexual relief they need inside your arcology. <<if $classSatisfied.lowerClass == 1>> They are @@.green;delighted@@ with how quickly you've provided for them.<br> <<else>> <br> <</if>> -<<elseif $sexDemandResult.lowerClass < 1000>> +<<elseif $sexDemandResult.lowerClass < 950>> Your lower class citizens are @@.green;happy with the availability of sexual services@@ inside your arcology.<br> -<<elseif $sexDemandResult.lowerClass == 1000>> +<<elseif $sexDemandResult.lowerClass >= 950>> Your lower class citizens are @@.green;delighted with the abundance of sexual services@@ inside your arcology.<br> <</if>> Lower class satisfaction is at <<print $sexDemandResult.lowerClass/10>>%, <<print $NPCMarketShare.lowerClass/10>>% of the market is serviced by other suppliers operating inside your arcology.<br> @@ -61,14 +61,14 @@ Lower class satisfaction is at <<print $sexDemandResult.lowerClass/10>>%, <<prin <<run cashX($NPCSlaves.lowerClass * Math.pow($sexSubsidies.lowerClass, 2) * 0.25, "policies")>> <</if>> -<<if $sexDemandResult.middleClass < 400>> +<<if $sexDemandResult.middleClass < 350>> Your middle class citizens have @@.red;far too few options for sexual relief@@ inside your arcology. <<if $classSatisfied.middleClass == 0>> They trust you will take care of this issue as soon as you are settled in.<br> <<else>> It is @@.red;causing dissatisfaction@@ among your middle class.<br> <</if>> -<<elseif $sexDemandResult.middleClass < 600>> +<<elseif $sexDemandResult.middleClass < 550>> Your middle class citizens need @@.red;some more avenues for sexual relief@@ inside your arcology. <<if $classSatisfied.middleClass == 1>> They see @@.green;you are on the right track@@ and anticipate further improvements.<br> @@ -77,16 +77,16 @@ Lower class satisfaction is at <<print $sexDemandResult.lowerClass/10>>%, <<prin <<else>> It is @@.red;causing dissatisfaction@@ among your middle class.<br> <</if>> -<<elseif $sexDemandResult.middleClass < 800>> +<<elseif $sexDemandResult.middleClass < 750>> Your middle class citizens have no issue finding the sexual relief they need inside your arcology. <<if $classSatisfied.middleClass == 1>> They are @@.green;delighted@@ with how quickly you've provided for them.<br> <<else>> <br> <</if>> -<<elseif $sexDemandResult.middleClass < 1000>> +<<elseif $sexDemandResult.middleClass < 950>> Your middle class citizens are @@.green;happy with the availability of sexual services@@ inside your arcology.<br> -<<elseif $sexDemandResult.middleClass == 1000>> +<<elseif $sexDemandResult.middleClass >= 950>> Your middle class citizens are @@.green;delighted with the abundance of sexual services@@ inside your arcology.<br> <</if>> Middle class satisfaction is at <<print $sexDemandResult.middleClass/10>>%, <<print $NPCMarketShare.middleClass/10>>% of the market is serviced by other suppliers operating inside your arcology.<br> @@ -104,14 +104,14 @@ Middle class satisfaction is at <<print $sexDemandResult.middleClass/10>>%, <<pr <<run cashX($NPCSlaves.middleClass * Math.pow($sexSubsidies.middleClass, 2) * 0.25, "policies")>> <</if>> -<<if $sexDemandResult.upperClass < 400>> +<<if $sexDemandResult.upperClass < 350>> Your upper class citizens have @@.red;far too few options for sexual relief@@ inside your arcology. <<if $classSatisfied.upperClass == 0>> They trust you will take care of this issue as soon as you are settled in.<br> <<else>> It is @@.red;causing dissatisfaction@@ among your upper class.<br> <</if>> -<<elseif $sexDemandResult.upperClass < 600>> +<<elseif $sexDemandResult.upperClass < 550>> Your upper class citizens need @@.red;some more avenues for sexual relief@@ inside your arcology. <<if $classSatisfied.upperClass == 1>> They see @@.green;you are on the right track@@ and anticipate further improvements.<br> @@ -120,16 +120,16 @@ Middle class satisfaction is at <<print $sexDemandResult.middleClass/10>>%, <<pr <<else>> It is @@.red;causing dissatisfaction@@ among your upper class.<br> <</if>> -<<elseif $sexDemandResult.upperClass < 800>> +<<elseif $sexDemandResult.upperClass < 750>> Your upper class citizens have no issue finding the sexual relief they need inside your arcology. <<if $classSatisfied.upperClass == 1>> They are @@.green;delighted@@ with how quickly you've provided for them.<br> <<else>> <br> <</if>> -<<elseif $sexDemandResult.upperClass < 1000>> +<<elseif $sexDemandResult.upperClass < 950>> Your upper class citizens are @@.green;happy with the availability of sexual services@@ inside your arcology.<br> -<<elseif $sexDemandResult.upperClass == 1000>> +<<elseif $sexDemandResult.upperClass >= 950>> Your upper class citizens are @@.green;delighted with the abundance of sexual services@@ inside your arcology.<br> <</if>> Upper class satisfaction is at <<print $sexDemandResult.upperClass/10>>%, <<print $NPCMarketShare.upperClass/10>>% of the market is serviced by other suppliers operating inside your arcology.<br> @@ -147,14 +147,14 @@ Upper class satisfaction is at <<print $sexDemandResult.upperClass/10>>%, <<prin <<run cashX($NPCSlaves.upperClass * Math.pow($sexSubsidies.upperClass, 2) * 0.25, "policies")>> <</if>> -<<if $sexDemandResult.topClass < 400>> +<<if $sexDemandResult.topClass < 350>> Your arcology's millionaires have @@.red;far too few options for sexual relief@@ inside your arcology. <<if $classSatisfied.topClass == 0>> They trust you will take care of this issue as soon as you are settled in.<br> <<else>> It is @@.red;causing dissatisfaction@@ among your millionaires.<br> <</if>> -<<elseif $sexDemandResult.topClass < 600>> +<<elseif $sexDemandResult.topClass < 550>> Your arcology's millionaires need @@.red;some more avenues for sexual relief@@ inside your arcology. <<if $classSatisfied.topClass == 1>> They see @@.green;you are on the right track@@ and anticipate further improvements.<br> @@ -163,16 +163,16 @@ Upper class satisfaction is at <<print $sexDemandResult.upperClass/10>>%, <<prin <<else>> It is @@.red;causing dissatisfaction@@ among your millionaires.<br> <</if>> -<<elseif $sexDemandResult.topClass < 800>> +<<elseif $sexDemandResult.topClass < 750>> Your arcology's millionaires have no issue finding the sexual relief they need inside your arcology. <<if $classSatisfied.topClass == 1>> They are @@.green;delighted@@ with how quickly you've provided for them.<br> <<else>> <br> <</if>> -<<elseif $sexDemandResult.topClass < 1000>> +<<elseif $sexDemandResult.topClass < 950>> Your arcology's millionaires are @@.green;happy with the availability of sexual services@@ inside your arcology.<br> -<<elseif $sexDemandResult.topClass == 1000>> +<<elseif $sexDemandResult.topClass >= 950>> Your arcology's millionaires are @@.green;delighted with the abundance of sexual services@@ inside your arcology.<br> <</if>> Millionaire satisfaction is at <<print $sexDemandResult.topClass/10>>%, <<print $NPCMarketShare.topClass/10>>% of the market is serviced by other suppliers operating inside your arcology.<br> diff --git a/src/uncategorized/slaveAssignmentsReport.tw b/src/uncategorized/slaveAssignmentsReport.tw index b8ec2375276066a5439e1146aec0d51a0756593a..999c467f35541a292512b9d302e296abfa41cb56 100644 --- a/src/uncategorized/slaveAssignmentsReport.tw +++ b/src/uncategorized/slaveAssignmentsReport.tw @@ -106,28 +106,28 @@ _middleClassClubRatio = (_middleClassSexDemand + _visitorsSexDemand) / _clubDema /*Brothel or street whore sex supply*/ <<if _lowerClassSexDemand < $slaveJobValues.brothel.lowerClass>> - <<set $whorePriceAdjustment.lowerClass = Math.pow(_lowerClassSexDemand / ($slaveJobValues.brothel.lowerClass + $NPCSexSupply.lowerClass), 2), + <<set $whorePriceAdjustment.lowerClass = Math.max(Math.pow(_lowerClassSexDemand / ($slaveJobValues.brothel.lowerClass + $NPCSexSupply.lowerClass), 2), 0.25), _lowerClassSexDemand = 0>> /*This accounts for people having too much choice and getting more picky how they spend their money*/ <<else>> <<set $whorePriceAdjustment.lowerClass = Math.pow(_lowerClassSexDemand / ($slaveJobValues.brothel.lowerClass + $NPCSexSupply.lowerClass), 0.25), _lowerClassSexDemand -= $slaveJobValues.brothel.lowerClass>> /* People are willing to pay more for a scarce good, but within reason */ <</if>> <<if _middleClassSexDemand < $slaveJobValues.brothel.middleClass>> - <<set $whorePriceAdjustment.middleClass = Math.pow(_middleClassSexDemand / ($slaveJobValues.brothel.middleClass + $NPCSexSupply.middleClass), 2), + <<set $whorePriceAdjustment.middleClass = Math.max(Math.pow(_middleClassSexDemand / ($slaveJobValues.brothel.middleClass + $NPCSexSupply.middleClass), 2), 0.25), _middleClassSexDemand = 0>> <<else>> <<set $whorePriceAdjustment.middleClass = Math.pow(_middleClassSexDemand / ($slaveJobValues.brothel.middleClass + $NPCSexSupply.middleClass), 0.25), _middleClassSexDemand -= $slaveJobValues.brothel.middleClass>> <</if>> <<if _upperClassSexDemand < $slaveJobValues.brothel.upperClass>> - <<set $whorePriceAdjustment.upperClass = Math.pow(_upperClassSexDemand / ($slaveJobValues.brothel.upperClass + $NPCSexSupply.upperClass), 2), + <<set $whorePriceAdjustment.upperClass = Math.max(Math.pow(_upperClassSexDemand / ($slaveJobValues.brothel.upperClass + $NPCSexSupply.upperClass), 2), 0.25), _upperClassSexDemand = 0>> <<else>> <<set $whorePriceAdjustment.upperClass = Math.pow(_upperClassSexDemand / ($slaveJobValues.brothel.upperClass + $NPCSexSupply.upperClass), 0.25), _upperClassSexDemand -= $slaveJobValues.brothel.upperClass>> <</if>> <<if _topClassSexDemand < $slaveJobValues.brothel.topClass>> - <<set $whorePriceAdjustment.topClass = Math.pow(_topClassSexDemand / ($slaveJobValues.brothel.topClass + $NPCSexSupply.topClass), 2), + <<set $whorePriceAdjustment.topClass = Math.max(Math.pow(_topClassSexDemand / ($slaveJobValues.brothel.topClass + $NPCSexSupply.topClass), 2), 0.25), _topClassSexDemand = 0>> <<else>> <<set $whorePriceAdjustment.topClass = Math.pow(_topClassSexDemand / ($slaveJobValues.brothel.topClass + $NPCSexSupply.topClass), 0.25),