diff --git a/src/endWeek/saWhore.js b/src/endWeek/saWhore.js index 4740fdb5de8a6dab1e4180083f8393df84c8a94a..d708582c399aba9e11b460d9c3156c08e1d32fc4 100644 --- a/src/endWeek/saWhore.js +++ b/src/endWeek/saWhore.js @@ -7,7 +7,6 @@ window.saWhore = (function saWhore() { // if the following are set outside this file, they must be set in it too! let beauty; - let eligableClass; let customers; let FuckResult; let cash; @@ -86,18 +85,23 @@ window.saWhore = (function saWhore() { */ function updateNonSlaveVariables(slave) { // FuckResult and FuckAmount setting - FuckResult = slave.sexQuality; beauty = slave.sexAmount; T.incomeStats.customers = beauty; - eligableClass = eligableWhoreClass(slave); - if (eligableClass === 4) { + if (slave.effectiveWhoreClass === 4) { customers = "extremely wealthy"; - } else if (eligableClass === 3) { + FuckResult = Math.trunc(slave.sexQuality * V.whorePriceAdjustment.topClass); + } else if (slave.effectiveWhoreClass === 3) { customers = "upper class"; - } else if (eligableClass === 2) { + FuckResult = Math.trunc(slave.sexQuality * V.whorePriceAdjustment.upperClass); + } else if (slave.effectiveWhoreClass === 2) { customers = "middle class"; - } else { + FuckResult = Math.trunc(slave.sexQuality * V.whorePriceAdjustment.middleClass); + } else if (slave.effectiveWhoreClass === 1) { customers = "lower class"; + FuckResult = Math.trunc(slave.sexQuality * V.whorePriceAdjustment.lowerClass); + } else { + customers = "ERROR"; + FuckResult = "ERROR"; } } @@ -1271,14 +1275,18 @@ window.saWhore = (function saWhore() { */ function addCash(slave) { let whoreScore = slave.sexAmount * slave.sexQuality; // The standard amount of money the whore is expected to make in a week - if (whoreScore > 9600 && slave.skill.whore > 80) { // whoreScore threshold updated to reflect tier specific bonus/penalty + if (slave.effectiveWhoreClass === 4) { cash = Math.trunc(whoreScore * V.whorePriceAdjustment.topClass); // final price adjustment for supply and demand - } else if (whoreScore > 5250 && slave.skill.whore > 50) { + 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); - } else if (whoreScore > 1800) { + 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); } if (slave.assignment === "work in the brothel") { cashX(cash, "whoreBrothel", slave); diff --git a/src/init/storyInit.tw b/src/init/storyInit.tw index 5a43ad7bad688ff3f58a5ca82e0a177012f069e2..b5e1a32bf7634d916b82064b4abcc2d4754bd544 100644 --- a/src/init/storyInit.tw +++ b/src/init/storyInit.tw @@ -1143,20 +1143,18 @@ You should have received a copy of the GNU General Public License along with thi <<set $lowerClass = 3120>> <<set $LSCBase = 800>> <<set $visitors = 0>> +<<set $rentDefaults = {lowerClass: 20, middleClass: 50, upperClass: 180, topClass: 650}>> +<<set $rent = {lowerClass: 20, middleClass: 50, upperClass: 180, topClass: 650}>> <<set $rentEffectL = 1>> -<<set $LCRent = 20>> <<set $middleClass = 890>> <<set $MCBase = 200>> <<set $rentEffectM = 1>> -<<set $MCRent = 50>> <<set $upperClass = 200>> <<set $UCBase = 40>> <<set $rentEffectU = 1>> -<<set $UCRent = 175>> <<set $topClass = 40>> <<set $TCBase = 20>> <<set $rentEffectT = 1>> -<<set $TCRent = 650>> <<set $GDP = 278.6>> <<set $NPCSlaves = 900>> <<set $ASlaves = 900>> diff --git a/src/js/datatypeCleanupJS.js b/src/js/datatypeCleanupJS.js index 4d46c6728768fed7b5d0e798765ce3cf08d3b555..0ae81158ca900e8266527d6b3c197bd59f3aeb55 100644 --- a/src/js/datatypeCleanupJS.js +++ b/src/js/datatypeCleanupJS.js @@ -1656,57 +1656,31 @@ window.EconomyDatatypeCleanup = function EconomyDatatypeCleanup() { V.NPCSexSupply.middleClass = Math.max(+V.NPCSexSupply.middleClass, 0) || 0; V.NPCSexSupply.upperClass = Math.max(+V.NPCSexSupply.upperClass, 0) || 0; V.NPCSexSupply.topClass = Math.max(+V.NPCSexSupply.topClass, 0) || 0; + + V.rentDefaults.lowerClass = Math.max(+V.rentDefaults.lowerClass, 0) || 20; /* nowhere modified */ + V.rentDefaults.middleClass = Math.max(+V.rentDefaults.middleClass, 0) || 50; /* nowhere modified */ + V.rentDefaults.upperClass = Math.max(+V.rentDefaults.upperClass, 0) || 180; /* nowhere modified */ + V.rentDefaults.topClass = Math.max(+V.rentDefaults.topClass, 0) || 650; /* nowhere modified */ + if (V.whoreBudget.lowerClass) { V.whoreBudget.lowerClass = Math.max(+V.whoreBudget.lowerClass, 8) || 10; - } else if (V.LCRent > 30) { - V.whoreBudget.lowerClass = 8; - } else if (V.LCRent > 20) { - V.whoreBudget.lowerClass = 9; - } else if (V.LCRent > 10) { - V.whoreBudget.lowerClass = 10; - } else if (V.LCRent > 0) { - V.whoreBudget.lowerClass = 11; } else { - V.whoreBudget.lowerClass = 12; + V.whoreBudget.lowerClass = (0.8 + (V.rent.lowerClass / V.rentDefaults.lowerClass) / 5) * 10; } if (V.whoreBudget.middleClass) { V.whoreBudget.middleClass = Math.max(+V.whoreBudget.middleClass, 40) || 50; - } else if (V.MCRent > 75) { - V.whoreBudget.middleClass = 40; - } else if (V.MCRent > 50) { - V.whoreBudget.middleClass = 45; - } else if (V.MCRent > 25) { - V.whoreBudget.middleClass = 50; - } else if (V.MCRent > 0) { - V.whoreBudget.middleClass = 55; } else { - V.whoreBudget.middleClass = 60; + V.whoreBudget.middleClass = (0.8 + (V.rent.middleClass / V.rentDefaults.middleClass) / 5) * 50; } if (V.whoreBudget.upperClass) { V.whoreBudget.upperClass = Math.max(+V.whoreBudget.upperClass, 200) || 250; - } else if (V.UCRent > 270) { - V.whoreBudget.upperClass = 200; - } else if (V.UCRent > 180) { - V.whoreBudget.upperClass = 225; - } else if (V.UCRent > 90) { - V.whoreBudget.upperClass = 250; - } else if (V.UCRent > 0) { - V.whoreBudget.upperClass = 275; } else { - V.whoreBudget.upperClass = 300; + V.whoreBudget.upperClass = (0.8 + (V.rent.upperClass / V.rentDefaults.upperClass) / 5) * 250; } if (V.whoreBudget.topClass) { - V.whoreBudget.topClass = Math.max(+V.whoreBudget.upperClass, 1200) || 1500; - } else if (V.TCRent > 975) { - V.whoreBudget.topClass = 1200; - } else if (V.TCRent > 650) { - V.whoreBudget.topClass = 1350; - } else if (V.TCRent > 325) { - V.whoreBudget.topClass = 1500; - } else if (V.TCRent > 0) { - V.whoreBudget.topClass = 1650; + V.whoreBudget.topClass = Math.max(+V.whoreBudget.topClass, 1200) || 1500; } else { - V.whoreBudget.topClass = 1800; + V.whoreBudget.topClass = (0.8 + (V.rent.topClass / V.rentDefaults.topClass) / 5) * 1500; } V.NPCMarketShare.lowerClass = Math.clamp(+V.NPCMarketShare.lowerClass, 0, 1000) || 0; V.NPCMarketShare.middleClass = Math.clamp(+V.NPCMarketShare.middleClass, 0, 1000) || 0; @@ -1724,35 +1698,23 @@ window.EconomyDatatypeCleanup = function EconomyDatatypeCleanup() { if (V.lowerClass !== 0) { V.lowerClass = Math.max(+V.lowerClass, 0) || 3120; } - if (V.LCRent !== 0) { - V.LCRent = Math.max(+V.LCRent, 0) || 20; - } V.MCBase = Math.max(+V.MCBase, 0) || 200; /* nowhere modified */ V.rentEffectM = Math.max(+V.rentEffectM, 0) || 1; if (V.middleClass !== 0) { V.middleClass = Math.max(+V.middleClass, 0) || 890; } - if (V.MCRent !== 0) { - V.MCRent = Math.max(+V.MCRent, 0) || 50; - } V.UCBase = Math.max(+V.UCBase, 0) || 40; /* nowhere modified */ V.rentEffectU = Math.max(+V.rentEffectU, 0) || 1; if (V.upperClass !== 0) { V.upperClass = Math.max(+V.upperClass, 0) || 200; } - if (V.UCRent !== 0) { - V.UCRent = Math.max(+V.UCRent, 0) || 175; - } V.TCBase = Math.max(+V.TCBase, 0) || 20; /* nowhere modified */ V.rentEffectT = Math.max(+V.rentEffectT, 0) || 1; if (V.topClass !== 0) { - V.topClass = Math.max(+V.topClass, 0) || 38; - } - if (V.TCRent !== 0) { - V.TCRent = Math.max(+V.TCRent, 0) || 650; + V.topClass = Math.max(+V.topClass, 0) || 40; } }; diff --git a/src/js/economyJS.js b/src/js/economyJS.js index e23a1d0d87eef598ac38496883b4e8e8f9b8d628..8ee3b59ba157934e03c31c9b036a6d94c1c5e86e 100644 --- a/src/js/economyJS.js +++ b/src/js/economyJS.js @@ -878,7 +878,7 @@ window.menialSlaveCost = function(q = 0) { return (Math.trunc(baseCost + demand / 400 - supply / 400 + q / 400) + random); }; -window.NPCSexSupply = function(LC, MC, UC, TC) { +window.NPCSexSupply = function(lowerDemandLeft, middleDemandLeft, upperDemandLeft, topDemandLeft) { const NPCSexSupply = { lowerClass: V.NPCSexSupply.lowerClass, middleClass: V.NPCSexSupply.middleClass, @@ -887,43 +887,51 @@ window.NPCSexSupply = function(LC, MC, UC, TC) { }; // Lower class calculations - LC += V.sexSubsidies.lowerClass / 10 - V.sexSupplyBarriers.lowerClass / 20; - if (LC >= 0.5) { - NPCSexSupply.lowerClass += Math.max(Math.trunc(NPCSexSupply.lowerClass * ((LC - 0.5) * (0.2 - V.sexSupplyBarriers.lowerClass / 25))), (50 * (1 - V.sexSupplyBarriers.lowerClass / 5))); // Max growth of 10% per week, unless it is really low, than a flat 50 - } else if (LC < 0.5) { - if (NPCSexSupply.lowerClass > V.lowerClass * (3 - V.sexSupplyBarriers.lowerClass / 2)) { // Natural market share of competitors is at least 30% - NPCSexSupply.lowerClass -= Math.trunc(NPCSexSupply.lowerClass * ((0.5 - LC) / 5)); // Max reduction of 10% per week - } + const lowerClassNPCRatio = NPCSexSupply.lowerClass / (lowerDemandLeft + NPCSexSupply.lowerClass); + const lowerClassOptimalRatio = 0.5 + V.sexSubsidies.lowerClass / 10 - V.sexSupplyBarriers.lowerClass / 10; + const lowerClassOptimal = (NPCSexSupply.lowerClass + lowerDemandLeft) * lowerClassOptimalRatio; + if (lowerClassNPCRatio >= lowerClassOptimalRatio + 0.05) { // NPCs provide more than they really care to and some wish to stop providing sexual services, max reduction of 10% of previous + NPCSexSupply.lowerClass -= Math.min(NPCSexSupply.lowerClass - Math.trunc((NPCSexSupply.lowerClass * 4 + lowerClassOptimal) / 5), Math.trunc(NPCSexSupply.lowerClass * 0.1)); + } else if (lowerClassNPCRatio <= lowerClassOptimalRatio - 0.05) { // NPCs see business opportunities and provide more sexual services, minimum increse of 500, max of 10% of previous + NPCSexSupply.lowerClass += Math.trunc(Math.clamp((NPCSexSupply.lowerClass * 4 + lowerClassOptimal) / 5 - NPCSexSupply.lowerClass, 500, NPCSexSupply.lowerClass * 0.1) * (1 - V.sexSupplyBarriers / 5)); // Slow down NPC growth through beauraucracy + } else { + NPCSexSupply.lowerClass = Math.trunc(NPCSexSupply.lowerClass * (1 + normalRandInt(0, 20) / 1000)); // Some random fluxuations whenever the NPC supply is roughly on target. } // Middle class calculations - MC += V.sexSubsidies.middleClass / 10 - V.sexSupplyBarriers.middleClass / 20; - if (MC >= 0.5) { - NPCSexSupply.middleClass += Math.max(Math.trunc(NPCSexSupply.lowerClass * ((MC - 0.5) * (0.2 - V.sexSupplyBarriers.middleClass / 25))), (50 * (1 - V.sexSupplyBarriers.middleClass / 5))); // Max growth of 10% per week, unless it is really low, than a flat 50 - } else if (MC < 0.5) { - if (NPCSexSupply.middleClass > V.middleClass * (15 - V.sexSupplyBarriers.middleClass / 0.4)) { // Natural market share of competitors is at least 30% - NPCSexSupply.middleClass -= Math.trunc(NPCSexSupply.middleClass * ((0.5 - MC) / 5)); // Max reduction of 10% per week - } + const middleClassNPCRatio = NPCSexSupply.middleClass / (middleDemandLeft + NPCSexSupply.middleClass); + const middleClassOptimalRatio = 0.5 + V.sexSubsidies.middleClass / 10 - V.sexSupplyBarriers.middleClass / 10; + const middleClassOptimal = (NPCSexSupply.middleClass + middleDemandLeft) * middleClassOptimalRatio; + if (middleClassNPCRatio >= middleClassOptimalRatio + 0.05) { + NPCSexSupply.middleClass -= Math.min(NPCSexSupply.middleClass - Math.trunc((NPCSexSupply.middleClass * 4 + middleClassOptimal) / 5), Math.trunc(NPCSexSupply.middleClass * 0.1)); + } else if (middleClassNPCRatio <= middleClassOptimalRatio - 0.05) { + NPCSexSupply.middleClass += Math.trunc(Math.clamp((NPCSexSupply.middleClass * 4 + middleClassOptimal) / 5 - NPCSexSupply.middleClass, 500, NPCSexSupply.middleClass * 0.1) * (1 - V.sexSupplyBarriers / 5)); + } else { + NPCSexSupply.middleClass = Math.trunc(NPCSexSupply.middleClass * (1 + normalRandInt(0, 20) / 1000)); } - // upper class calculations - UC += V.sexSubsidies.upperClass / 10 - V.sexSupplyBarriers.upperClass / 20; - if (UC >= 0.5) { - NPCSexSupply.upperClass += Math.max(Math.trunc(NPCSexSupply.upperClass * ((UC - 0.5) * (0.2 - V.sexSupplyBarriers.upperClass / 25))), (50 * (1 - V.sexSupplyBarriers.upperClass / 5))); // Max growth of 10% per week, unless it is really low, than a flat 50 - } else if (UC < 0.5) { - if (NPCSexSupply.upperClass > V.upperClass * (120 - V.sexSupplyBarriers.upperClass / 0.05)) { // Natural market share of competitors is at least 30% - NPCSexSupply.upperClass -= Math.trunc(NPCSexSupply.upperClass * ((0.5 - UC) / 5)); // Max reduction of 10% per week - } + // Upper class Calculations + const upperClassNPCRatio = NPCSexSupply.upperClass / (upperDemandLeft + NPCSexSupply.upperClass); + const upperClassOptimalRatio = 0.5 + V.sexSubsidies.upperClass / 10 - V.sexSupplyBarriers.upperClass / 10; + const upperClassOptimal = (NPCSexSupply.upperClass + upperDemandLeft) * upperClassOptimalRatio; + if (upperClassNPCRatio >= upperClassOptimalRatio + 0.05) { + NPCSexSupply.upperClass -= Math.min(NPCSexSupply.upperClass - Math.trunc((NPCSexSupply.upperClass * 4 + upperClassOptimal) / 5), Math.trunc(NPCSexSupply.upperClass * 0.1)); + } else if (upperClassNPCRatio <= upperClassOptimalRatio - 0.05) { + NPCSexSupply.upperClass += Math.trunc(Math.clamp((NPCSexSupply.upperClass * 4 + upperClassOptimal) / 5 - NPCSexSupply.upperClass, 500, NPCSexSupply.upperClass * 0.1) * (1 - V.sexSupplyBarriers / 5)); + } else { + NPCSexSupply.upperClass = Math.trunc(NPCSexSupply.upperClass * (1 + normalRandInt(0, 20) / 1000)); } - // top class calculations - TC += V.sexSubsidies.topClass / 10 - V.sexSupplyBarriers.topClass / 20; - if (TC >= 0.5) { - NPCSexSupply.topClass += Math.max(Math.trunc(NPCSexSupply.topClass * ((TC - 0.5) * (0.2 - V.sexSupplyBarriers.topClass / 25))), (50 * (1 - V.sexSupplyBarriers.topClass / 5))); // Max growth of 10% per week, unless it is really low, than a flat 50 - } else if (TC < 0.5) { - if (NPCSexSupply.topClass > V.topClass * (1200 - V.sexSupplyBarriers.topClass / 0.005)) { // Natural market share of competitors is at least 30% - NPCSexSupply.topClass -= Math.trunc(NPCSexSupply.topClass * ((0.5 - TC) / 5)); // Max reduction of 10% per week - } + // Top class calculations + const topClassNPCRatio = NPCSexSupply.topClass / (topDemandLeft + NPCSexSupply.topClass); + const topClassOptimalRatio = 0.5 + V.sexSubsidies.topClass / 10 - V.sexSupplyBarriers.topClass / 10; + const topClassOptimal = (NPCSexSupply.topClass + topDemandLeft) * topClassOptimalRatio; + if (topClassNPCRatio >= topClassOptimalRatio + 0.05) { + 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) { + NPCSexSupply.topClass += Math.trunc(Math.clamp((NPCSexSupply.topClass * 4 + topClassOptimal) / 5 - NPCSexSupply.topClass, 500, NPCSexSupply.topClass * 0.1) * (1 - V.sexSupplyBarriers / 5)); + } else { + NPCSexSupply.topClass = Math.trunc(NPCSexSupply.topClass * (1 + normalRandInt(0, 20) / 1000)); } return NPCSexSupply; @@ -1553,45 +1561,43 @@ window.slaveJobValues = function() { s.sexQuality += 2; brothelSpots -= 1; } + if (s.sexQuality < 2) { + s.sexQuality = 2; + } + + s.sexQualityRaw = s.sexQuality; + s.sexAmountRaw = s.sexAmount; // 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). - function whoreScore(s, whoreClass) { - let score = s.sexAmount * s.sexQuality; // The standard amount of money the whore is expected to make in a week - let tempClass = eligableWhoreClass(whoreClass); + function whoreScore(s) { + let income = s.sexAmount * s.sexQuality; + effectiveWhoreClass(s); // Calculate the stats - if (tempClass === 4) { - score = Math.trunc(score * 1.2); // 20% bonus to score for being of the heighest tier - s.sexAmount = jsRandom(60, 80); // Bringing sex amount into the desired range - s.sexQuality = Math.trunc(score / s.sexAmount); // Adjusting the price to the correct sex amount - slaveJobValues.brothel.topClass += score; // Registering the job value in the right slot - } else if (tempClass === 3) { - score = Math.trunc(score * 1.05); - s.sexAmount = jsRandom(85, 105); - s.sexQuality = Math.min(Math.trunc(score / s.sexAmount), V.whoreBudget.upperClass * 0.6); // The upper class will pay a maximum of 0.6 times their weekly budget per service - slaveJobValues.brothel.upperClass += Math.min(score, s.sexAmount * V.whoreBudget.upperClass * 0.6); - } else if (tempClass === 2) { - score = Math.trunc(score * 0.9); - s.sexAmount = jsRandom(100, 120); - s.sexQuality = Math.min(Math.trunc(score / s.sexAmount), V.whoreBudget.middleClass); // The middle class will pay a maximum of their weekly budget per service - slaveJobValues.brothel.middleClass += Math.min(score, s.sexAmount * V.whoreBudget.middleClass); + if (s.effectiveWhoreClass === 4) { + s.sexAmount = jsRandom(40, 60); // 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 + slaveJobValues.brothel.topClass += 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 = jsRandom(50, 70); + s.sexQuality = Math.min(Math.trunc((income * 1.05) / s.sexAmount), V.whoreBudget.upperClass * 0.5); // The upper class will pay a maximum of 0.5 times their weekly budget per service + slaveJobValues.brothel.upperClass += Math.min(s.sexAmount * s.sexQuality, s.sexAmount * V.whoreBudget.upperClass * 0.5); + } else if (s.effectiveWhoreClass === 2) { + s.sexAmount = jsRandom(60, 80); + s.sexQuality = Math.min(Math.trunc((income * 0.9) / s.sexAmount), V.whoreBudget.middleClass); // The middle class will pay a maximum of their weekly budget per service + slaveJobValues.brothel.middleClass += Math.min(s.sexAmount * s.sexQuality, s.sexAmount * V.whoreBudget.middleClass); } else { - score = Math.trunc(score * 0.75); - s.sexAmount = jsRandom(110, 140); - s.sexQuality = Math.min(Math.trunc(score / s.sexAmount), V.whoreBudget.lowerClass * 1.5); // The lower class will pay a maximum of 1.5 times their weekly budget per service - slaveJobValues.brothel.lowerClass += Math.min(score, s.sexAmount * V.whoreBudget.lowerClass * 1.5); + s.sexAmount = jsRandom(70, 90); + s.sexQuality = Math.clamp((income * 0.75) / s.sexAmount, 2, V.whoreBudget.lowerClass * 2); // The lower class will pay a maximum of 2 times their weekly budget per service and a minimum of 3 + slaveJobValues.brothel.lowerClass += Math.min(s.sexAmount * s.sexQuality, s.sexAmount * V.whoreBudget.lowerClass * 2); } } - if (s.assignment === "work in the brothel") { - if (!s.whoreClass) { - s.whoreClass = 0; - } - whoreScore(s, s.whoreClass); - } else { - whoreScore(s, 0); + if (typeof s.whoreClass === 'undefined') { + s.whoreClass = 0; } + whoreScore(s); } // Saturation penalty for public servants. Even the most beautiful slaves lose some of their shine if they have too much competition. @@ -1601,26 +1607,26 @@ window.slaveJobValues = function() { return slaveJobValues; }; -window.eligableWhoreClass = function(s) { - let tempClass; +window.effectiveWhoreClass = function(s) { let score = s.sexAmount * s.sexQuality; if (typeof s.whoreClass === 'undefined' || s.whoreClass === 0) { - tempClass = 4; + s.effectiveWhoreClass = 4; + } else if (s.assignment !== "work in the brothel") { + s.effectiveWhoreClass = 4; } else { - tempClass = s.whoreClass; + s.effectiveWhoreClass = s.whoreClass; } // Find maximum eligable class // these could be refined further if needed. - if (tempClass === 4 && !(score > 7000 && s.skill.whore > 80 && s.skill.entertainment > 50)) { - tempClass -= 1; + if (s.effectiveWhoreClass === 4 && !(score > 5000 && s.skill.whore > 80 && s.skill.entertainment > 50)) { + s.effectiveWhoreClass -= 1; } - if (tempClass === 3 && !(score > 3000 && s.skill.whore > 50)) { - tempClass -= 1; + if (s.effectiveWhoreClass === 3 && !(score > 2500 && s.skill.whore > 50)) { + s.effectiveWhoreClass -= 1; } - if (tempClass === 2 && !(score > 1250)) { - tempClass -= 1; + if (s.effectiveWhoreClass === 2 && (score <= 1000)) { + s.effectiveWhoreClass -= 1; } - return tempClass; }; window.getSlaveStatisticData = function(s, facility) { diff --git a/src/uncategorized/BackwardsCompatibility.tw b/src/uncategorized/BackwardsCompatibility.tw index 45513dd26e9675a4fe99eb935bd8f2ca8add0754..cdc3f3da60de0a384c00c5c76b36cf9b2c3c3a00 100644 --- a/src/uncategorized/BackwardsCompatibility.tw +++ b/src/uncategorized/BackwardsCompatibility.tw @@ -325,6 +325,28 @@ <<if def $rents>> <<unset $rents>> <</if>> +<<if ndef $rent>> + <<set $rent = {}>> +<</if>> +<<if ndef $rentDefaults>> + <<set $rentDefaults = {}>> +<</if>> +<<if def $LCRent>> + <<set $rent.lowerClass = $LCRent>> + <<unset $LCRent>> +<</if>> +<<if def $MCRent>> + <<set $rent.middleClass = $MCRent>> + <<unset $MCRent>> +<</if>> +<<if def $UCRent>> + <<set $rent.upperClass = $UCRent>> + <<unset $UCRent>> +<</if>> +<<if def $TCRent>> + <<set $rent.topClass = $TCRent>> + <<unset $TCRent>> +<</if>> <<if def $space>> <<unset $space>> <</if>> diff --git a/src/uncategorized/arcmgmt.tw b/src/uncategorized/arcmgmt.tw index cb190cee293b31cff07d4ba8b3e8db0f841f8eaa..d0262c42fe51eb33c2d3fa5580fa03a9e6d1442b 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 == 1>> +<<if $sexDemandResult.lowerClass < 400>> 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 == 2>> +<<elseif $sexDemandResult.lowerClass < 600>> 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,19 +34,19 @@ <<else>> It is @@.red;causing dissatisfaction@@ among your lower class. <</if>> -<<elseif $sexDemandResult.lowerClass == 3>> +<<elseif $sexDemandResult.lowerClass < 800>> 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 == 4>> +<<elseif $sexDemandResult.lowerClass < 1000>> Your lower class citizens are @@.green;happy with the availability of sexual services@@ inside your arcology.<br> -<<elseif $sexDemandResult.lowerClass == 5>> +<<elseif $sexDemandResult.lowerClass == 1000>> Your lower class citizens are @@.green;delighted with the abundance of sexual services@@ inside your arcology.<br> <</if>> -<<print $NPCMarketShare.lowerClass/10>>% of the lower class market is serviced by other suppliers operating inside your arcology.<br> +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> <<if $sexSupplyBarriers.lowerClass == 1>> <<run cashX(1000, "policies")>> @@ -61,35 +61,35 @@ <<run cashX($NPCSlaves.lowerClass * Math.pow($sexSubsidies.lowerClass, 2) * 0.25, "policies")>> <</if>> -<<if $sexDemandResult.middleClass == 1>> - Your lower class citizens have @@.red;far too few options for sexual relief@@ inside your arcology. +<<if $sexDemandResult.middleClass < 400>> + 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 lower class.<br> + It is @@.red;causing dissatisfaction@@ among your middle class.<br> <</if>> -<<elseif $sexDemandResult.middleClass == 2>> - Your lower class citizens need @@.red;some more avenues for sexual relief@@ inside your arcology. +<<elseif $sexDemandResult.middleClass < 600>> + 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> <<elseif $classSatisfied.middleClass == 0>> Their patience is being tested.<br> <<else>> - It is @@.red;causing dissatisfaction@@ among your lower class. + It is @@.red;causing dissatisfaction@@ among your middle class. <</if>> -<<elseif $sexDemandResult.middleClass == 3>> - Your lower class citizens have no issue finding the sexual relief they need inside your arcology. +<<elseif $sexDemandResult.middleClass < 800>> + 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 == 4>> - Your lower class citizens are @@.green;happy with the availability of sexual services@@ inside your arcology.<br> -<<elseif $sexDemandResult.middleClass == 5>> - Your lower class citizens are @@.green;delighted with the abundance of sexual services@@ inside your arcology.<br> +<<elseif $sexDemandResult.middleClass < 1000>> + Your middle class citizens are @@.green;happy with the availability of sexual services@@ inside your arcology.<br> +<<elseif $sexDemandResult.middleClass == 1000>> + Your middle class citizens are @@.green;delighted with the abundance of sexual services@@ inside your arcology.<br> <</if>> -<<print $NPCMarketShare.middleClass/10>>% of the lower class market is serviced by other suppliers operating inside your arcology.<br> +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> <<if $sexSupplyBarriers.middleClass == 1>> <<run cashX(1000, "policies")>> @@ -104,35 +104,35 @@ <<run cashX($NPCSlaves.middleClass * Math.pow($sexSubsidies.middleClass, 2) * 0.25, "policies")>> <</if>> -<<if $sexDemandResult.upperClass == 1>> - Your lower class citizens have @@.red;far too few options for sexual relief@@ inside your arcology. +<<if $sexDemandResult.upperClass < 400>> + 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 lower class.<br> + It is @@.red;causing dissatisfaction@@ among your upper class.<br> <</if>> -<<elseif $sexDemandResult.upperClass == 2>> - Your lower class citizens need @@.red;some more avenues for sexual relief@@ inside your arcology. +<<elseif $sexDemandResult.upperClass < 600>> + 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> <<elseif $classSatisfied.upperClass == 0>> Their patience is being tested.<br> <<else>> - It is @@.red;causing dissatisfaction@@ among your lower class. + It is @@.red;causing dissatisfaction@@ among your upper class. <</if>> -<<elseif $sexDemandResult.upperClass == 3>> - Your lower class citizens have no issue finding the sexual relief they need inside your arcology. +<<elseif $sexDemandResult.upperClass < 800>> + 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 == 4>> - Your lower class citizens are @@.green;happy with the availability of sexual services@@ inside your arcology.<br> -<<elseif $sexDemandResult.upperClass == 5>> - Your lower class citizens are @@.green;delighted with the abundance of sexual services@@ inside your arcology.<br> +<<elseif $sexDemandResult.upperClass < 1000>> + Your upper class citizens are @@.green;happy with the availability of sexual services@@ inside your arcology.<br> +<<elseif $sexDemandResult.upperClass == 1000>> + Your upper class citizens are @@.green;delighted with the abundance of sexual services@@ inside your arcology.<br> <</if>> -<<print $NPCMarketShare.upperClass/10>>% of the lower class market is serviced by other suppliers operating inside your arcology.<br> +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> <<if $sexSupplyBarriers.upperClass == 1>> <<run cashX(1000, "policies")>> @@ -147,35 +147,35 @@ <<run cashX($NPCSlaves.upperClass * Math.pow($sexSubsidies.upperClass, 2) * 0.25, "policies")>> <</if>> -<<if $topClassSexDemandResult == 1>> - Your lower class citizens have @@.red;far too few options for sexual relief@@ inside your arcology. - <<if $topClassSatisfied == 0>> +<<if $sexDemandResult.topClass < 400>> + 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 lower class.<br> <</if>> -<<elseif $topClassSexDemandResult == 2>> - Your lower class citizens need @@.red;some more avenues for sexual relief@@ inside your arcology. - <<if $topClassSatisfied == 1>> +<<elseif $sexDemandResult.topClass < 600>> + 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> - <<elseif $topClassSatisfied == 0>> + <<elseif $classSatisfied.topClass == 0>> Their patience is being tested.<br> <<else>> It is @@.red;causing dissatisfaction@@ among your lower class. <</if>> -<<elseif $topClassSexDemandResult == 3>> - Your lower class citizens have no issue finding the sexual relief they need inside your arcology. - <<if $topClassSatisfied == 1>> +<<elseif $sexDemandResult.topClass < 800>> + 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 $topClassSexDemandResult == 4>> - Your lower class citizens are @@.green;happy with the availability of sexual services@@ inside your arcology.<br> -<<elseif $topClassSexDemandResult == 5>> - Your lower class citizens are @@.green;delighted with the abundance of sexual services@@ inside your arcology.<br> +<<elseif $sexDemandResult.topClass < 1000>> + Your arcology's millionaires are @@.green;happy with the availability of sexual services@@ inside your arcology.<br> +<<elseif $sexDemandResult.topClass == 1000>> + Your arcology's millionaires are @@.green;delighted with the abundance of sexual services@@ inside your arcology.<br> <</if>> -<<print $NPCMarketShare.topClass/10>>% of the lower class market is serviced by other suppliers operating inside your arcology.<br> +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> <<if $sexSupplyBarriers.topClass == 1>> <<run cashX(1000, "policies")>> @@ -1177,9 +1177,9 @@ _SCD = Math.trunc(($upperClass * (2 + _slaveDemandU)) + ($topClass * (12 + _slav <br>@@.red;MCD is NaN, report this issue!@@ <<else>> /*Middle Class Citizens immigrating*/ <<if $classSatisfied.middleClass < 0>> - Your middle class is @@.red;sexually frustrated@@ and would rather live elsewhere. + <br>Your middle class is @@.red;sexually frustrated@@ and would rather live elsewhere. <<elseif $classSatisfied.middleClass > 0>> - Your middle class is @@.green;sexually satiated@@ and their happiness attracts others. + <br>Your middle class is @@.green;sexually satiated@@ and their happiness attracts others. <</if>> <<if $middleClass < _MCD>> <<set _MCImmigration = Math.trunc((_MCD - $middleClass) * (0.3 * _terrain)) + 1, @@ -1211,9 +1211,9 @@ _SCD = Math.trunc(($upperClass * (2 + _slaveDemandU)) + ($topClass * (12 + _slav <br>@@.red;UCD is NaN, report this issue!@@ <<else>> /*Upper Class Citizens immigrating*/ <<if $classSatisfied.upperClass < 0>> - Your upper class is @@.red;sexually frustrated@@ and would rather live elsewhere. + <br>Your upper class is @@.red;sexually frustrated@@ and would rather live elsewhere. <<elseif $classSatisfied.upperClass > 0>> - Your upper class is @@.green;sexually satiated@@ and their happiness attracts others. + <br>Your upper class is @@.green;sexually satiated@@ and their happiness attracts others. <</if>> <<if $upperClass < _UCD>> <<set _UCImmigration = Math.trunc((_UCD - $upperClass) * (0.3 * _terrain)) + 1, @@ -1258,9 +1258,9 @@ _SCD = Math.trunc(($upperClass * (2 + _slaveDemandU)) + ($topClass * (12 + _slav <br>@@.red;TCD is NaN, report this issue!@@ <<else>> /*Top Class Citizens immigrating*/ <<if $classSatisfied.topClass < 0>> - Your millionaires are @@.red;sexually frustrated@@ and would rather live elsewhere. + <br>Your millionaires are @@.red;sexually frustrated@@ and would rather live elsewhere. <<elseif $classSatisfied.topClass > 0>> - Your millionaires are @@.green;sexually satiated@@ and their happiness attracts others. + <br>Your millionaires are @@.green;sexually satiated@@ and their happiness attracts others. <</if>> <<if $topClass < _TCD>> <<set _TCImmigration = Math.trunc((_TCD - $topClass) * (0.3 * _terrain)) + 1, @@ -1400,7 +1400,7 @@ _percTopClass = Math.trunc(($topClass / ($ACitizens + $ASlaves)) * 1000) / 10>> <<set _rentMultiplier *= 1.05>> Those of your citizens who have not yet subscribed to the society you are building are permitted to live and do business here, but must pay a moderate jizya tax for the privilege as part of their rent. <</if>> -<<set _rents = Math.trunc(($lowerClass * $LCRent + $middleClass * $MCRent + $upperClass * $UCRent + $topClass * $TCRent) * _rentMultiplier / 25)>> +<<set _rents = Math.trunc(($lowerClass * $rent.lowerClass + $middleClass * $rent.middleClass + $upperClass * $rent.upperClass + $topClass * $rent.topClass) * _rentMultiplier / 25)>> <<if !Number.isInteger(_rents)>> <br>@@.red;Error: rents is outside accepted range, please report this issue@@ <<else>> diff --git a/src/uncategorized/manageArcology.tw b/src/uncategorized/manageArcology.tw index aea12b671dbd0e799de39cddbc69c1aed0dff41b..4200ad955d5696cf47961df3fa04b060d96694a3 100644 --- a/src/uncategorized/manageArcology.tw +++ b/src/uncategorized/manageArcology.tw @@ -282,53 +282,53 @@ _percLowerClass = Math.trunc(($lowerClass / ($ACitizens + $ASlaves)) * 1000) / 1 _percMiddleClass = Math.trunc(($middleClass / ($ACitizens + $ASlaves)) * 1000) / 10, _percUpperClass = Math.trunc(($upperClass / ($ACitizens + $ASlaves)) * 1000) / 10, _percTopClass = Math.trunc(($topClass / ($ACitizens + $ASlaves)) * 1000) / 10>> -<br>Lower Class Citizens | $lowerClass | <<print _percLowerClass>>% | Rent @@.yellowgreen;<<print cashFormat($LCRent / 25)>>@@ -<<if $LCRent > 30>> - //Very High// | [[Decrease|Manage Arcology][$LCRent = 30, $rentEffectL = 0.94, $whoreBudget.lowerClass = 9]] -<<elseif $LCRent > 20>> - //High// | [[Increase|Manage Arcology][$LCRent = 40, $rentEffectL = 0.85, $whoreBudget.lowerClass = 8]] | [[Decrease|Manage Arcology][$LCRent = 20, $rentEffectL = 1, $whoreBudget.lowerClass = 10]] -<<elseif $LCRent > 10>> - //Average// | [[Increase|Manage Arcology][$LCRent = 30, $rentEffectL = 0.94, $whoreBudget.lowerClass = 9]] | [[Decrease|Manage Arcology][$LCRent = 10, $rentEffectL = 1.04, $whoreBudget.lowerClass = 11]] -<<elseif $LCRent > 0>> - //Low// | [[Increase|Manage Arcology][$LCRent = 20, $rentEffectL = 1, $whoreBudget.lowerClass = 10]] | [[Free Rent|Manage Arcology][$LCRent = 0, $rentEffectL = 1.1, $whoreBudget.lowerClass = 12]] +<br>Lower Class Citizens | $lowerClass | <<print _percLowerClass>>% | Rent @@.yellowgreen;<<print cashFormat($rent.lowerClass / 25)>>@@ +<<if $rent.lowerClass > $rentDefaults.lowerClass * 1.5>> + //Very High// | [[Decrease|Manage Arcology][$rent.lowerClass = $rentDefaults.lowerClass * 1.5, $rentEffectL = 0.94, $whoreBudget.lowerClass *= 9 / 8]] +<<elseif $rent.lowerClass > $rentDefaults.lowerClass>> + //High// | [[Increase|Manage Arcology][$rent.lowerClass = $rentDefaults.lowerClass * 2, $rentEffectL = 0.85, $whoreBudget.lowerClass *= 8 / 9]] | [[Decrease|Manage Arcology][$rent.lowerClass = $rentDefaults.lowerClass, $rentEffectL = 1, $whoreBudget.lowerClass *= 10 / 9]] +<<elseif $rent.lowerClass > $rentDefaults. lowerClass * 0.5>> + //Average// | [[Increase|Manage Arcology][$rent.lowerClass = $rentDefaults.lowerClass * 1.5, $rentEffectL = 0.94, $whoreBudget.lowerClass *= 9 / 10]] | [[Decrease|Manage Arcology][$rent.lowerClass = $rentDefaults.lowerClass * 0.5, $rentEffectL = 1.04, $whoreBudget.lowerClass *= 11 / 10]] +<<elseif $rent.lowerClass > 0>> + //Low// | [[Increase|Manage Arcology][$rent.lowerClass = $rentDefaults.lowerClass, $rentEffectL = 1, $whoreBudget.lowerClass *= 10 / 11]] | [[Free Rent|Manage Arcology][$rent.lowerClass = 0, $rentEffectL = 1.1, $whoreBudget.lowerClass *= 12 / 11]] <<else>> - //Free// | [[Increase|Manage Arcology][$LCRent = 10, $rentEffectL = 1.04, $whoreBudget.lowerClass = 11]] + //Free// | [[Increase|Manage Arcology][$rent.lowerClass = $rentDefaults.lowerClass * 0.5, $rentEffectL = 1.04, $whoreBudget.lowerClass *= 11 / 12]] <</if>> -<br>Middle Class Citizens | $middleClass | <<print _percMiddleClass>>% | Rent @@.yellowgreen;<<print cashFormat($MCRent / 25)>>@@ -<<if $MCRent > 75>> - //Very High// | [[Decrease|Manage Arcology][$MCRent = 75, $rentEffectM = 0.94, $whoreBudget.middleClass = 45]] -<<elseif $MCRent > 50>> - //High// | [[Increase|Manage Arcology][$MCRent = 100, $rentEffectM = 0.85, $whoreBudget.middleClass = 40]] | [[Decrease|Manage Arcology][$MCRent = 50, $rentEffectM = 1, $whoreBudget.middleClass = 50]] -<<elseif $MCRent > 25>> - //Average// | [[Increase|Manage Arcology][$MCRent = 75, $rentEffectM = 0.94, $whoreBudget.middleClass = 45]] | [[Decrease|Manage Arcology][$MCRent = 25, $rentEffectM = 1.04, $whoreBudget.middleClass = 55]] -<<elseif $MCRent > 0>> - //Low// | [[Increase|Manage Arcology][$MCRent = 50, $rentEffectM = 1, $whoreBudget.middleClass = 50]] | [[Free Rent|Manage Arcology][$MCRent = 0, $rentEffectM = 1.1, $whoreBudget.middleClass = 60]] +<br>Middle Class Citizens | $middleClass | <<print _percMiddleClass>>% | Rent @@.yellowgreen;<<print cashFormat($rent.middleClass / 25)>>@@ +<<if $rent.middleClass > $rentDefaults.middleClass * 1.5>> + //Very High// | [[Decrease|Manage Arcology][$rent.middleClass = $rentDefaults.middleClass * 1.5, $rentEffectM = 0.94, $whoreBudget.middleClass *= 9 / 8]] +<<elseif $rent.middleClass > $rentDefaults.middleClass>> + //High// | [[Increase|Manage Arcology][$rent.middleClass = $rentDefaults.middleClass * 2, $rentEffectM = 0.85, $whoreBudget.middleClass *= 8 / 9]] | [[Decrease|Manage Arcology][$rent.middleClass = $rentDefaults.middleClass, $rentEffectM = 1, $whoreBudget.middleClass *= 10 / 9]] +<<elseif $rent.middleClass > $rentDefaults.middleClass * 0.5>> + //Average// | [[Increase|Manage Arcology][$rent.middleClass = $rentDefaults.middleClass * 1.5, $rentEffectM = 0.94, $whoreBudget.middleClass *= 9 / 10]] | [[Decrease|Manage Arcology][$rent.middleClass = $rentDefaults.middleClass * 0.5, $rentEffectM = 1.04, $whoreBudget.middleClass *= 11 / 10]] +<<elseif $rent.middleClass > 0>> + //Low// | [[Increase|Manage Arcology][$rent.middleClass = $rentDefaults.middleClass, $rentEffectM = 1, $whoreBudget.middleClass *= 10 / 11]] | [[Free Rent|Manage Arcology][$rent.middleClass = 0, $rentEffectM = 1.1, $whoreBudget.middleClass *= 12 / 11]] <<else>> - //Free// | [[Increase|Manage Arcology][$MCRent = 25, $rentEffectM = 1.04, $whoreBudget.middleClass = 55]] + //Free// | [[Increase|Manage Arcology][$rent.middleClass = $rentDefaults.middleClass * 0.5, $rentEffectM = 1.04, $whoreBudget.middleClass *= 11 / 12]] <</if>> -<br>Upper Class Citizens | $upperClass | <<print _percUpperClass>>% | Rent @@.yellowgreen;<<print cashFormat($UCRent / 25)>>@@ -<<if $UCRent > 270>> - //Very High// | [[Decrease|Manage Arcology][$UCRent = 270, $rentEffectU = 0.94, $whoreBudget.upperClass = 225]] -<<elseif $UCRent > 180>> - //High// | [[Increase|Manage Arcology][$UCRent = 360, $rentEffectU = 0.85, $whoreBudget.upperClass = 200]] | [[Decrease|Manage Arcology][$UCRent = 180, $rentEffectU = 1, $whoreBudget.upperClass = 250]] -<<elseif $UCRent > 90>> - //Average// | [[Increase|Manage Arcology][$UCRent = 270, $rentEffectU = 0.94, $whoreBudget.upperClass = 225]] | [[Decrease|Manage Arcology][$UCRent = 90, $rentEffectU = 1.04, $whoreBudget.upperClass = 275]] -<<elseif $UCRent > 0>> - //Low// | [[Increase|Manage Arcology][$UCRent = 180, $rentEffectU = 1, $whoreBudget.upperClass = 250]] | [[Free Rent|Manage Arcology][$UCRent = 0, $rentEffectU = 1.1, $whoreBudget.upperClass = 300]] +<br>Upper Class Citizens | $upperClass | <<print _percUpperClass>>% | Rent @@.yellowgreen;<<print cashFormat($rent.upperClass / 25)>>@@ +<<if $rent.upperClass > $rentDefaults.upperClass * 1.5>> + //Very High// | [[Decrease|Manage Arcology][$rent.upperClass = $rentDefaults.upperClass * 1.5, $rentEffectU = 0.94, $whoreBudget.upperClass *= 9 / 8]] +<<elseif $rent.upperClass > $rentDefaults.upperClass>> + //High// | [[Increase|Manage Arcology][$rent.upperClass = $rentDefaults.upperClass * 2, $rentEffectU = 0.85, $whoreBudget.upperClass *= 8 / 9]] | [[Decrease|Manage Arcology][$rent.upperClass = $rentDefaults.upperClass, $rentEffectU = 1, $whoreBudget.upperClass *= 10 / 9 ]] +<<elseif $rent.upperClass > $rentDefaults.upperClass * 0.5>> + //Average// | [[Increase|Manage Arcology][$rent.upperClass = $rentDefaults.upperClass * 1.5, $rentEffectU = 0.94, $whoreBudget.upperClass *= 9 / 10]] | [[Decrease|Manage Arcology][$rent.upperClass = $rentDefaults.upperClass * 0.5, $rentEffectU = 1.04, $whoreBudget.upperClass *= 11 / 10]] +<<elseif $rent.upperClass > 0>> + //Low// | [[Increase|Manage Arcology][$rent.upperClass = $rentDefaults.upperClass, $rentEffectU = 1, $whoreBudget.upperClass *= 10 / 11]] | [[Free Rent|Manage Arcology][$rent.upperClass = 0, $rentEffectU = 1.1, $whoreBudget.upperClass *= 12 / 11]] <<else>> - //Free// | [[Increase|Manage Arcology][$UCRent = 90, $rentEffectU = 1.04, $whoreBudget.upperClass = 275]] + //Free// | [[Increase|Manage Arcology][$rent.upperClass = $rentDefaults.upperClass * 0.5, $rentEffectU = 1.04, $whoreBudget.upperClass *= 11 / 12]] <</if>> -<br>Millionaires | $topClass | <<print _percTopClass>>% | Rent @@.yellowgreen;<<print cashFormat($TCRent / 25)>>@@ -<<if $TCRent > 975>> - //Very High// | [[Decrease|Manage Arcology][$TCRent = 975, $rentEffectT = 0.94, $whoreBudget.topClass = 1350]] -<<elseif $TCRent > 650>> - //High// | [[Increase|Manage Arcology][$TCRent = 1300, $rentEffectT = 0.85, $whoreBudget.topClass = 1200]] | [[Decrease|Manage Arcology][$TCRent = 650, $rentEffectT = 1, $whoreBudget.topClass = 1500]] -<<elseif $TCRent > 325>> - //Average// | [[Increase|Manage Arcology][$TCRent = 975, $rentEffectT = 0.94, $whoreBudget.topClass = 1350]] | [[Decrease|Manage Arcology][$TCRent = 325, $rentEffectT = 1.04, $whoreBudget.topClass = 1650]] -<<elseif $TCRent > 0>> - //Low// | [[Increase|Manage Arcology][$TCRent = 650, $rentEffectT = 1, $whoreBudget.topClass = 1500]] | [[Free Rent|Manage Arcology][$TCRent = 0, $rentEffectT = 1.1, $whoreBudget.topClass = 1800]] +<br>Millionaires | $topClass | <<print _percTopClass>>% | Rent @@.yellowgreen;<<print cashFormat($rent.topClass / 25)>>@@ +<<if $rent.topClass > $rentDefaults.topClass * 1.5>> + //Very High// | [[Decrease|Manage Arcology][$rent.topClass = $rentDefaults.topClass * 1.5, $rentEffectT = 0.94, $whoreBudget.topClass *= 9 / 8]] +<<elseif $rent.topClass > $rentDefaults.topClass>> + //High// | [[Increase|Manage Arcology][$rent.topClass = $rentDefaults.topClass * 2, $rentEffectT = 0.85, $whoreBudget.topClass *= 8 / 9]] | [[Decrease|Manage Arcology][$rent.topClass = $rentDefaults.topClass, $rentEffectT = 1, $whoreBudget.topClass *= 10 / 9]] +<<elseif $rent.topClass > $rentDefaults.topClass * 0.5>> + //Average// | [[Increase|Manage Arcology][$rent.topClass = $rentDefaults * 1.5, $rentEffectT = 0.94, $whoreBudget.topClass *= 9 / 10]] | [[Decrease|Manage Arcology][$rent.topClass = $rentDefaults.topClass * 0.5, $rentEffectT = 1.04, $whoreBudget.topClass *= 11 / 10]] +<<elseif $rent.topClass > 0>> + //Low// | [[Increase|Manage Arcology][$rent.topClass = $rentDefaults.topClass, $rentEffectT = 1, $whoreBudget.topClass *= 10 / 11]] | [[Free Rent|Manage Arcology][$rent.topClass = 0, $rentEffectT = 1.1, $whoreBudget.topClass *= 12 / 11]] <<else>> - //Free// | [[Increase|Manage Arcology][$TCRent = 325, $rentEffectT = 1.04, $whoreBudget.topClass = 1650]] + //Free// | [[Increase|Manage Arcology][$rent.topClass = $rentDefaults.topClass * 0.5, $rentEffectT = 1.04, $whoreBudget.topClass *= 11 / 12]] <</if>> <br>Slaves | $ASlaves | <<print _percASlaves>>% diff --git a/src/uncategorized/slaveAssignmentsReport.tw b/src/uncategorized/slaveAssignmentsReport.tw index 460b79061ffbf3ed3c6f6a0a7a0235f4b12bb248..8790481aafd25b9d31efb8c32d5a8b4d6e4d0686 100644 --- a/src/uncategorized/slaveAssignmentsReport.tw +++ b/src/uncategorized/slaveAssignmentsReport.tw @@ -22,11 +22,11 @@ i.e. a highly paternalist arcology with little choice for its lower class but Fu <<set _lowerClassSexDemand = $lowerClass * $whoreBudget.lowerClass, _lowerClassSexDemandRef = Math.max(_lowerClassSexDemand, 1), _middleClassSexDemand = $middleClass * $whoreBudget.middleClass, -_middleClassSexDemandRef = Math.max(_lowerClassSexDemand, 1), +_middleClassSexDemandRef = Math.max(_middleClassSexDemand, 1), _upperClassSexDemand = $upperClass * $whoreBudget.upperClass, _upperClassSexDemandRef = Math.max(_upperClassSexDemand, 1), _topClassSexDemand = $topClass * $whoreBudget.topClass, -_topClassSexDemandRef = Math.max(_upperClassSexDemand, 1), +_topClassSexDemandRef = Math.max(_topClassSexDemand, 1), _visitorsSexDemand = Math.trunc($visitors) * 40, $whorePriceAdjustment = {lowerClass: 0, middleClass: 0, upperClass: 0, topClass: 0}, $NPCMarketShare = {lowerClass: 0, middleClass: 0, upperClass: 0, topClass: 0}, @@ -159,11 +159,11 @@ _middleClassClubRatio = (_middleClassSexDemand + _visitorsSexDemand) / _clubDema <</if>> /*NPC sex supply*/ -<<set $NPCSexSupply = NPCSexSupply(_lowerClassSexDemand/_lowerClassSexDemandRef, _middleClassSexDemand/_middleClassSexDemandRef, _upperClassSexDemand/_upperClassSexDemandRef, _topClassSexDemand/_topClassSexDemandRef), -$NPCMarketShare.lowerClass = Math.trunc(($NPCSexSupply.lowerClass * 1000) / ($NPCSexSupply.lowerClass + $slaveJobValues.arcade +_arcadeDemandDeg + $slaveJobValues.brothel.lowerClass + Math.trunc($slaveJobValues.club * $slaveJobValues.clubSP * _lowerClassClubRatio))), -$NPCMarketShare.middleClass = Math.trunc(($NPCSexSupply.middleClass * 1000) / ($NPCSexSupply.middleClass + $slaveJobValues.brothel.middleClass + Math.trunc($slaveJobValues.club * $slaveJobValues.clubSP * _middleClassClubRatio))), -$NPCMarketShare.upperClass = Math.trunc(($NPCSexSupply.upperClass * 1000) / ($NPCSexSupply.upperClass + $slaveJobValues.brothel.upperClass)), -$NPCMarketShare.topClass = Math.trunc(($NPCSexSupply.topClass * 1000) / ($NPCSexSupply.topClass + $slaveJobValues.brothel.topClass))>> +<<set $NPCSexSupply = NPCSexSupply(_lowerClassSexDemand, _middleClassSexDemand, _upperClassSexDemand, _topClassSexDemand), +$NPCMarketShare.lowerClass = Math.trunc(($NPCSexSupply.lowerClass * 1000) / _lowerClassSexDemandRef), +$NPCMarketShare.middleClass = Math.trunc(($NPCSexSupply.middleClass * 1000) / _middleClassSexDemandRef), +$NPCMarketShare.upperClass = Math.trunc(($NPCSexSupply.upperClass * 1000) / _upperClassSexDemandRef), +$NPCMarketShare.topClass = Math.trunc(($NPCSexSupply.topClass * 1000) / _topClassSexDemandRef)>> <<if _lowerClassSexDemand < $NPCSexSupply.lowerClass>> <<set _lowerClassSexDemand = 0>> <<else>> @@ -213,15 +213,17 @@ $NPCMarketShare.topClass = Math.trunc(($NPCSexSupply.topClass * 1000) / ($NPCSex <</if>> /*Sexual satisfaction effects*/ -<<if _lowerClassSexDemand > $lowerClass * $whoreBudget.lowerClass * 0.6>> /*You are providing < 40% of their desired amount of sex*/ - <<set $sexDemandResult.lowerClass = 1>> +<<set $sexDemandResult.lowerClass = Math.trunc(((_lowerClassSexDemandRef - _lowerClassSexDemand) * 1000) / _lowerClassSexDemandRef), +$sexDemandResult.middleClass = Math.trunc(((_middleClassSexDemandRef - _middleClassSexDemand) * 1000) / _middleClassSexDemandRef), +$sexDemandResult.upperClass = Math.trunc(((_upperClassSexDemandRef - _upperClassSexDemand) * 1000) / _upperClassSexDemandRef), +$sexDemandResult.topClass = Math.trunc(((_topClassSexDemandRef - _topClassSexDemand) * 1000) / _topClassSexDemandRef)>> +<<if $sexDemandResult.lowerClass < 400>> /*You are providing < 40% of their desired amount of sex*/ <<if $week <= 30>> <<set $classSatisfied.lowerClass = 0>> <<else>> <<set $classSatisfied.lowerClass = -1>> <</if>> -<<elseif _lowerClassSexDemand > $lowerClass * $whoreBudget.lowerClass * 0.4>> /*You are providing between 40 and 60% of their desired amount of sex*/ - <<set $sexDemandResult.lowerClass = 2>> +<<elseif $sexDemandResult.lowerClass < 600>> /*You are providing between 40 and 60% of their desired amount of sex*/ <<if $week <= 40>> <<set $classSatisfied.lowerClass = 1>> <<elseif $week <= 60>> @@ -229,30 +231,25 @@ $NPCMarketShare.topClass = Math.trunc(($NPCSexSupply.topClass * 1000) / ($NPCSex <<else>> <<set $classSatisfied.lowerClass = -1>> <</if>> -<<elseif _lowerClassSexDemand > $lowerClass * $whoreBudget.lowerClass * 0.2>> /*You are providing between 60 and 80% of their desired amount of sex*/ - <<set $sexDemandResult.lowerClass = 3>> +<<elseif $sexDemandResult.lowerClass < 800>> /*You are providing between 60 and 80% of their desired amount of sex*/ <<if $week <= 50>> <<set $classSatisfied.lowerClass = 1>> <<else>> <<set $classSatisfied.lowerClass = 0>> <</if>> -<<elseif _lowerClassSexDemand == 0>> /*You are providing 100% or more of their desired amount of sex*/ - <<set $sexDemandResult.lowerClass = 5, - $classSatisfied.lowerClass = 2>> +<<elseif $sexDemandResult.lowerClass == 1000>> /*You are providing 100% or more of their desired amount of sex*/ + <<set $classSatisfied.lowerClass = 2>> <<else>> /*You are providing > 80% of their desired amount of sex*/ - <<set $sexDemandResult.lowerClass = 4, - $classSatisfied.lowerClass = 1>> + <<set $classSatisfied.lowerClass = 1>> <</if>> -<<if _middleClassSexDemand > $middleClass * $whoreBudget.middleClass * 0.6>> /*You are providing < 40% of their desired amount of sex*/ - <<set $sexDemandResult.middleClass = 1>> +<<if $sexDemandResult.middleClass < 400>> /*You are providing < 40% of their desired amount of sex*/ <<if $week <= 30>> <<set $classSatisfied.middleClass = 0>> <<else>> <<set $classSatisfied.middleClass = -1>> <</if>> -<<elseif _middleClassSexDemand > $middleClass * $whoreBudget.middleClass * 0.4>> /*You are providing between 40 and 60% of their desired amount of sex*/ - <<set $sexDemandResult.middleClass = 2>> +<<elseif $sexDemandResult.middleClass < 600>> /*You are providing between 40 and 60% of their desired amount of sex*/ <<if $week <= 40>> <<set $classSatisfied.middleClass = 1>> <<elseif $week <= 60>> @@ -260,30 +257,25 @@ $NPCMarketShare.topClass = Math.trunc(($NPCSexSupply.topClass * 1000) / ($NPCSex <<else>> <<set $classSatisfied.middleClass = -1>> <</if>> -<<elseif _middleClassSexDemand > $middleClass * $whoreBudget.middleClass * 0.2>> /*You are providing between 60 and 80% of their desired amount of sex*/ - <<set $sexDemandResult.middleClass = 3>> +<<elseif $sexDemandResult.middleClass < 800>> /*You are providing between 60 and 80% of their desired amount of sex*/ <<if $week <= 50>> <<set $classSatisfied.middleClass = 1>> <<else>> <<set $classSatisfied.middleClass = 0>> <</if>> -<<elseif _middleClassSexDemand == 0>> /*You are providing 100% or more of their desired amount of sex*/ - <<set $sexDemandResult.middleClass = 5, - $classSatisfied.middleClass = 2>> +<<elseif $sexDemandResult.middleClass == 1000>> /*You are providing 100% or more of their desired amount of sex*/ + <<set $classSatisfied.middleClass = 2>> <<else>> /*You are providing > 80% of their desired amount of sex*/ - <<set $sexDemandResult.middleClass = 4, - $classSatisfied.middleClass = 1>> + <<set $classSatisfied.middleClass = 1>> <</if>> -<<if _upperClassSexDemand > $upperClass * $whoreBudget.upperClass * 0.6>> /*You are providing < 40% of their desired amount of sex*/ - <<set $sexDemandResult.upperClass = 1>> +<<if $sexDemandResult.upperClass < 400>> /*You are providing < 40% of their desired amount of sex*/ <<if $week <= 30>> <<set $classSatisfied.upperClass = 0>> <<else>> <<set $classSatisfied.upperClass = -1>> <</if>> -<<elseif _upperClassSexDemand > $upperClass * $whoreBudget.upperClass * 0.4>> /*You are providing between 40 and 60% of their desired amount of sex*/ - <<set $sexDemandResult.upperClass = 2>> +<<elseif $sexDemandResult.upperClass < 600>> /*You are providing between 40 and 60% of their desired amount of sex*/ <<if $week <= 40>> <<set $classSatisfied.upperClass = 1>> <<elseif $week <= 60>> @@ -291,30 +283,25 @@ $NPCMarketShare.topClass = Math.trunc(($NPCSexSupply.topClass * 1000) / ($NPCSex <<else>> <<set $classSatisfied.upperClass = -1>> <</if>> -<<elseif _upperClassSexDemand > $upperClass * $whoreBudget.upperClass * 0.2>> /*You are providing between 60 and 80% of their desired amount of sex*/ - <<set $sexDemandResult.upperClass = 3>> +<<elseif $sexDemandResult.upperClass < 800>> /*You are providing between 60 and 80% of their desired amount of sex*/ <<if $week <= 50>> <<set $classSatisfied.upperClass = 1>> <<else>> <<set $classSatisfied.upperClass = 0>> <</if>> -<<elseif _upperClassSexDemand == 0>> /*You are providing 100% or more of their desired amount of sex*/ - <<set $sexDemandResult.upperClass = 5, - $classSatisfied.upperClass = 2>> +<<elseif $sexDemandResult.upperClass == 1000>> /*You are providing 100% or more of their desired amount of sex*/ + <<set $classSatisfied.upperClass = 2>> <<else>> /*You are providing > 80% of their desired amount of sex*/ - <<set $sexDemandResult.upperClass = 4, - $classSatisfied.upperClass = 1>> + <<set $classSatisfied.upperClass = 1>> <</if>> -<<if _topClassSexDemand > $topClass * $whoreBudget.topClass * 0.6>> /*You are providing < 40% of their desired amount of sex*/ - <<set $topClassSexDemandResult = 1>> +<<if $sexDemandResult.topClass < 400>> /*You are providing < 40% of their desired amount of sex*/ <<if $week <= 30>> <<set $topClassSatisfied = 0>> <<else>> <<set $topClassSatisfied = -1>> <</if>> -<<elseif _topClassSexDemand > $topClass * $whoreBudget.topClass * 0.4>> /*You are providing between 40 and 60% of their desired amount of sex*/ - <<set $topClassSexDemandResult = 2>> +<<elseif $sexDemandResult.topClass < 600>> /*You are providing between 40 and 60% of their desired amount of sex*/ <<if $week <= 40>> <<set $topClassSatisfied = 1>> <<elseif $week <= 60>> @@ -322,19 +309,16 @@ $NPCMarketShare.topClass = Math.trunc(($NPCSexSupply.topClass * 1000) / ($NPCSex <<else>> <<set $topClassSatisfied = -1>> <</if>> -<<elseif _topClassSexDemand > $topClass * $whoreBudget.topClass * 0.2>> /*You are providing between 60 and 80% of their desired amount of sex*/ - <<set $topClassSexDemandResult = 3>> +<<elseif $sexDemandResult.topClass < 800>> /*You are providing between 60 and 80% of their desired amount of sex*/ <<if $week <= 50>> <<set $topClassSatisfied = 1>> <<else>> <<set $topClassSatisfied = 0>> <</if>> -<<elseif _topClassSexDemand == 0>> /*You are providing 100% or more of their desired amount of sex*/ - <<set $topClassSexDemandResult = 5, - $topClassSatisfied = 2>> +<<elseif $sexDemandResult.topClass == 1000>> /*You are providing 100% or more of their desired amount of sex*/ + <<set $topClassSatisfied = 2>> <<else>> /*You are providing > 80% of their desired amount of sex*/ - <<set $topClassSexDemandResult = 4, - $topClassSatisfied = 1>> + <<set $topClassSatisfied = 1>> <</if>> <br><br> diff --git a/src/uncategorized/slaveInteract.tw b/src/uncategorized/slaveInteract.tw index 81fa348ef728edcbe72a25d19ae54665d4275d8c..5c35ab1d2731c71b8ecb94c3136b79d538a2b75a 100644 --- a/src/uncategorized/slaveInteract.tw +++ b/src/uncategorized/slaveInteract.tw @@ -1520,7 +1520,7 @@ Whoring Target: <strong><span id="whoreClass"><<if !$activeSlave.whoreClass>>aut <<link "Lower Class">><<set $activeSlave.whoreClass = 1>><<replace "#whoreClass">>the lower class<</replace>><</link>> | <<link "Middle Class">><<set $activeSlave.whoreClass = 2>><<replace "#whoreClass">>the middle class<</replace>><</link>> | <<link "Upper Class">><<set $activeSlave.whoreClass = 3>><<replace "#whoreClass">>the upper class<</replace>><</link>> | -<<link "Millionaires">><<set $activeSlave.whoreClass = 0>><<replace "#whoreClass">>millionaires<</replace>><</link>><br> +<<link "Millionaires">><<set $activeSlave.whoreClass = 4>><<replace "#whoreClass">>millionaires<</replace>><</link>><br> <<if $activeSlave.fuckdoll > 0>> //Rules have little meaning for living sex toys//