diff --git a/src/endWeek/saServeThePublic.js b/src/endWeek/saServeThePublic.js index 6661da312c6033bff52ffa45cc1ec436099116d8..79563d0b7e71f92c2b15156842f64b339e251580 100644 --- a/src/endWeek/saServeThePublic.js +++ b/src/endWeek/saServeThePublic.js @@ -104,67 +104,40 @@ window.saServeThePublic = (function saServeThePublic() { } // ads if (V.clubAdsSpending !== 0) { - if (V.clubAdsStacked === 1) { - if (isStacked(slave)) { - r += ` ${His} stacked body fits ${V.clubName}'s ad campaign, getting ${him} more attention.`; - } - } else if (V.clubAdsStacked === -1) { - if (isSlim(slave)) { - r += ` ${His} slim body fits ${V.clubName}'s ad campaign, getting ${him} more attention.`; - } + const adcats = App.Ads.Categories; // for brevity + if (V.clubAdsStacked === 1 && adcats.assetSize.classifySlave(slave) === 1) { + r += ` ${His} stacked body fits ${V.clubName}'s ad campaign, getting ${him} more attention.`; + } else if (V.clubAdsStacked === -1 && adcats.assetSize.classifySlave(slave) === -1) { + r += ` ${His} slim body fits ${V.clubName}'s ad campaign, getting ${him} more attention.`; } - if (V.clubAdsPreg === 1) { - if (slave.bellyPreg >= 5000 || slave.bellyImplant >= 5000) { - r += ` ${His} gravid body fits ${V.clubName}'s ad campaign, getting ${him} more attention.`; - } - } else if (V.clubAdsPreg === -1) { - if (slave.belly < 100 && slave.weight < 30 && !setup.fakeBellies.includes(slave.bellyAccessory) && slave.bellyImplant <= 0) { - r += ` ${His} flat belly fits ${V.clubName}'s ad campaign, getting ${him} more attention.`; - } + if (V.clubAdsPreg === 1 && adcats.preg.classifySlave(slave) === 1) { + r += ` ${His} gravid body fits ${V.clubName}'s ad campaign, getting ${him} more attention.`; + } else if (V.clubAdsPreg === -1 && adcats.preg.classifySlave(slave) === -1) { + r += ` ${His} flat belly fits ${V.clubName}'s ad campaign, getting ${him} more attention.`; } - if (V.clubAdsModded === 1) { - if ((V.modScore > 15) || (V.piercingScore > 8 && V.tatScore > 5)) { - r += ` Body art like ${hers} is a major draw.`; - } - } else if (V.clubAdsModded === -1) { - if (slave.corsetPiercing === 0 && V.piercingScore < 3 && V.tatScore < 2) { - r += ` Very clean bodies like ${hers} are a major draw.`; - } + if (V.clubAdsModded === 1 && adcats.mods.classifySlave(slave) === 1) { + r += ` Body art like ${hers} is a major draw.`; + } else if (V.clubAdsModded === -1 && adcats.mods.classifySlave(slave) === -1) { + r += ` Very clean bodies like ${hers} are a major draw.`; } - if (V.clubAdsImplanted === 1) { - if (slave.boobsImplant > 0 && slave.buttImplant > 0 && slave.waist < -10 && slave.lipsImplant > 0) { - r += ` Many citizens come to ${V.clubName} looking to fuck a plastic slut like ${him}.`; - } - } else if (V.clubAdsImplanted === -1) { - if (slave.boobsImplant === 0 && slave.buttImplant === 0 && slave.waist >= -95 && slave.lipsImplant === 0 && slave.bellyImplant === -1 && slave.faceImplant < 30) { - r += ` Many citizens come to ${V.clubName} looking to get with a natural ${girl} like ${him}.`; - } + if (V.clubAdsImplanted === 1 && adcats.assetOrigin.classifySlave(slave) === 1) { + r += ` Many citizens come to ${V.clubName} looking to fuck a plastic slut like ${him}.`; + } else if (V.clubAdsImplanted === -1 && adcats.assetOrigin.classifySlave(slave) === -1) { + r += ` Many citizens come to ${V.clubName} looking to get with a natural ${girl} like ${him}.`; } - if (V.clubAdsOld === 1) { - if (slave.physicalAge >= 30) { - r += ` ${He}'s perfect for ${V.clubName}, which practically exists to match citizens up with mature slaves.`; - } - } else if (V.clubAdsOld === -1) { - if (slave.physical < 30 && slave.physical >= 18) { - r += ` ${He}'s perfect for ${V.clubName}, which practically exists to match citizens up with young slaves.`; - } - } else if (V.clubAdsOld === -2) { - if (slave.physical <= 18 && slave.physical >= 13) { - r += ` ${He}'s perfect for ${V.clubName}, which practically exists to match citizens up with teenage slaves.`; - } - } else if (V.clubAdsOld === -3) { - if (slave.physical < 13) { - r += ` ${He}'s perfect for ${V.clubName}, which practically exists to match citizens up with ${loli} slaves.`; - } + if (V.clubAdsOld === 1 && adcats.age.classifySlave(slave) === 1) { + r += ` ${He}'s perfect for ${V.clubName}, which practically exists to match citizens up with mature slaves.`; + } else if (V.clubAdsOld === -1 && adcats.age.classifySlave(slave) === -1) { + r += ` ${He}'s perfect for ${V.clubName}, which practically exists to match citizens up with young slaves.`; + } else if (V.clubAdsOld === -2 && adcats.age.classifySlave(slave) === -2) { + r += ` ${He}'s perfect for ${V.clubName}, which practically exists to match citizens up with teenage slaves.`; + } else if (V.clubAdsOld === -3 && adcats.age.classifySlave(slave) === -3) { + r += ` ${He}'s perfect for ${V.clubName}, which practically exists to match citizens up with ${loli} slaves.`; } - if (V.clubAdsXX === 1) { - if (slave.dick === 0 && slave.scrotum === 0) { - r += ` Almost everyone who comes to ${V.clubName} is looking to fuck a ${girl} like ${him}.`; - } - } else if (V.clubAdsXX === -1) { - if (slave.dick > 0) { - r += ` Almost everyone who comes to ${V.clubName} is looking to poke a ${girl} who cums when buttfucked.`; - } + if (V.clubAdsXX === 1 && adcats.genitalia.classifySlave(slave) === 1) { + r += ` Almost everyone who comes to ${V.clubName} is looking to fuck a ${girl} like ${him}.`; + } else if (V.clubAdsXX === -1 && adcats.genitalia.classifySlave(slave) === -1) { + r += ` Almost everyone who comes to ${V.clubName} is looking to poke a ${girl} who cums when buttfucked.`; } } if ((slave.hears === -1 && slave.earwear !== "hearing aids") || (slave.hears === 0 && slave.earwear === "muffling ear plugs") || (slave.hears === -2)) { diff --git a/src/endWeek/saWhore.js b/src/endWeek/saWhore.js index b918d766a2bbee801506c7ff0f073a45983946b8..aac1cf556a3e9a0d112b33230cb440dca08af6ea 100644 --- a/src/endWeek/saWhore.js +++ b/src/endWeek/saWhore.js @@ -134,67 +134,40 @@ window.saWhore = (function saWhore() { } // ads if (V.brothelAdsSpending !== 0) { - if (V.brothelAdsStacked === 1) { - if (isStacked(slave)) { - r += ` ${His} stacked body fits ${V.brothelName}'s ad campaign, getting ${him} more business.`; - } - } else if (V.brothelAdsStacked === -1) { - if (isSlim(slave)) { - r += ` ${His} slim body fits ${V.brothelName}'s ad campaign, getting ${him} more business.`; - } + const adcats = App.Ads.Categories; // for brevity + if (V.brothelAdsStacked === 1 && adcats.assetSize.classifySlave(slave) === 1) { + r += ` ${His} stacked body fits ${V.brothelName}'s ad campaign, getting ${him} more business.`; + } else if (V.brothelAdsStacked === -1 && adcats.assetSize.classifySlave(slave) === -1) { + r += ` ${His} slim body fits ${V.brothelName}'s ad campaign, getting ${him} more business.`; } - if (V.brothelAdsPreg === 1) { - if (slave.bellyPreg >= 5000 || slave.bellyImplant >= 5000) { - r += ` ${His} gravid body fits ${V.brothelName}'s ad campaign, getting ${him} more attention.`; - } - } else if (V.brothelAdsPreg === -1) { - if (slave.belly < 100 && slave.weight < 30 && !setup.fakeBellies.includes(slave.bellyAccessory) && slave.bellyImplant <= 0) { - r += ` ${His} flat belly fits ${V.brothelName}'s ad campaign, getting ${him} more attention.`; - } + if (V.brothelAdsPreg === 1 && adcats.preg.classifySlave(slave) === 1) { + r += ` ${His} gravid body fits ${V.brothelName}'s ad campaign, getting ${him} more attention.`; + } else if (V.brothelAdsPreg === -1 && adcats.preg.classifySlave(slave) === -1) { + r += ` ${His} flat belly fits ${V.brothelName}'s ad campaign, getting ${him} more attention.`; } - if (V.brothelAdsModded === 1) { - if ((V.modScore > 15) || (V.piercingScore > 8 && V.tatScore > 5)) { - r += ` Body art like ${hers} is a major draw.`; - } - } else if (V.brothelAdsModded === -1) { - if (slave.corsetPiercing === 0 && V.piercingScore < 3 && V.tatScore < 2) { - r += ` Very clean bodies like ${hers} are a major draw.`; - } + if (V.brothelAdsModded === 1 && adcats.mods.classifySlave(slave) === 1) { + r += ` Body art like ${hers} is a major draw.`; + } else if (V.brothelAdsModded === -1 && adcats.mods.classifySlave(slave) === -1) { + r += ` Very clean bodies like ${hers} are a major draw.`; } - if (V.brothelAdsImplanted === 1) { - if (slave.boobsImplant > 0 && slave.buttImplant > 0 && slave.waist < -10 && slave.lipsImplant > 0) { - r += ` Many citizens come to ${V.brothelName} looking to rent a plastic slut like ${him}.`; - } - } else if (V.brothelAdsImplanted === -1) { - if (slave.boobsImplant === 0 && slave.buttImplant === 0 && slave.waist >= -95 && slave.lipsImplant === 0 && slave.bellyImplant === -1 && slave.faceImplant < 30) { - r += ` Many citizens come to ${V.brothelName} looking to play with a natural ${girl} like ${him}.`; - } + if (V.brothelAdsImplanted === 1 && adcats.assetOrigin.classifySlave(slave) === 1) { + r += ` Many citizens come to ${V.brothelName} looking to rent a plastic slut like ${him}.`; + } else if (V.brothelAdsImplanted === -1 && adcats.assetOrigin.classifySlave(slave) === -1) { + r += ` Many citizens come to ${V.brothelName} looking to play with a natural ${girl} like ${him}.`; } - if (V.brothelAdsOld === 1) { - if (slave.physicalAge >= 30) { - r += ` ${He}'s perfect for ${V.brothelName}, whose brand is mature slaves.`; - } - } else if (V.brothelAdsOld === -1) { - if (slave.physical < 30 && slave.physical >= 18) { - r += ` ${He}'s perfect for ${V.brothelName}, whose brand is young slaves.`; - } - } else if (V.brothelAdsOld === -2) { - if (slave.physical <= 18 && slave.physical >= 13) { - r += ` ${He}'s perfect for ${V.brothelName}, whose brand is teenage slaves.`; - } - } else if (V.brothelAdsOld === -3) { - if (slave.physical < 13) { - r += ` ${He}'s perfect for ${V.brothelName}, whose brand is ${loli} slaves.`; - } + if (V.brothelAdsOld === 1 && adcats.age.classifySlave(slave) === 1) { + r += ` ${He}'s perfect for ${V.brothelName}, whose brand is mature slaves.`; + } else if (V.brothelAdsOld === -1 && adcats.age.classifySlave(slave) === -1) { + r += ` ${He}'s perfect for ${V.brothelName}, whose brand is young slaves.`; + } else if (V.brothelAdsOld === -2 && adcats.age.classifySlave(slave) === -2) { + r += ` ${He}'s perfect for ${V.brothelName}, whose brand is teenage slaves.`; + } else if (V.brothelAdsOld === -3 && adcats.age.classifySlave(slave) === -3) { + r += ` ${He}'s perfect for ${V.brothelName}, whose brand is ${loli} slaves.`; } - if (V.brothelAdsXX === 1) { - if (slave.dick === 0) { - r += ` Almost everyone who comes to ${V.brothelName} is looking to fuck a ${girl} like ${him}.`; - } - } else if (V.brothelAdsXX === -1) { - if (slave.dick > 0) { - r += ` Almost everyone who comes to ${V.brothelName} is looking to pound a ${girl} who cums when buttfucked.`; - } + if (V.brothelAdsXX === 1 && adcats.genitalia.classifySlave(slave) === 1) { + r += ` Almost everyone who comes to ${V.brothelName} is looking to fuck a ${girl} like ${him}.`; + } else if (V.brothelAdsXX === -1 && adcats.genitalia.classifySlave(slave) === -1) { + r += ` Almost everyone who comes to ${V.brothelName} is looking to pound a ${girl} who cums when buttfucked.`; } } if (V.Madam !== 0) { diff --git a/src/js/ads.js b/src/js/ads.js new file mode 100644 index 0000000000000000000000000000000000000000..43dde7d684983cdf4954db80c413f8954412e3ff --- /dev/null +++ b/src/js/ads.js @@ -0,0 +1,226 @@ +App.Ads = {}; +App.Ads.Categories = {}; + +/* Ad categories can classify individual slaves into many values, but at the facility level they get reduced to positive, zero, and negative to see whether the ads were effective */ + +App.Ads.Categories.age = { + varSuffix: "Old", + + classifySlave: function(slave) { + if (isYoung(slave)) { + if (slave.physicalAge >= 18) { + return -1; // young adult + } else if (slave.physicalAge >= 13) { + return -2; // teen + } else { + return -3; // loli + } + } + return 1; // mature + }, + + classifyLocalPreference: function() { + if ((V.arcologies[0].FSMaturityPreferentialist !== "unset") && (V.arcologies[0].FSMaturityPreferentialist >= 80)) { + return 1; // mature + } else if ((V.arcologies[0].FSYouthPreferentialist !== "unset") && (V.arcologies[0].FSYouthPreferentialist >= 80)) { + return -1; // young + } + return 0; + } +}; + +App.Ads.Categories.assetSize = { + varSuffix: "Stacked", + + classifySlave: function(slave) { + if (isStacked(slave)) { + return 1; + } else if (isSlim(slave)) { + return -1; + } else { + return 0; + } + }, + + classifyLocalPreference: function() { + if ((V.arcologies[0].FSAssetExpansionist !== "unset") && (V.arcologies[0].FSAssetExpansionist >= 80)) { + return 1; // stacked + } else if ((V.arcologies[0].FSSlimnessEnthusiast !== "unset") && (V.arcologies[0].FSSlimnessEnthusiast >= 80)) { + return -1; // slim + } + return 0; + } +}; + +App.Ads.Categories.assetOrigin = { + varSuffix: "Implanted", + + classifySlave: function(slave) { + if (isSurgicallyImproved(slave)) { + return 1; + } else if (isPure(slave)) { + return -1; + } + return 0; + }, + + classifyLocalPreference: function() { + if ((V.arcologies[0].FSTransformationFetishist !== "unset") && (V.arcologies[0].FSTransformationFetishist >= 80)) { + return 1; // implanted + } else if ((V.arcologies[0].FSBodyPurist !== "unset") && (V.arcologies[0].FSBodyPurist >= 80)) { + return -1; // natural + } + return 0; + } +}; + +App.Ads.Categories.mods = { + varSuffix: "Modded", + + classifySlave: function(slave) { + if (SlaveStatsChecker.isModded(slave)) { + return 1; + } else if (SlaveStatsChecker.isUnmodded(slave)) { + return -1; + } + return 0; + }, + + classifyLocalPreference: function() { + if ((V.arcologies[0].FSDegradationist !== "unset") && (V.arcologies[0].FSDegradationist >= 80)) { + return 1; // modded + } else if ((V.arcologies[0].FSBodyPurist !== "unset") && (V.arcologies[0].FSBodyPurist >= 80)) { + return -1; // natural + } + return 0; + } +}; + +App.Ads.Categories.preg = { + varSuffix: "Preg", + + classifySlave: function(slave) { + if (isPreg(slave)) { + return 1; + } else if (isNotPreg(slave)) { + return -1; + } + return 0; + }, + + classifyLocalPreference: function() { + if ((V.arcologies[0].FSRepopulationFocus !== "unset") && (V.arcologies[0].FSRepopulationFocus >= 80)) { + return 1; // pregnant + } else if ((V.arcologies[0].FSRestart !== "unset") && (V.arcologies[0].FSRestart >= 80)) { + return -1; // non-pregnant + } + return 0; + } +}; + +App.Ads.Categories.genitalia = { + varSuffix: "XX", + + classifySlave: function(slave) { + if (slave.dick === 0 && slave.vagina > -1) { + return 1; // pussies, no dicks + } else if (slave.dick > 0) { + return -1; // dicks, pussies optional + } + return 0; // null? + }, + + classifyLocalPreference: function() { + if ((V.arcologies[0].FSGenderFundamentalist !== "unset") && (V.arcologies[0].FSGenderFundamentalist >= 80)) { + return 1; // pussies, no dicks + } else if ((V.arcologies[0].FSGenderRadicalist !== "unset") && (V.arcologies[0].FSGenderRadicalist >= 80)) { + return -1; // dicks, pussies optional + } + return 0; + } +}; + +/** Returns all the ad categories in the system. */ +App.Ads.getAllCategories = function() { + return _.values(App.Ads.Categories); +}; + +/** Manages the ads for a facility. Use example: <<set _adMgr = new App.Ads.AdManager("brothel")>> */ +App.Ads.AdManager = class { + constructor(facility) { + this.varPrefix = `${facility}Ads`; + this.totalSlaves = 0; + for (const cat of App.Ads.getAllCategories()) { + this[`tally${cat.varSuffix}`] = []; + } + } + + /** categorizes a girl in all the categories, adds the results to the running totals, and returns the total categories in which she matches the advertisements */ + tallySlave(slave) { + let matchedCategories = 0; + + ++this.totalSlaves; + for (const cat of App.Ads.getAllCategories()) { + const result = cat.classifySlave(slave); + this[`tally${cat.varSuffix}`][result] = (this[`tally${cat.varSuffix}`][result] || 0) + 1; + if (result === V[`${this.varPrefix}${cat.varSuffix}`]) { + ++matchedCategories; + } + } + + return matchedCategories; + } + + _coalesceTally(category) { + const catArr = this[`tally${category.varSuffix}`]; + let neg = 0; + let pos = 0; + catArr.forEach((tally, index) => { if (index < 0) { neg += tally; } else if (index > 0) { pos += tally; } /* index == 0 is deliberately ignored */ }); + return {neg, pos}; + } + + /** returns -1 if the majority of the girls have a negative value, +1 if the majority of the girls have a positive value, and 0 otherwise */ + slavesMajority(category) { + const {neg, pos} = this._coalesceTally(category); + if (neg > this.totalSlaves * 0.5) { + return -1; + } else if (pos > this.totalSlaves * 0.5) { + return +1; + } else { + return 0; + } + } + + /** returns true if the majority of the girls fit the local preferences in the given category */ + slavesMatchPrefs(category) { + const majority = this.slavesMajority(category); + return (majority !== 0 && majority === category.classifyLocalPreference()); + } + + /** returns true if the majority of the girls fit the ad campaign in the given category */ + slavesMatchAds(category) { + const majority = this.slavesMajority(category); + return (majority !== 0 && majority === V[`${this.varPrefix}${category.varSuffix}`]); + } + + /** returns true if the local preferences match the ad campaign in the given category */ + prefsMatchAds(category) { + const prefs = category.classifyLocalPreference(); + return (prefs !== 0 && prefs === V[`${this.varPrefix}${category.varSuffix}`]); + } + + /** returns -1 if the category qualifies for a variety bonus but the facility failed to get it, 1 if the category qualifies for a variety bonus and the facility got it, or 0 if it did not qualify */ + varietyBonus(category) { + // qualifies for variety bonus only if the category has no preference, we are spending money on ads, and our ads show no preference + if (category.classifyLocalPreference() !== 0 || V[`${this.varPrefix}Spending`] === 0 || V[`${this.varPrefix}${category.varSuffix}`] !== 0) { + return 0; + } + // check to see if we acheived variety bonus + const {neg, pos} = this._coalesceTally(category); + if (neg > 0 && pos > 0 && Math.abs(pos - neg) <= (this.totalSlaves / 3)) { + return 1; // got it + } else { + return -1; // qualified but failed + } + } +}; diff --git a/src/js/economyJS.js b/src/js/economyJS.js index dc6376c4614b2a772baa9c3554beaa583f850db3..a0e774d17243374708430c50fd831313abad2737 100644 --- a/src/js/economyJS.js +++ b/src/js/economyJS.js @@ -1114,6 +1114,8 @@ window.slaveJobValues = function(lowerClassSexDemandRef, middleClassSexDemandRef const BL = V.BrothiIDs.length; V.clubSlavesGettingHelp = 0; V.brothelSlavesGettingHelp = 0; + let clubAdManager = new this.App.Ads.AdManager("club"); + let brothelAdManager = new this.App.Ads.AdManager("brothel"); // This section is for specific slaves or non-unique slaves adding their values to the whole // Accounting for Fuckdolls @@ -1374,82 +1376,7 @@ window.slaveJobValues = function(lowerClassSexDemandRef, middleClassSexDemandRef V.clubSlavesGettingHelp += 1; } if (V.clubAdsSpending !== 0) { - if (V.clubAdsStacked === 1) { - if (isStacked(s) === true) { - beautyMultiplier += 0.05; - // $His stacked body fits $clubName's ad campaign, getting $him more attention. - } - } else if (V.clubAdsStacked === -1) { - if (isSlim(s) === true) { - beautyMultiplier += 0.05; - // $His slim body fits $clubName's ad campaign, getting $him more attention. - } - } - if (V.clubAdsPreg === 1) { - if (isPreg(s) === true) { - beautyMultiplier += 0.05; - // $His gravid body fits $clubName's ad campaign, getting $him more attention. - } - } else if (V.clubAdsPreg === -1) { - if (isNotPreg(s) === true) { - beautyMultiplier += 0.05; - // $His flat belly fits $clubName's ad campaign, getting $him more attention. - } - } - if (V.clubAdsModded === 1) { - if (SlaveStatsChecker.isModded(s) === true) { - beautyMultiplier += 0.05; - // Body art like $hers is a major draw. - } - } else if (V.clubAdsModded === -1) { - if (SlaveStatsChecker.isUnmodded(s) === true) { - beautyMultiplier += 0.05; - // Very clean bodies like $hers are a major draw. - } - } - if (V.clubAdsImplanted === 1) { - if (isSurgicallyImproved(s) === true) { - beautyMultiplier += 0.05; - // Many citizens come to $clubName looking to fuck a plastic slut like $him. - } - } else if (V.clubAdsImplanted === -1) { - if (isPure(s) === true) { - beautyMultiplier += 0.05; - // Many citizens come to $clubName looking to get with a natural $girl like $him. - } - } - if (V.clubAdsOld === 1) { - if (isYoung(s) === false) { - beautyMultiplier += 0.05; - // $He's perfect for $clubName, which practically exists to match citizens up with mature slaves. - } - } else if (V.clubAdsOld === -1) { - if (isYoung(s) === true && s.physical >= 18) { - beautyMultiplier += 0.05; - // $He's perfect for $clubName, which practically exists to match citizens up with young slaves. - } - } else if (V.clubAdsOld === -2) { - if (s.physical <= 18 && s.physical >= 13) { - beautyMultiplier += 0.05; - // $He's perfect for $clubName, which practically exists to match citizens up with teenage slaves. - } - } else if (V.clubAdsOld === -3) { - if (s.physical < 13) { - beautyMultiplier += 0.05; - // $He's perfect for $clubName, which practically exists to match citizens up with $loli slaves. - } - } - if (V.clubAdsXX === 1) { - if (s.dick === 0) { - beautyMultiplier += 0.05; - // Almost everyone who comes to $clubName is looking to fuck a $girl like $him. - } - } else if (V.clubAdsXX === -1) { - if (s.dick > 0) { - beautyMultiplier += 0.05; - // Almost everyone who comes to $clubName is looking to poke a $girl who cums when buttfucked. - } - } + beautyMultiplier += 0.05 * clubAdManager.tallySlave(s); } } if (s.assignment === "serve in the club" || toTheClub === 1) { @@ -1582,68 +1509,7 @@ window.slaveJobValues = function(lowerClassSexDemandRef, middleClassSexDemandRef } // ads if (V.brothelAdsSpending !== 0) { - if (V.brothelAdsStacked === 1) { - if (isStacked(s)) { - beautyMultiplier += 0.05; - } - } else if (V.brothelAdsStacked === -1) { - if (isSlim(s)) { - beautyMultiplier += 0.05; - } - } - if (V.brothelAdsPreg === 1) { - if (s.bellyPreg >= 5000 || s.bellyImplant >= 5000) { - beautyMultiplier += 0.05; - } - } else if (V.brothelAdsPreg === -1) { - if (s.belly < 100 && s.weight < 30 && !setup.fakeBellies.includes(s.bellyAccessory) && s.bellyImplant <= 0) { - beautyMultiplier += 0.05; - } - } - if (V.brothelAdsModded === 1) { - if ((V.modScore > 15) || (V.piercingScore > 8 && V.tatScore > 5)) { - beautyMultiplier += 0.05; - } - } else if (V.brothelAdsModded === -1) { - if (s.corsetPiercing === 0 && V.piercingScore < 3 && V.tatScore < 2) { - beautyMultiplier += 0.05; - } - } - if (V.brothelAdsImplanted === 1) { - if (s.boobsImplant > 0 && s.buttImplant > 0 && s.waist < -10 && s.lipsImplant > 0) { - beautyMultiplier += 0.05; - } - } else if (V.brothelAdsImplanted === -1) { - if (s.boobsImplant === 0 && s.buttImplant === 0 && s.waist >= -95 && s.lipsImplant === 0 && s.bellyImplant === -1 && s.faceImplant < 30) { - beautyMultiplier += 0.05; - } - } - if (V.brothelAdsOld === 1) { - if (s.physicalAge >= 30) { - beautyMultiplier += 0.05; - } - } else if (V.brothelAdsOld === -1) { - if (s.physical < 30 && s.physical >= 18) { - beautyMultiplier += 0.05; - } - } else if (V.brothelAdsOld === -2) { - if (s.physical <= 18 && s.physical >= 13) { - beautyMultiplier += 0.05; - } - } else if (V.brothelAdsOld === -3) { - if (s.physical < 13) { - beautyMultiplier += 0.05; - } - } - if (V.brothelAdsXX === 1) { - if (s.dick === 0 && s.scrotum === 0) { - beautyMultiplier += 0.05; - } - } else if (V.brothelAdsXX === -1) { - if (s.dick > 0) { - beautyMultiplier += 0.05; - } - } + beautyMultiplier += 0.05 * brothelAdManager.tallySlave(s); } if (V.Madam !== 0) { if (V.madamCashBonus > 0) { diff --git a/src/uncategorized/brothelReport.tw b/src/uncategorized/brothelReport.tw index 8c2ff8ef817d2ee8c79f504bfdbe27c0740c0008..0fc5be246a647fb549d081b07ecd73eb4409687c 100644 --- a/src/uncategorized/brothelReport.tw +++ b/src/uncategorized/brothelReport.tw @@ -6,10 +6,11 @@ <<SlaveIDSort $BrothiIDs>> <<set _DL = $BrothiIDs.length, _SL = $slaves.length, $legendaryWhoreID = 0, _FLsFetish = 0, _profits = 0>> <<set $legendaryWombID = 0>> -<<set _modded = 0, _old = 0, _pure = 0, _slim = 0, _implanted = 0, _stacked = 0, _unmodded = 0, _XX = 0, _XY = 0, _young = 0, _pregYes = 0, _pregNo = 0, _minBonus = 50, _maxBonus = 150>> +<<set _minBonus = 50, _maxBonus = 150>> <!-- Statistics gathering --> <<set $facility = $facility || {}, $facility.brothel = initFacilityStatistics($facility.brothel)>> +<<set _adMgr = new App.Ads.AdManager("brothel")>> <<if ($Madam != 0)>> <<set _FLs = $slaveIndices[$Madam.ID]>> @@ -211,37 +212,7 @@ <</silently>> <</if>> <<set $Madam = $slaves[_FLs]>> - <<if isSlim($slaves[_FLs])>> - <<set _slim += 1>> - <</if>> - <<if isStacked($slaves[_FLs])>> - <<set _stacked += 1>> - <</if>> - <<if isYoung($slaves[_FLs])>> - <<set _young += 1>> - <<else>> - <<set _old += 1>> - <</if>> - <<if SlaveStatsChecker.isModded($slaves[_FLs])>> - <<set _modded += 1>> - <<elseif SlaveStatsChecker.isUnmodded($slaves[_FLs])>> - <<set _unmodded += 1>> - <</if>> - <<if isXY($slaves[_FLs])>> - <<set _XY += 1>> - <<else>> - <<set _XX += 1>> - <</if>> - <<if isPure($slaves[_FLs])>> - <<set _pure += 1>> - <<else>> - <<set _implanted += 1>> - <</if>> - <<if isPreg($slaves[_FLs])>> - <<set _pregYes += 1>> - <<elseif isNotPreg($slaves[_FLs])>> - <<set _pregNo += 1>> - <</if>> + <<run _adMgr.tallySlave($Madam)>> <</if>> <<if (_DL > 0)>> @@ -333,116 +304,11 @@ <<include "SA devotion">> <</silently>> <</if>> - <<if isSlim($slaves[$i])>> - <<set _slim += 1>> - <</if>> - <<if isStacked($slaves[$i])>> - <<set _stacked += 1>> - <</if>> - <<if isYoung($slaves[$i])>> - <<set _young += 1>> - <<else>> - <<set _old += 1>> - <</if>> - <<if SlaveStatsChecker.isModded($slaves[$i])>> - <<set _modded += 1>> - <<elseif SlaveStatsChecker.isUnmodded($slaves[$i])>> - <<set _unmodded += 1>> - <</if>> - <<if isXY($slaves[$i])>> - <<set _XY += 1>> - <<else>> - <<set _XX += 1>> - <</if>> - <<if isPure($slaves[$i])>> - <<set _pure += 1>> - <<else>> - <<set _implanted += 1>> - <</if>> - <<if isPreg($slaves[$i])>> - <<set _pregYes += 1>> - <<elseif isNotPreg($slaves[$i])>> - <<set _pregNo += 1>> - <</if>> - <<if $brothelAdsSpending != 0>> - <<set _seed = 0>> - <<if $brothelAdsStacked == 1>> - <<if ($slaves[$i].butt > 4) && ($slaves[$i].boobs > 800)>> - <<set _seed++>> - <</if>> - <<elseif $brothelAdsStacked == -1>> - <<if ($slaves[$i].boobs < 500) && ($slaves[$i].butt < 3) && ($slaves[$i].weight <= 10) && ($slaves[$i].muscles <= 95)>> - <<set _seed++>> - <</if>> - <</if>> - <<set _PierceC = ($slaves[$i].lipsPiercing + $slaves[$i].nipplesPiercing + $slaves[$i].vaginaPiercing + $slaves[$i].clitPiercing + $slaves[$i].anusPiercing + $slaves[$i].earPiercing + $slaves[$i].eyebrowPiercing + $slaves[$i].nosePiercing + $slaves[$i].navelPiercing)>> - <<if $brothelAdsModded == 1>> - <<if (_PierceC > 8)>> - <<if ($slaves[$i].lipsTat != 0) && ($slaves[$i].buttTat != 0) && ($slaves[$i].anusTat != 0) && ($slaves[$i].vaginaTat != 0) && ($slaves[$i].boobsTat != 0)>> - <<set _seed++>> - <</if>> - <</if>> - <<elseif $brothelAdsModded == -1>> - <<if (_PierceC < 3)>> - <<if ($slaves[$i].lipsTat == 0) && ($slaves[$i].buttTat == 0) && ($slaves[$i].vaginaTat == 0) && ($slaves[$i].boobsTat == 0)>> - <<set _seed++>> - <</if>> - <</if>> - <</if>> - <<if $brothelAdsPreg == 1>> - <<if ($slaves[$i].bellyPreg >= 5000) || ($slaves[$i].bellyImplant >= 5000)>> - <<set _seed++>> - <</if>> - <<elseif $brothelAdsPreg == -1>> - <<if ($slaves[$i].belly < 100) && ($slaves[$i].weight < 30) && (!setup.fakeBellies.includes($bellyAccessory)) && ($slaves[$i].bellyImplant <= 0)>> - <<set _seed++>> - <</if>> - <</if>> - <<if $brothelAdsImplanted == 1>> - <<if ($slaves[$i].boobsImplant > 0) && ($slaves[$i].buttImplant > 0) && ($slaves[$i].waist < -95) && ($slaves[$i].lipsImplant > 0) && ($slaves[$i].bellyImplant >= 1500)>> - <<set _seed++>> - <</if>> - <<elseif $brothelAdsImplanted == -1>> - <<if $slaves[$i].boobsImplant == 0 && $slaves[$i].buttImplant == 0 && $slaves[$i].waist >= -95 && $slaves[$i].lipsImplant == 0 && $slaves[$i].faceImplant < 30 && $slaves[$i].bellyImplant <= 0>> - <<set _seed++>> - <</if>> - <</if>> - <<if $brothelAdsOld == 1>> - <<if ($slaves[$i].physicalAge >= 30)>> - <<set _seed++>> - <</if>> - <<elseif $brothelAdsOld == -1>> - <<if ($slaves[$i].physicalAge < 30) && ($slaves[$i].physicalAge >= 18)>> - <<set _seed++>> - <</if>> - <<elseif $brothelAdsOld == -2>> - <<if ($slaves[$i].physicalAge <= 18) && ($slaves[$i].physicalAge >= 13)>> - <<set _seed++>> - <</if>> - <<elseif $brothelAdsOld == -3>> - <<if ($slaves[$i].physicalAge < 13)>> - <<set _seed++>> - <</if>> - <</if>> - <<if $brothelAdsXX == 1>> - <<if ($slaves[$i].dick == 0)>> - <<set _seed++>> - <</if>> - <<elseif $brothelAdsXX == -1>> - <<if ($slaves[$i].dick > 0)>> - <<set _seed++>> - <</if>> - <</if>> - <<if _seed > 0>> - <<set _adsIncome = _seed * random(50,60) * Math.trunc($brothelAdsSpending/1000)>> - <<set _cashX = _adsIncome, getSlaveStatisticData($slaves[$i], $facility.brothel).adsIncome += _adsIncome>> - <<run cashX(_cashX, "brothelAds")>> - <<else>> - <<set _adsIncome = random(50,60) * Math.trunc($brothelAdsSpending/1000)>> - <<set _cashX = _adsIncome, getSlaveStatisticData($slaves[$i], $facility.brothel).adsIncome += _adsIncome>> - <<run cashX(_cashX, "brothelAds")>> - <</if>> - <</if>> + + <<set _seed = Math.max(_adMgr.tallySlave($slaves[$i]), 1)>> + <<set _adsIncome = _seed * random(50,60) * Math.trunc($brothelAdsSpending/1000)>> + <<set _cashX = _adsIncome, getSlaveStatisticData($slaves[$i], $facility.brothel).adsIncome += _adsIncome>> + <<run cashX(_cashX, "brothelAds")>> <</for>> <<set _profits += $cash-_oldCash, _oldCash = $cash, _possibleBonuses = 0, _brothelBonuses = 0>> @@ -451,6 +317,7 @@ <<if $brothelAdsSpending != 0>> An ad campaign is supporting business there, and whores that match it make more ¤. <</if>> + <<set _adcats = App.Ads.Categories>> /* for brevity */ <br> <<if $brothelAdsSpending != 0>> @@ -465,34 +332,26 @@ <<set _ads = 0>> <</if>> <</if>> - <<if ($arcologies[0].FSAssetExpansionist != "unset") && ($arcologies[0].FSAssetExpansionist >= 80)>> + <<set _pref = _adcats.assetSize.classifyLocalPreference(), _girls = _adMgr.slavesMajority(_adcats.assetSize)>> + <<if _pref === 1>> Most customers prefer their girls well endowed. - <<set _pref = 1>> - <<elseif ($arcologies[0].FSSlimnessEnthusiast != "unset") && ($arcologies[0].FSSlimnessEnthusiast >= 80) >> + <<elseif _pref === -1>> Most customers prefer their girls light. - <<set _pref = -1>> <<else>> - <<if ($arcologies[0].FSAssetExpansionist == "unset") && ($arcologies[0].FSSlimnessEnthusiast == "unset")>> - <<if ($brothelAdsSpending == 0) || ($brothelAdsStacked == 0)>> - <<set _possibleBonuses++>> - <<if (_slim > 0) && (_stacked > 0) && (Math.abs(_slim-_stacked) <= (_DL/3))>> - <<set _adsIncome = _DL*random(20,30),$facility.brothel.adsIncome += _adsIncome, _brothelBonuses++>> - <<run cashX(_adsIncome, "brothelAds")>> - The brothel offers a @@.yellowgreen;wide@@ variety of slim and stacked slaves. - <</if>> - <</if>> + <<set _variety = _adMgr.varietyBonus(_adcats.assetSize)>> + <<set _possibleBonuses += Math.abs(_variety)>> + <<if _variety === 1>> + <<set _adsIncome = _DL*random(20,30), $facility.brothel.adsIncome += _adsIncome, _brothelBonuses++>> + <<run cashX(_adsIncome, "brothelAds")>> + The brothel offers a @@.yellowgreen;wide@@ variety of slim and stacked slaves. <</if>> Most customers don't mind the selection of assets. - <<set _pref = 0>> <</if>> - <<if (_slim > (_DL/2))>> - <<set _girls = -1>> + <<if _girls === -1>> Most of the slaves in the brothel have small tits and asses. - <<elseif (_stacked > (_DL/2))>> - <<set _girls = 1>> + <<elseif _girls === 1>> Most of the slaves in the brothel have large tits and asses. <<else>> - <<set _girls = 0>> The slaves in the brothel vary in asset size. <</if>> <<if (_pref == 0)>> /*customers don't care*/ @@ -535,34 +394,26 @@ <<set _ads = 0>> <</if>> <</if>> - <<if ($arcologies[0].FSRepopulationFocus != "unset") && ($arcologies[0].FSRepopulationFocus >= 80)>> + <<set _pref = _adcats.preg.classifyLocalPreference(), _girls = _adMgr.slavesMajority(_adcats.preg)>> + <<if _pref === 1>> Most customers prefer their girls rounded with child. - <<set _pref = 1>> - <<elseif ($arcologies[0].FSRestart != "unset") && ($arcologies[0].FSRestart >= 80)>> + <<elseif _pref === -1>> Most customers prefer girls that aren't gravid. - <<set _pref = -1>> <<else>> - <<if ($arcologies[0].FSRepopulationFocus == "unset") && ($arcologies[0].FSRestart == "unset")>> - <<if ($brothelAdsSpending == 0) || ($brothelAdsPreg == 0)>> - <<set _possibleBonuses++>> - <<if (_pregYes > 0) && (_pregNo > 0) && (Math.abs(_pregYes-_pregNo) <= (_DL/3))>> - <<set _adsIncome = _DL*random(20,30), $facility.brothel.adsIncome += _adsIncome, _brothelBonuses++>> - <<run cashX(_adsIncome, "brothelAds")>> - The brothel offers a @@.yellowgreen;wide@@ selection of slaves with a variety of middles. - <</if>> - <</if>> + <<set _variety = _adMgr.varietyBonus(_adcats.preg)>> + <<set _possibleBonuses += Math.abs(_variety)>> + <<if _variety === 1>> + <<set _adsIncome = _DL*random(20,30), $facility.brothel.adsIncome += _adsIncome, _brothelBonuses++>> + <<run cashX(_adsIncome, "brothelAds")>> + The brothel offers a @@.yellowgreen;wide@@ selection of slaves with a variety of middles. <</if>> Most customers don't have preferences for either big-bellied or flat-bellied girls. - <<set _pref = 0>> <</if>> - <<if (_pregNo > (_DL/2))>> - <<set _girls = -1>> + <<if _girls === -1>> Most of the slaves in the brothel sport flat bellies. - <<elseif (_pregYes > (_DL/2))>> - <<set _girls = 1>> + <<elseif _girls === 1>> Most of the slaves in the brothel sport gravid middles. <<else>> - <<set _girls = 0>> The slaves in the brothel vary in belly type. <</if>> <<if _pref == 0>> /*customers don't care*/ @@ -605,38 +456,30 @@ <<set _ads = 0>> <</if>> <</if>> - <<if ($arcologies[0].FSDegradationist != "unset") && ($arcologies[0].FSDegradationist >= 80)>> + <<set _pref = _adcats.mods.classifyLocalPreference(), _girls = _adMgr.slavesMajority(_adcats.mods)>> + <<if _pref === 1>> Most customers prefer heavily modified girls. - <<set _pref = 1>> - <<elseif ($arcologies[0].FSBodyPurist != "unset") && ($arcologies[0].FSBodyPurist >= 80) >> + <<elseif _pref === -1>> Most customers prefer natural girls. - <<set _pref = -1>> <<else>> - <<if ($arcologies[0].FSDegradationist == "unset") && ($arcologies[0].FSBodyPurist == "unset")>> - <<if ($brothelAdsSpending == 0) || ($brothelAdsModded == 0)>> - <<set _possibleBonuses++>> - <<if (_modded > 0) && (_unmodded > 0) && (Math.abs(_modded-_unmodded) <= (_DL/3))>> - <<set _adsIncome = _DL*random(20,30), $facility.brothel.adsIncome += _adsIncome, _brothelBonuses++>> - <<run cashX(_adsIncome, "brothelAds")>> - The brothel offers a @@.yellowgreen;both@@ a selection of heavily altered slaves and those with more natural bodies. - <</if>> - <</if>> + <<set _variety = _adMgr.varietyBonus(_adcats.mods)>> + <<set _possibleBonuses += Math.abs(_variety)>> + <<if _variety === 1>> + <<set _adsIncome = _DL*random(20,30), $facility.brothel.adsIncome += _adsIncome, _brothelBonuses++>> + <<run cashX(_adsIncome, "brothelAds")>> + The brothel offers a @@.yellowgreen;both@@ a selection of heavily altered slaves and those with more natural bodies. <</if>> Most customers don't have preferences for either modded or natural slaves. - <<set _pref = 0>> <</if>> - <<if (_modded > (_DL/2))>> - <<set _girls = 1>> + <<if _girls === 1>> Most of the slaves in the brothel are heavily pierced and tattooed. - <<elseif (_unmodded > (_DL/2))>> - <<set _girls = -1>> + <<elseif _girls === -1>> Most of the slaves in the brothel have natural, unmodded bodies. <<else>> - <<set _girls = 0>> Some girls in the brothel have piercings or tattoos, some have none and others have both. <</if>> <<if (_pref == 0)>> /*customers don't care*/ - <<elseif ($brothelAdsSpending > 0) && (_pref != 0)>> + <<elseif ($brothelAdsSpending > 0)>> <<if (_ads == _pref) && (_girls == _ads)>> <<set _adsIncome = _DL*random(20,30), $facility.brothel.adsIncome += _adsIncome, _brothelBonuses++>> <<run cashX(_adsIncome, "brothelAds")>> @@ -674,34 +517,26 @@ <<set _ads = 0>> <</if>> <</if>> - <<if ($arcologies[0].FSTransformationFetishist != "unset") && ($arcologies[0].FSTransformationFetishist >= 80)>> + <<set _pref = _adcats.assetOrigin.classifyLocalPreference(), _girls = _adMgr.slavesMajority(_adcats.assetOrigin)>> + <<if _pref === 1>> Most customers prefer their girls fake. - <<set _pref = 1>> - <<elseif ($arcologies[0].FSBodyPurist != "unset") && ($arcologies[0].FSBodyPurist >= 80)>> + <<elseif _pref === 0>> Most customers prefer all-natural girls. - <<set _pref = -1>> <<else>> - <<if ($arcologies[0].FSTransformationFetishist == "unset") && ($arcologies[0].FSBodyPurist == "unset")>> - <<if ($brothelAdsSpending == 0) || ($brothelAdsImplanted == 0)>> - <<set _possibleBonuses++>> - <<if (_implanted > 0) && (_pure > 0) && (Math.abs(_implanted-_pure) <= (_DL/3))>> - <<set _adsIncome = _DL*random(20,30), $facility.brothel.adsIncome += _adsIncome, _brothelBonuses++>> - <<run cashX(_adsIncome, "brothelAds")>> - The brothel offers @@.yellowgreen;both@@ all-natural girls, and slaves whose beauty has been improved by surgical means. - <</if>> - <</if>> + <<set _variety = _adMgr.varietyBonus(_adcats.assetOrigin)>> + <<set _possibleBonuses += Math.abs(_variety)>> + <<if _variety === 1>> + <<set _adsIncome = _DL*random(20,30), $facility.brothel.adsIncome += _adsIncome, _brothelBonuses++>> + <<run cashX(_adsIncome, "brothelAds")>> + The brothel offers @@.yellowgreen;both@@ all-natural girls, and slaves whose beauty has been improved by surgical means. <</if>> Most customers don't have preferences for either all-natural or surgically enhanced and implanted girls. - <<set _pref = 0>> <</if>> - <<if (_implanted > (_DL/2))>> - <<set _girls = 1>> + <<if _girls === 1>> Most of the slaves in the brothel are heavily implanted or surgically enhanced. - <<elseif (_pure > (_DL/2))>> - <<set _girls = -1>> + <<elseif _girls === -1>> Most of the slaves in the brothel have naturally pure bodies. <<else>> - <<set _girls = 0>> The slaves in the brothel vary in body modification. <</if>> <<if _pref == 0>> /*customers don't care*/ @@ -744,32 +579,26 @@ <<set _ads = 0>> <</if>> <</if>> - <<if ($arcologies[0].FSGenderFundamentalist != "unset") && ($arcologies[0].FSGenderFundamentalist >= 80)>> + <<set _pref = _adcats.genitalia.classifyLocalPreference(), _girls = _adMgr.slavesMajority(_adcats.genitalia)>> + <<if _pref === 1>> Most customers prefer girls with pussies. - <<set _pref = 1>> - <<elseif ($arcologies[0].FSGenderRadicalist != "unset") && ($arcologies[0].FSGenderRadicalist >= 80)>> + <<elseif _pref === -1>> Most customers prefer girls with dicks. - <<set _pref = -1>> <<else>> - <<if ($brothelAdsSpending == 0) || ($brothelAdsXX == 0)>> - <<set _possibleBonuses++>> - <<if (_XX > 0) && (_XY > 0) && (Math.abs(_XX-_XY) <= (_DL/3))>> - <<set _adsIncome = _DL*random(20,30), $facility.brothel.adsIncome += _adsIncome, _brothelBonuses++>> - <<run cashX(_adsIncome, "brothelAds")>> - The brothel offers a @@.yellowgreen;mix@@ of whores that can appeal to varied tastes in genitalia. - <</if>> + <<set _variety = _adMgr.varietyBonus(_adcats.genitalia)>> + <<set _possibleBonuses += Math.abs(_variety)>> + <<if _variety === 1>> + <<set _adsIncome = _DL*random(20,30), $facility.brothel.adsIncome += _adsIncome, _brothelBonuses++>> + <<run cashX(_adsIncome, "brothelAds")>> + The brothel offers a @@.yellowgreen;mix@@ of whores that can appeal to varied tastes in genitalia. <</if>> Most customers don't have preferences for either girls with dicks or girls with pussies. - <<set _pref = 0>> <</if>> - <<if (_XX > (_DL/2))>> - <<set _girls = 1>> + <<if _girls === 1>> Most of the slaves in the brothel have female genitalia. - <<elseif (_XY > (_DL/2))>> + <<elseif _girls === -1>> Most of the slaves in the brothel have male genitalia. - <<set _girls = -1>> <<else>> - <<set _girls = 0>> The slaves in the brothel vary in genitalia. <</if>> <<if _pref == 0>> /*customers don't care*/ @@ -819,34 +648,26 @@ <<set _ads = 0>> <</switch>> <</if>> - <<if ($arcologies[0].FSMaturityPreferentialist != "unset") && ($arcologies[0].FSMaturityPreferentialist >= 80)>> + <<set _pref = _adcats.age.classifyLocalPreference(), _girls = _adMgr.slavesMajority(_adcats.age)>> + <<if _pref === 1>> Most customers prefer mature girls. - <<set _pref = 1>> - <<elseif ($arcologies[0].FSYouthPreferentialist != "unset") && ($arcologies[0].FSYouthPreferentialist >= 80)>> + <<elseif _pref === -1>> Most customers prefer young girls. - <<set _pref = -1>> <<else>> - <<if ($arcologies[0].FSMaturityPreferentialist == "unset") && ($arcologies[0].FSYouthPreferentialist == "unset")>> - <<if ($brothelAdsSpending == 0) || ($brothelAdsOld == 0)>> - <<set _possibleBonuses++>> - <<if (_young > 0) && (_old > 0) && (Math.abs(_young-_old) <= (_DL/3))>> - <<set _adsIncome = _DL*random(20,30), $facility.brothel.adsIncome += _adsIncome, _brothelBonuses++>> - <<run cashX(_adsIncome, "brothelAds")>> - The brothel offers girls @@.yellowgreen;both@@ young and mature. - <</if>> - <</if>> + <<set _variety = _adMgr.varietyBonus(_adcats.age)>> + <<set _possibleBonuses += Math.abs(_variety)>> + <<if _variety === 1>> + <<set _adsIncome = _DL*random(20,30), $facility.brothel.adsIncome += _adsIncome, _brothelBonuses++>> + <<run cashX(_adsIncome, "brothelAds")>> + The brothel offers girls @@.yellowgreen;both@@ young and mature. <</if>> Most customers don't have preferences for either mature or young girls. - <<set _pref = 0>> <</if>> - <<if (_young > (_DL/2))>> - <<set _girls = -1>> + <<if _girls === -1>> Most of the slaves in the brothel are young. - <<elseif (_old > (_DL/2))>> - <<set _girls = 1>> + <<elseif _girls === 1>> Most of the slaves in the brothel are mature. <<else>> - <<set _girls = 0>> The slaves in the brothel vary in age. <</if>> <<if _pref == 0>> /*customers don't care*/ diff --git a/src/uncategorized/clubReport.tw b/src/uncategorized/clubReport.tw index 4fb40bec5a73e53b4e5ecee2e19febacc728dbfe..e5cd99a9aad59a9c835f62b3b6622fbe5bdf2075 100644 --- a/src/uncategorized/clubReport.tw +++ b/src/uncategorized/clubReport.tw @@ -6,10 +6,11 @@ <<SlaveIDSort $ClubiIDs>> <<set _DL = $ClubiIDs.length, _SL = $slaves.length, $clubBonuses = 0, $legendaryEntertainerID = 0, _FLsFetish = 0>> <<set $legendaryWombID = 0>> -<<set _implanted =0, _modded = 0, _old = 0, _pure = 0, _slim = 0, _stacked = 0, _unmodded = 0, _XX = 0, _XY = 0, _young = 0, _pregYes = 0, _pregNo = 0, _minBonus = 50, _maxBonus = 150>> +<<set _minBonus = 50, _maxBonus = 150>> <!-- Statistics gathering; income is rep boosts in numbers, and profit will be rep per cash unit, or cash unit per rep --> <<set $facility = $facility || {}, $facility.club = initFacilityStatistics($facility.club)>> +<<set _adMgr = new App.Ads.AdManager("club")>> <<if $DJ != 0>> <<set _FLs = $slaveIndices[$DJ.ID]>> @@ -140,37 +141,7 @@ <</silently>> <</if>> <<set $DJ = $slaves[_FLs]>> - <<if isSlim($slaves[_FLs])>> - <<set _slim += 1>> - <</if>> - <<if isStacked($slaves[_FLs])>> - <<set _stacked += 1>> - <</if>> - <<if isYoung($slaves[_FLs])>> - <<set _young += 1>> - <<else>> - <<set _old += 1>> - <</if>> - <<if SlaveStatsChecker.isModded($slaves[_FLs])>> - <<set _modded += 1>> - <<elseif SlaveStatsChecker.isUnmodded($slaves[_FLs])>> - <<set _unmodded += 1>> - <</if>> - <<if isXY($slaves[_FLs])>> - <<set _XY += 1>> - <<else>> - <<set _XX += 1>> - <</if>> - <<if isPure($slaves[_FLs])>> - <<set _pure += 1>> - <<else>> - <<set _implanted += 1>> - <</if>> - <<if isPreg($slaves[_FLs])>> - <<set _pregYes += 1>> - <<elseif isNotPreg($slaves[_FLs])>> - <<set _pregNo += 1>> - <</if>> + <<run _adMgr.tallySlave($DJ)>> <</if>> <<if (_DL > 0)>> @@ -248,44 +219,14 @@ <<include "SA devotion">> <</silently>> <</if>> - <<if isSlim($slaves[$i])>> - <<set _slim += 1>> - <</if>> - <<if isStacked($slaves[$i])>> - <<set _stacked += 1>> - <</if>> - <<if isYoung($slaves[$i])>> - <<set _young += 1>> - <<else>> - <<set _old += 1>> - <</if>> - <<if SlaveStatsChecker.isModded($slaves[$i])>> - <<set _modded += 1>> - <<elseif SlaveStatsChecker.isUnmodded($slaves[$i])>> - <<set _unmodded += 1>> - <</if>> - <<if isXY($slaves[$i])>> - <<set _XY += 1>> - <<else>> - <<set _XX += 1>> - <</if>> - <<if isPure($slaves[$i])>> - <<set _pure += 1>> - <<else>> - <<set _implanted += 1>> - <</if>> - <<if isPreg($slaves[$i])>> - <<set _pregYes += 1>> - <<elseif isNotPreg($slaves[$i])>> - <<set _pregNo += 1>> - <</if>> + <<run _adMgr.tallySlave($slaves[$i])>> <</for>> <br><br> - <<if $clubAdsSpending != 0>> An ad campaign is getting citizens into the club every night, and sluts that match it gratify patrons. <</if>> + <<set _adcats = App.Ads.Categories>> /* for brevity */ <br> <<if $clubAdsSpending != 0>> @@ -300,34 +241,26 @@ <<set _ads = 0>> <</if>> <</if>> - <<if ($arcologies[0].FSAssetExpansionist != "unset") && ($arcologies[0].FSAssetExpansionist >= 80)>> + <<set _pref = _adcats.assetSize.classifyLocalPreference(), _girls = _adMgr.slavesMajority(_adcats.assetSize)>> + <<if _pref === 1>> Most customers prefer stacked girls. - <<set _pref = 1>> - <<elseif ($arcologies[0].FSSlimnessEnthusiast != "unset") && ($arcologies[0].FSSlimnessEnthusiast >= 80) >> + <<elseif _pref === -1>> Most customers prefer slim girls. - <<set _pref = -1>> <<else>> - <<if ($arcologies[0].FSAssetExpansionist == "unset") && ($arcologies[0].FSSlimnessEnthusiast == "unset")>> - <<if ($clubAdsSpending == 0) || ($clubAdsStacked == 0)>> - <<set _possibleBonuses++>> - <<if (_slim > 0) && (_stacked > 0) && (Math.abs(_slim-_stacked) <= (_DL/3))>> - <<set $clubBonuses++>> - <<run repX(_DL*random(5,10), "club")>> - There is a @@.green;wide@@ variety of slim and stacked slaves working the club. - <</if>> - <</if>> + <<set _variety = _adMgr.varietyBonus(_adcats.assetSize)>> + <<set _possibleBonuses += Math.abs(_variety)>> + <<if _variety === 1>> + <<set $clubBonuses++>> + <<run repX(_DL*random(5,10), "club")>> + There is a @@.green;wide@@ variety of slim and stacked slaves working the club. <</if>> Most customers don't have preferences for either slim or stacked slaves. - <<set _pref = 0>> <</if>> - <<if (_slim > (_DL/2))>> - <<set _girls = -1>> + <<if _girls === -1>> Most of the slaves in the club are slim. - <<elseif (_stacked > (_DL/2))>> - <<set _girls = 1>> + <<elseif _girls === 1>> Most of the slaves in the club are stacked. <<else>> - <<set _girls = 0>> The slaves in the club vary in slimness. <</if>> <<if _pref == 0>> /*customers don't care*/ @@ -369,34 +302,26 @@ <<set _ads = 0>> <</if>> <</if>> - <<if ($arcologies[0].FSDegradationist != "unset") && ($arcologies[0].FSDegradationist >= 80)>> + <<set _pref = _adcats.mods.classifyLocalPreference(), _girls = _adMgr.slavesMajority(_adcats.mods)>> + <<if _pref === 1>> Most customers prefer heavily pierced and tattooed girls. - <<set _pref = 1>> - <<elseif ($arcologies[0].FSBodyPurist != "unset") && ($arcologies[0].FSBodyPurist >= 80) >> + <<elseif _pref === -1>> Most customers prefer natural girls. - <<set _pref = -1>> <<else>> - <<if ($arcologies[0].FSDegradationist == "unset") && ($arcologies[0].FSBodyPurist == "unset")>> - <<if ($clubAdsSpending == 0) || ($clubAdsModded == 0)>> - <<set _possibleBonuses++>> - <<if (_modded > 0) && (_unmodded > 0) && (Math.abs(_modded-_unmodded) <= (_DL/3))>> - <<set $clubBonuses++>> - <<run repX(_DL*random(5,10), "club")>> - There are @@.green;both@@ heavily pierced and tattooed slaves and slaves with more natural bodies filling the club. - <</if>> - <</if>> + <<set _variety = _adMgr.varietyBonus(_adcats.mods)>> + <<set _possibleBonuses += Math.abs(_variety)>> + <<if _variety === 1>> + <<set $clubBonuses++>> + <<run repX(_DL*random(5,10), "club")>> + There are @@.green;both@@ heavily pierced and tattooed slaves and slaves with more natural bodies filling the club. <</if>> Most customers don't have preferences for either natural or heavily body modded girls. - <<set _pref = 0>> <</if>> - <<if (_modded > (_DL/2))>> - <<set _girls = 1>> + <<if _girls === 1>> Most of the slaves in the club are heavily pierced and tattooed. - <<elseif (_unmodded > (_DL/2))>> - <<set _girls = -1>> + <<elseif _girls === -1>> Most of the slaves in the club have natural unmodded bodies. <<else>> - <<set _girls = 0>> Some girls in the club have piercings or tattoos, some do not and others have both. <</if>> <<if _pref == 0>> /*customers don't care*/ @@ -438,34 +363,26 @@ <<set _ads = 0>> <</if>> <</if>> - <<if ($arcologies[0].FSTransformationFetishist != "unset") && ($arcologies[0].FSTransformationFetishist >= 80)>> + <<set _pref = _adcats.assetOrigin.classifyLocalPreference(), _girls = _adMgr.slavesMajority(_adcats.assetOrigin)>> + <<if _pref === 1>> Most customers prefer heavily implanted and surgically enhanced girls. - <<set _pref = 1>> - <<elseif ($arcologies[0].FSBodyPurist != "unset") && ($arcologies[0].FSBodyPurist >= 80) >> + <<elseif _pref === -1>> Most customers prefer all-natural girls. - <<set _pref = -1>> <<else>> - <<if ($arcologies[0].FSTransformationFetishist == "unset") && ($arcologies[0].FSBodyPurist == "unset")>> - <<if ($clubAdsSpending == 0) || ($clubAdsImplanted == 0)>> - <<set _possibleBonuses++>> - <<if (_implanted > 0) && (_pure > 0) && (Math.abs(_implanted-_pure) <= (_DL/3))>> - <<set $clubBonuses++>> - <<run repX(_DL*random(5,10), "club")>> - Citizens in $clubName can easily find @@.yellowgreen;both@@ all-natural girls, and slaves whose beauty has been improved by surgical means. - <</if>> - <</if>> + <<set _variety = _adMgr.varietyBonus(_adcats.assetOrigin)>> + <<set _possibleBonuses += Math.abs(_variety)>> + <<if _variety === 1>> + <<set $clubBonuses++>> + <<run repX(_DL*random(5,10), "club")>> + Citizens in $clubName can easily find @@.yellowgreen;both@@ all-natural girls, and slaves whose beauty has been improved by surgical means. <</if>> Most customers don't have preferences for either all-natural or surgically enhanced and implanted girls. - <<set _pref = 0>> <</if>> - <<if (_implanted > (_DL/2))>> - <<set _girls = 1>> + <<if _girls === 1>> Most of the slaves in the club are heavily implanted or surgically enhanced. - <<elseif (_pure > (_DL/2))>> - <<set _girls = -1>> + <<elseif _girls === -1>> Most of the slaves in the club have naturally pure bodies. <<else>> - <<set _girls = 0>> The slaves in the club vary in body modification. <</if>> <<if _pref == 0>> /*customers don't care*/ @@ -508,32 +425,26 @@ <<set _ads = 0>> <</if>> <</if>> - <<if ($arcologies[0].FSGenderFundamentalist != "unset") && ($arcologies[0].FSGenderFundamentalist >= 80)>> + <<set _pref = _adcats.genitalia.classifyLocalPreference(), _girls = _adMgr.slavesMajority(_adcats.genitalia)>> + <<if _pref === 1>> Most customers prefer girls with pussies. - <<set _pref = 1>> - <<elseif ($arcologies[0].FSGenderRadicalist != "unset") && ($arcologies[0].FSGenderRadicalist >= 80)>> + <<elseif _pref === -1>> Most customers prefer girls with dicks. - <<set _pref = -1>> <<else>> - <<if ($clubAdsSpending == 0) || ($clubAdsXX == 0)>> - <<set _possibleBonuses++>> - <<if (_XX > 0) && (_XY > 0) && (Math.abs(_XX-_XY) <= (_DL/3))>> - <<set $clubBonuses++>> - <<run repX(_DL*random(5,10), "club")>> - The club offers a @@.green;mix@@ of sluts that can appeal to varied tastes in genitalia. - <</if>> + <<set _variety = _adMgr.varietyBonus(_adcats.genitalia)>> + <<set _possibleBonuses += Math.abs(_variety)>> + <<if _variety === 1>> + <<set $clubBonuses++>> + <<run repX(_DL*random(5,10), "club")>> + The club offers a @@.green;mix@@ of sluts that can appeal to varied tastes in genitalia. <</if>> Most customers don't have preferences for either girls with dicks or girls with pussies. - <<set _pref = 0>> <</if>> - <<if (_XX > (_DL/2))>> - <<set _girls = 1>> + <<if _girls === 1>> Most of the slaves in the club have female genitalia. - <<elseif (_XY > (_DL/2))>> + <<elseif _girls === -1>> Most of the slaves in the club have male genitalia. - <<set _girls = -1>> <<else>> - <<set _girls = 0>> The slaves in the club vary in genitalia. <</if>> <<if _pref == 0>> /*customers don't care*/ @@ -583,34 +494,26 @@ <<set _ads = 0>> <</switch>> <</if>> - <<if ($arcologies[0].FSMaturityPreferentialist != "unset") && ($arcologies[0].FSMaturityPreferentialist >= 80)>> + <<set _pref = _adcats.age.classifyLocalPreference(), _girls = _adMgr.slavesMajority(_adcats.age)>> + <<if _pref === 1>> Most customers prefer mature girls. - <<set _pref = 1>> - <<elseif ($arcologies[0].FSYouthPreferentialist != "unset") && ($arcologies[0].FSYouthPreferentialist >= 80)>> + <<elseif _pref === -1>> Most customers prefer young girls. - <<set _pref = -1>> <<else>> - <<if ($arcologies[0].FSMaturityPreferentialist == "unset") && ($arcologies[0].FSYouthPreferentialist == "unset")>> - <<if ($clubAdsSpending == 0) || ($clubAdsOld == 0)>> - <<set _possibleBonuses++>> - <<if (_young > 0) && (_old > 0) && (Math.abs(_young-_old) <= (_DL/3))>> - <<set $clubBonuses++>> - <<run repX(_DL*random(5,10), "club")>> - There are girls @@.green;both@@ young and mature in $clubName. - <</if>> - <</if>> + <<set _variety = _adMgr.varietyBonus(_adcats.age)>> + <<set _possibleBonuses += Math.abs(_variety)>> + <<if _variety === 1>> + <<set $clubBonuses++>> + <<run repX(_DL*random(5,10), "club")>> + There are girls @@.green;both@@ young and mature in $clubName. <</if>> Most customers don't have preferences for either mature or young girls. - <<set _pref = 0>> <</if>> - <<if (_old > (_DL/2))>> - <<set _girls = 1>> + <<if _girls === 1>> Most of the slaves in the club are mature. - <<elseif (_young > (_DL/2))>> - <<set _girls = -1>> + <<elseif _girls === -1>> Most of the slaves in the club are young. <<else>> - <<set _girls = 0>> The slaves in the club vary in age. <</if>> <<if _pref == 0>> /*customers don't care*/ @@ -653,34 +556,26 @@ <<set _ads = 0>> <</if>> <</if>> - <<if ($arcologies[0].FSRepopulationFocus != "unset") && ($arcologies[0].FSRepopulationFocus >= 80)>> + <<set _pref = _adcats.preg.classifyLocalPreference(), _girls = _adMgr.slavesMajority(_adcats.preg)>> + <<if _pref === 1>> Most customers prefer their girls rounded with child. - <<set _pref = 1>> - <<elseif ($arcologies[0].FSRestart != "unset") && ($arcologies[0].FSRestart >= 80) >> + <<elseif _pref === -1>> Most customers prefer girls that aren't gravid. - <<set _pref = -1>> <<else>> - <<if ($arcologies[0].FSRepopulationFocus == "unset") && ($arcologies[0].FSRestart == "unset")>> - <<if ($clubAdsSpending == 0) || ($clubAdsPreg == 0)>> - <<set _possibleBonuses++>> - <<if (_pregYes > 0) && (_pregNo > 0) && (Math.abs(_pregYes-_pregNo) <= (_DL/3))>> - <<set $clubBonuses++>> - <<run repX(_DL*random(5,10), "club")>> - There is a @@.green;wide@@ selection of slaves with a variety of middles working the club. - <</if>> - <</if>> + <<set _variety = _adMgr.varietyBonus(_adcats.assetSize)>> + <<set _possibleBonuses += Math.abs(_variety)>> + <<if _variety === 1>> + <<set $clubBonuses++>> + <<run repX(_DL*random(5,10), "club")>> + There is a @@.green;wide@@ selection of slaves with a variety of middles working the club. <</if>> Most customers don't have preferences for either big-bellied or flat-bellied girls. - <<set _pref = 0>> <</if>> - <<if (_pregNo > (_DL/2))>> - <<set _girls = -1>> + <<if _girls === -1>> Most of the slaves in the club sport flat bellies. - <<elseif (_pregYes > (_DL/2))>> - <<set _girls = 1>> + <<elseif _girls === 1>> Most of the slaves in the club sport gravid middles. <<else>> - <<set _girls = 0>> The slaves in the club vary in belly type. <</if>> <<if (_pref == 0)>> /*customers don't care*/