diff --git a/src/endWeek/saRecruitGirls.js b/src/endWeek/saRecruitGirls.js index 0abd80f15469fc501be31c27f15f4431b592edd4..942096d0e7c21ab77d050bfd998770da3619aeb5 100644 --- a/src/endWeek/saRecruitGirls.js +++ b/src/endWeek/saRecruitGirls.js @@ -12,6 +12,7 @@ App.SlaveAssignment.recruitGirls = (function() { let slaveInt; let recruiterRelation; let clubSeed; + let masterSuiteAvgEnergy; return recruitGirls; @@ -26,6 +27,7 @@ App.SlaveAssignment.recruitGirls = (function() { slaveInt = slave.intelligence + slave.intelligenceImplant; recruiterRelation = arcology.FSEgyptianRevivalist !== "unset" ? randomRelatedAvailableSlave(slave) : null; clubSeed = arcology.FSEdoRevivalist !== "unset" ? getClubSeed() : 0; + ({energy: masterSuiteAvgEnergy} = App.Utils.masterSuiteAverages()); ({ // eslint-disable-next-line no-unused-vars @@ -1292,7 +1294,7 @@ App.SlaveAssignment.recruitGirls = (function() { arcology.FSEdoRevivalist += 0.02 * V.FSSingleSlaveRep; } } else if (arcology.FSArabianRevivalist !== "unset") { - if (V.masterSuiteDecoration === "Arabian Revivalist" && V.masterSuiteUpgradeLuxury > 0 && V.masterSuiteAverageEnergy > 60 && App.Entity.facilities.masterSuite.employeesIDs().size >= 3) { + if (V.masterSuiteDecoration === "Arabian Revivalist" && V.masterSuiteUpgradeLuxury > 0 && masterSuiteAvgEnergy > 60 && App.Entity.facilities.masterSuite.employeesIDs().size >= 3) { seed += 6; FSmatch++; arcology.FSArabianRevivalist += 0.02 * V.FSSingleSlaveRep; @@ -1767,7 +1769,7 @@ App.SlaveAssignment.recruitGirls = (function() { r.push(`${He} gets some hot POV-style footage when ${he} films in your nightclub, but there's nothing special about its atmosphere to distinguish it from any other bar in any other arcology.`); } } else if (arcology.FSArabianRevivalist !== "unset") { - if (V.masterSuiteDecoration === "Arabian Revivalist" && V.masterSuiteUpgradeLuxury > 0 && V.masterSuiteAverageEnergy > 60) { + if (V.masterSuiteDecoration === "Arabian Revivalist" && V.masterSuiteUpgradeLuxury > 0 && masterSuiteAvgEnergy > 60) { if (App.Entity.facilities.masterSuite.employeesIDs().size >= 3) { r.push(`An exposé that "pulls back the curtain" on your elaborate master bedroom goes viral after several harem slaves drag ${him} into`); if (V.masterSuiteUpgradeLuxury === 1) { diff --git a/src/js/utilsFC.js b/src/js/utilsFC.js index a079d13f5957c0dbce9b467ab3ddb28bd9f25708..a67d023fe6844e30508fb39a9751b91b72987530 100644 --- a/src/js/utilsFC.js +++ b/src/js/utilsFC.js @@ -2998,3 +2998,31 @@ App.Utils.scheduleSidebarRefresh = (function() { return schedule; })(); + +/** Calculate various averages for the master suite slaves + * @returns {{energy: number, milk: number, cum: number, dom: number, sadism: number, dick: number, preg: number}} + */ +App.Utils.masterSuiteAverages = (function() { + const domMap = {dom: 1, submissive: -1}; + const sadismMap = {sadism: 1, masochism: -1}; + + /** Returns either zero or the results of mapping the slave's fetish through an object containing fetish names and result values + * @param {App.Entity.SlaveState} s + * @param {Object.<string, number>} map + * @returns {number} + */ + const fetishMapOrZero = (s, map) => map.hasOwnProperty(s.fetish) ? map[s.fetish] : 0; + + return () => { + const msSlaves = App.Entity.facilities.masterSuite.employees(); + return { + energy: _.mean(msSlaves.map(s => s.energy)), + milk: _.mean(msSlaves.map(s => s.lactation*(s.boobs-s.boobsImplant))), + cum: _.mean(msSlaves.map(s => canAchieveErection(s) ? s.balls : 0)), + dick: _.mean(msSlaves.map(s => canAchieveErection(s) ? s.dick : 0)), + preg: _.mean(msSlaves.map(s => s.preg)), + sadism: _.mean(msSlaves.map(s => fetishMapOrZero(s, sadismMap))), + dom: _.mean(msSlaves.map(s => fetishMapOrZero(s, domMap))) + }; + }; +})(); diff --git a/src/uncategorized/masterSuite.tw b/src/uncategorized/masterSuite.tw index f05a076a7ac8e7f0469d94f5c4c11122bddcf490..53b40bc8120c5e37c13ce1a052e61ca6d8335758 100644 --- a/src/uncategorized/masterSuite.tw +++ b/src/uncategorized/masterSuite.tw @@ -3,7 +3,7 @@ <<set _slaves = App.Utils.sortedEmployees(App.Entity.facilities.masterSuite)>> <<set $nextButton = "Back to Main", $nextLink = "Main", $returnTo = "Master Suite", $encyclopedia = "Master Suite", _MsL = _slaves.length>> -<<set $masterSuiteAverageEnergy = 0, _masterSuiteAverageCum = 0, _masterSuiteAverageDick = 0, _masterSuiteAverageDom = 0, _masterSuiteAverageMilk = 0, _masterSuiteAveragePreg = 0, _masterSuiteAverageSadism = 0, _masterSuitePregnantSlaves = 0, _masterSuitePregnantSlavesMultiple = 0>> +<<set _masterSuitePregnantSlaves = 0, _masterSuitePregnantSlavesMultiple = 0, _msAvg = App.Utils.masterSuiteAverages()>> <<set _masterSuiteNameCaps = capFirstChar($masterSuiteName)>> <<if (_S.Concubine && _S.Concubine.pregKnown == 1)>> @@ -15,21 +15,6 @@ <<if _MsL > 0>> <<for _slave range _slaves>> - <<if $masterSuiteUpgradeLuxury == 2>> - <<if canAchieveErection(_slave)>> - <<set _masterSuiteAverageCum += _slave.balls, _masterSuiteAverageDick += _slave.dick>> - <</if>> - <<set _masterSuiteAverageMilk += _slave.lactation*(_slave.boobs-_slave.boobsImplant), $masterSuiteAverageEnergy += _slave.energy, _masterSuiteAveragePreg += _slave.preg>> - <<if _slave.fetish == "dom">> - <<set _masterSuiteAverageDom += _slave.fetishStrength>> - <<elseif _slave.fetish == "submissive">> - <<set _masterSuiteAverageDom -= _slave.fetishStrength>> - <<elseif _slave.fetish == "sadist">> - <<set _masterSuiteAverageSadism += _slave.fetishStrength>> - <<elseif _slave.fetish == "masochist">> - <<set _masterSuiteAverageSadism -= _slave.fetishStrength>> - <</if>> - <</if>> <<if (_slave.pregKnown == 1)>> <<set _masterSuitePregnantSlaves++>> <<if _slave.pregType > 1>> @@ -37,13 +22,6 @@ <</if>> <</if>> <</for>> - <<set $masterSuiteAverageEnergy = $masterSuiteAverageEnergy/_MsL>> - <<set _masterSuiteAverageMilk = _masterSuiteAverageMilk/_MsL>> - <<set _masterSuiteAverageCum = _masterSuiteAverageCum/_MsL>> - <<set _masterSuiteAverageDick = _masterSuiteAverageDick/_MsL>> - <<set _masterSuiteAveragePreg = _masterSuiteAveragePreg/_MsL>> - <<set _masterSuiteAverageDom = _masterSuiteAverageDom/_MsL>> - <<set _masterSuiteAverageSadism = _masterSuiteAverageSadism/_MsL>> <</if>> <<set _Tmult1 = Math.trunc(10000*$upgradeMultiplierArcology)>> @@ -193,22 +171,22 @@ _masterSuiteNameCaps is furnished The true focus of the suite is, however, the fuckpit. This stepped depression in the middle of the floor <<if _MsL > 3>> is filled by cushions and every slave in the suite who isn't sleeping, eating, or bathing. - <<if $masterSuiteAverageEnergy > 90>> + <<if _msAvg.energy > 90>> They're having energetic group sex; most of them are fucking and being fucked at the same time. - <<elseif $masterSuiteAverageEnergy > 60>> + <<elseif _msAvg.energy > 60>> They're having group sex; most of them are in active sexual contact with more than one partner. <<else>> They're having languid group sex; more than one slave is dozing while another plays with their body. <</if>> - <<if $masterSuiteAverageEnergy > 90>> + <<if _msAvg.energy > 90>> The pit features automated cleaning systems, which are quite necessary. - <<if _masterSuiteAverageDick > 4>> + <<if _msAvg.dick > 4>> With so many huge cocks in the fuckpit, every hole available is frequently fucked vigorously. <</if>> - <<if _masterSuiteAverageCum > 4>> + <<if _msAvg.cum > 4>> The slaves' bodies grow more coated with cum, and more of the white stuff drips from their holes, until they take a break for a shower. <</if>> - <<if _masterSuiteAverageMilk > 4000>> + <<if _msAvg.milk > 4000>> Most of them cannot tear themselves away (or cannot escape) for a normal machine milking, so their tender, overfull breasts squirt milk whenever anyone touches them. The lowest level of the fuckpit is a pool of milk. <</if>> <</if>> diff --git a/src/uncategorized/masterSuiteReport.tw b/src/uncategorized/masterSuiteReport.tw index 334e22250af10182add9d8549a8fb76b3e3a9f52..6bf4b7278f836215685cd279b85631e7a72d78d5 100644 --- a/src/uncategorized/masterSuiteReport.tw +++ b/src/uncategorized/masterSuiteReport.tw @@ -1,7 +1,7 @@ :: Master Suite Report [nobr] <<set _slaves = App.Utils.sortedEmployees(App.Entity.facilities.masterSuite)>> -<<set _DL = _slaves.length, _SL = $slaves.length, $legendaryAbolitionistID = 0, $masterSuiteAverageEnergy = 0, _masterSuiteAverageCum = 0, _masterSuiteAverageDick = 0, _masterSuiteAverageDom = 0, _masterSuiteAverageMilk = 0, _masterSuiteAveragePreg = 0, _masterSuiteAverageSadism = 0, _masterSuitePregnantSlaves = 0, _masterSuitePregnantSlavesMultiple = 0>> +<<set _DL = _slaves.length, _SL = $slaves.length, $legendaryAbolitionistID = 0, _masterSuitePregnantSlaves = 0, _masterSuitePregnantSlavesMultiple = 0, _msAvg = App.Utils.masterSuiteAverages()>> <<if $ConcubineID != 0>> /% Add the Concubine to the _slaves list at the front of the array, so that $he displays first %/ <<set _slaves.unshift(_S.Concubine), _DL++>> @@ -9,34 +9,10 @@ <<if _DL > 0>> <<for _slave range _slaves>> - <<set $masterSuiteAverageEnergy += _slave.energy>> - <<if $masterSuiteUpgradeLuxury == 2>> - <<if canAchieveErection(_slave)>> - <<set _masterSuiteAverageCum += _slave.balls, _masterSuiteAverageDick += _slave.dick>> - <</if>> - <<set _masterSuiteAverageMilk += _slave.lactation*(_slave.boobs-_slave.boobsImplant), _masterSuiteAveragePreg += _slave.pregKnown>> - <<switch _slave.fetish>> - <<case "dom">> - <<set _masterSuiteAverageDom += _slave.fetishStrength>> - <<case "submissive">> - <<set _masterSuiteAverageDom -= _slave.fetishStrength>> - <<case "sadist">> - <<set _masterSuiteAverageSadism += _slave.fetishStrength>> - <<case "masochist">> - <<set _masterSuiteAverageSadism -= _slave.fetishStrength>> - <</switch>> - <</if>> <<if ($legendaryAbolitionistID == 0) && (_slave.devotion > 95) && (_slave.prestige == 0) && ((_slave.origin == "You sentenced $him to enslavement as a punishment for attempted theft of a slave.") || (_slave.origin == "$He is an enslaved Daughter of Liberty.") || (_slave.origin === "You got $him at the Slave Shelter. $He is an enslaved Daughter of Liberty, caught some weeks after the failed coup. $His previous owner used $him as a punching bag and dart board, then when he was bored of $him tattooed obscenities all over $his body and threw $him away.") || (_slave.origin === "$He is an enslaved member of an anti-slavery extremist group.") || (_slave.career == "an antislavery activist"))>> <<set $legendaryAbolitionistID = _slave.ID>> <</if>> <</for>> - <<set $masterSuiteAverageEnergy = $masterSuiteAverageEnergy/_DL>> - <<set _masterSuiteAverageMilk = _masterSuiteAverageMilk/_DL>> - <<set _masterSuiteAverageCum = _masterSuiteAverageCum/_DL>> - <<set _masterSuiteAverageDick = _masterSuiteAverageDick/_DL>> - <<set _masterSuiteAveragePreg = _masterSuiteAveragePreg/_DL>> - <<set _masterSuiteAverageDom = _masterSuiteAverageDom/_DL>> - <<set _masterSuiteAverageSadism = _masterSuiteAverageSadism/_DL>> ''There <<if (_DL == 1)>>is one slave<<else>>are _DL slaves<</if>> seeing to your pleasure in the master suite.'' Such sexual opulence @@.green;improves@@ your reputation. @@ -64,25 +40,25 @@ <<if _DL > 1>> The level of sexual energy in the suite is <<if $masterSuiteUpgradeLuxury == 1>> - <<if $masterSuiteAverageEnergy > 90>> + <<if _msAvg.energy > 90>> intense. When you enter your luxurious retreat, you can set off pent-up orgasms with a touch. - <<elseif $masterSuiteAverageEnergy > 60>> + <<elseif _msAvg.energy > 60>> high; there is strong competition for your favors whenever you enter your retreat. <<else>> relatively normal; the slaves serve your pleasure before their own. <</if>> <<elseif $masterSuiteUpgradeLuxury == 2>> - <<if $masterSuiteAverageEnergy > 90>> + <<if _msAvg.energy > 90>> intense. Your slaves spend almost all their time in the fuckpit, having sex in a big pile. - <<elseif $masterSuiteAverageEnergy > 60>> + <<elseif _msAvg.energy > 60>> high; your slaves spend much of their time in the fuckpit, having sex with each other. <<else>> relatively normal; the slaves lounging in the fuckpit get each other off when they feel like it. <</if>> - <<if _masterSuiteAverageCum > 4>> + <<if _msAvg.cum > 4>> Unless it's right after an automated cleaning, everything in the fuckpit is spattered with cum. <</if>> - <<if _masterSuiteAverageMilk > 4000>> + <<if _msAvg.milk > 4000>> There's so much lactation going on that the lowest level of the fuckpit is a pool of milk. <</if>> <<else>> @@ -217,20 +193,20 @@ <</if>> <</if>> /% Both Concubine and other slaves %/ - <<if $masterSuiteUpgradeLuxury == 2 && $masterSuiteAverageEnergy > random(50,90)>> + <<if $masterSuiteUpgradeLuxury == 2 && _msAvg.energy > random(50,90)>> <<set _energy = (Math.ceil(_slave.energy/5)*7)>> <<run SimpleSexAct.Slave(_slave, _energy)>> <<if canPenetrate(_slave)>> <<set _fuckCount = (random(1,3)*_energy)>> <<set _slave.counter.penetrative += _fuckCount, $penetrativeTotal += _fuckCount>> <</if>> - <<if _slave.nipples == "fuckable" && _masterSuiteAverageDick > 2>> + <<if _slave.nipples == "fuckable" && _msAvg.dick > 2>> <<set _fuckCount = (random(1,3)*_energy)>> <<set _slave.counter.mammary += _fuckCount, $mammaryTotal += _fuckCount>> <</if>> <<if (_slave.trust >= -20) && (_slave.devotion > -10) && (_slave.fetishStrength <= 95) && _slave.fetish != "mindbroken">> <<set _fetishChangeChance = fetishChangeChance(_slave)>> - <<if (_masterSuiteAverageMilk > 2000) && (_fetishChangeChance > random(0,50))>> + <<if (_msAvg.milk > 2000) && (_fetishChangeChance > random(0,50))>> <<if _slave.fetish == "boobs">> <<if $verboseDescriptions == 1>>$His<<else>>_slave.slaveName's<</if>> @@.lightcoral;boob fetish is strengthened@@ by the constant availability of milky nipples for $him to play with. <<set _slave.fetishStrength += 4>> @@ -238,7 +214,7 @@ <<if $verboseDescriptions == 1>>$He<<else>>_slave.slaveName<</if>> @@.lightcoral;acquires a boob fetish@@ after spending a lot of time in the fuckpit drinking from $his fellow fucktoys' tits. <<set _slave.fetish = "boobs", _slave.fetishStrength = 65>> <</if>> - <<elseif (_masterSuiteAverageDick > 3) && (_slave.anus > 0) && (_fetishChangeChance > random(0,50))>> + <<elseif (_msAvg.dick > 3) && (_slave.anus > 0) && (_fetishChangeChance > random(0,50))>> $He <<if _slave.fetish == "buttslut">> @@.lightcoral;sinks farther into anal pleasure,@@ since $he spends $his time in the fuckpit with at least one of the many available cocks up $his butt. @@ -247,7 +223,7 @@ @@.lightcoral;acquires an anal fetish@@ after helplessly orgasming at the mercy of your many fucktoys eager to shove their big stiff penises up $his ass. <<set _slave.fetish = "buttslut", _slave.fetishStrength = 65>> <</if>> - <<elseif (_masterSuiteAverageCum > 3) && (_fetishChangeChance > random(0,50))>> + <<elseif (_msAvg.cum > 3) && (_fetishChangeChance > random(0,50))>> $He <<if _slave.fetish == "cumslut">> @@.lightcoral;sinks farther into cum addiction,@@ since $he spends $his time in the fuckpit eagerly sucking down ejaculate, straight from the many sources. @@ -256,7 +232,7 @@ @@.lightcoral;acquires an oral fixation@@ after orally servicing your many fucktoys eager to blow their loads down $his throat. <<set _slave.fetish = "cumslut", _slave.fetishStrength = 65>> <</if>> - <<elseif (_masterSuiteAveragePreg > 10) && (_fetishChangeChance > random(0,50))>> + <<elseif (_msAvg.preg > 10) && (_fetishChangeChance > random(0,50))>> $He <<if _slave.fetish == "pregnancy">> @@.lightcoral;sinks farther into pregnancy obsession,@@ since $he never wants for a pregnant girl to make love to. @@ -265,7 +241,7 @@ @@.lightcoral;acquires a pregnancy fetish,@@ since many of $his sexual partners in the fuckpit are heavily pregnant. <<set _slave.fetish = "pregnancy", _slave.fetishStrength = 65>> <</if>> - <<elseif (_masterSuiteAverageDom < 50) && (_fetishChangeChance > random(0,50))>> + <<elseif (_msAvg.dom < 50) && (_fetishChangeChance > random(0,50))>> $He <<if _slave.fetish == "dom">> @@.lightcoral;becomes more dominant,@@ since there are so many subs in the fuckpit who beg $him to fuck them hard. @@ -274,7 +250,7 @@ @@.lightcoral;becomes sexually dominant@@ after having fun satisfying the many submissive fucktoys in the fuckpit who beg $him to top them. <<set _slave.fetish = "dom", _slave.fetishStrength = 65>> <</if>> - <<elseif (_masterSuiteAverageDom > 50) && (_fetishChangeChance > random(0,50))>> + <<elseif (_msAvg.dom > 50) && (_fetishChangeChance > random(0,50))>> $He <<if _slave.fetish == "submissive">> @@.lightcoral;becomes even more submissive,@@ since there are so many doms in the fuckpit that $he's often used by more than one at once. @@ -283,7 +259,7 @@ @@.lightcoral;becomes sexually submissive@@ after the many dominant slaves in the fuckpit hold $him down and use $him for their pleasure. <<set _slave.fetish = "submissive", _slave.fetishStrength = 65>> <</if>> - <<elseif (_masterSuiteAverageSadism < 50) && (_fetishChangeChance > random(0,50))>> + <<elseif (_msAvg.sadism < 50) && (_fetishChangeChance > random(0,50))>> $He <<if _slave.fetish == "sadist">> @@.lightcoral;becomes more sadistic,@@ since there are so many sluts in the fuckpit who will do anything for $him if $he'll only spank them. @@ -292,7 +268,7 @@ @@.lightcoral;becomes a bit of a sadist@@ after $he notices that so many of $his fellow fucktoys cum harder if $he gives them a good slap. <<set _slave.fetish = "sadist", _slave.fetishStrength = 65>> <</if>> - <<elseif (_masterSuiteAverageSadism > 50) && (_fetishChangeChance > random(0,50))>> + <<elseif (_msAvg.sadism > 50) && (_fetishChangeChance > random(0,50))>> <<if _slave.fetish == "masochist">> <<if $verboseDescriptions == 1>>$His<<else>>_slave.slaveName's<</if>> @@.lightcoral;pain addiction deepens,@@ since the fuckpit is full of ladies happy to fuck $him while $he screams. <<set _slave.fetishStrength += 4>>