From 2dea0a518bbcf72019acfded56efcc8140e0019f Mon Sep 17 00:00:00 2001 From: DCoded <dcoded@live.com> Date: Tue, 28 Jan 2020 12:46:11 -0500 Subject: [PATCH] Removed farmyardWidgets from main dev branch --- src/facilities/farmyard/farmyardWidgets.js | 491 --------------------- 1 file changed, 491 deletions(-) delete mode 100644 src/facilities/farmyard/farmyardWidgets.js diff --git a/src/facilities/farmyard/farmyardWidgets.js b/src/facilities/farmyard/farmyardWidgets.js deleted file mode 100644 index 0e099321b66..00000000000 --- a/src/facilities/farmyard/farmyardWidgets.js +++ /dev/null @@ -1,491 +0,0 @@ -// MAIN FUNCTIONS - -App.Facilities.Farmyard.farmyardReport = function farmyardReport() { - const - slaves = V.slaves, - Farmer = V.Farmer, - FL = V.FarmyardiIDs.length; - - let - t = ``, - profits = 0, - foodWeek = 0; - - t += `<span id="farmyardstats"></span>`; - SlaveSort.IDs(V.FarmyardiIDs); // TODO: not sure if I called this correctly - - if (Farmer) { - t += farmerHealth(Farmer); - t += farmerDevotion(Farmer); - t += farmerTrust(Farmer); - t += farmerLivingRules(Farmer); - const FLsFetish = farmerFetish(Farmer); - - getSlaveStatisticData(Farmer, V.facility.farmyard); // make sure we have registered living expenses - - t += farmerIntro(Farmer); - t += farmerRelationshipPC(Farmer); - t += farmerFetishEffects(Farmer, FLsFetish); - t += farmerSkill(Farmer); - t += farmerCashBonus(Farmer); - t += farmerAgeSkill(Farmer); - t += farmerExperience(Farmer); - t += farmerIntelligence(Farmer); - t += farmerDick(Farmer); - t += farmerSmell(Farmer); - t += farmerRelationshipSlaves(FL, Farmer); - t += farmerWorks(Farmer); - } - - t += farmhandCount(FL); - - if (Farmer) { - t += farmerEndWeek(Farmer); - } - - if (FL > 0) { - let oldCash = V.cash, - oldFood = V.food; - - for (let i = FL; i--;) { - V.i = V.slaveIndices[V.FarmyardiIDs[i]]; - const slave = slaves[V.i]; - App.Utils.setLocalPronouns(slave); - - t += farmhandLivingRules(slave); - t += farmhandHealth(slave); - t += farmhandDevotion(slave); - t += farmhandTrust(slave); - t += farmhandEnergy(slave); - t += farmhandEndWeek(slave); - profits += farmhandProfit(slave); - t += farmhandFood(slave); - } - - profits += V.cash - oldCash; // FIXME: equal to 0 - what is this supposed to represent? - oldCash = V.cash; - foodWeek += V.food + oldFood; - } - - t += farmyardStatsRecords(); - t += farmyardProfit(profits); - t += farmyardDecoration(); - t += farmyardStatsDisplay(); - - V.food += foodWeek; - - return t; -}; - -// HELPER FUNCTIONS - -// farmer - -const farmerHealth = function(slave) { - if (slave.health.condition < -80) { - improveCondition(slave, 20); - } else if (slave.health.condition < -40) { - improveCondition(slave, 15); - } else if (slave.health.condition < 0) { - improveCondition(slave, 10); - } else if (slave.health.condition < 90) { - improveCondition(slave, 7); - } -}; - -const farmerFetish = function(slave) { - let FLsFetish = 0; - - if (slave.fetish !== 'dom') { - if (fetishChangeChance(slave) > jsRandom(0, 100)) { - slave.fetishKnown = 1; slave.fetish = 'dom'; FLsFetish = 1; - } - } else if (!slave.fetishKnown) { - slave.fetishKnown = 1; FLsFetish = 1; - } else { - slave.fetishStrength += 4; FLsFetish = 2; - } - - return FLsFetish; -}; - -const farmerFetishEffects = function(slave, fetish = 0) { - App.Utils.setLocalPronouns(slave); - - if (fetish === 1) { - return `${He} isn't above sampling the merchandise ${himself}; before long it's obvious to ${his} workers that ${he} <span class="lightcoral">really likes fucking them.</span> `; - } else if (fetish === 2) { - return `${He}'s careful that all of the farmhands under ${his} supervision are all ready to work every morning, and ${he} <span class="lightsalmon">becomes more dominant.</span> `; - } -}; - -const farmerSkill = function(slave) { - let t = ``; - - App.Utils.setLocalPronouns(slave); - - if (slave.skill.farmer <= 10) { - t += `Though ${slave.slaveName} does ${his} best to manage the farmyard, with ${his} lack of skill ${he} can do little. `; - } else if (slave.skill.farmer <= 30) { - t += `${slave.slaveName}'s basic skills marginally <span class="yellowgreen">improve</span> business at ${V.farmyardName}. `; - } else if (slave.skill.farmer <= 60) { - t += `${slave.slaveName}'s skills <span class="yellowgreen">improve</span> business at ${V.farmyardName}. `; - } else if (slave.skill.farmer < 100) { - t += `${slave.slaveName}'s skills greatly <span class="yellowgreen">improve</span> business at ${V.farmyardName}. `; - } else { - t += `${slave.slaveName}'s mastery immensely <span class="yellowgreen">improves</span> business at ${V.farmyardName}. `; - } - - if (slave.actualAge > 35) { - t += `${His} age and experience also contribute. `; - } - - return t; -}; - -const farmerCashBonus = function(slave) { - let FarmerCashBonus = 0; - - if (slave.skill.farmer <= 10) { - FarmerCashBonus = 0; - } else if (slave.skill.farmer <= 30) { - FarmerCashBonus += 0.05; - } else if (slave.skill.farmer <= 60) { - FarmerCashBonus += 0.1; - } else if (slave.skill.farmer < 100) { - FarmerCashBonus += 0.15; - } else { - FarmerCashBonus += 0.20; - } - - if (slave.actualAge > 35) { - return slaveCashBonus += 0.05; - } else if (!V.AgePenalty) { - return slaveCashBonus += 0.05; - } - - if (slave.intelligence + slave.intelligenceImplant > 15) { - return FarmerCashBonus += 0.05 * Math.floor((slave.intelligence + slave.intelligenceImplant) / 32); - } - - if (setup.farmerCareers.includes(slave.career)) { - return FarmerCashBonus += 0.05; - } else if (slave.skill.farmer >= V.masteredXP) { - return FarmerCashBonus += 0.05; - } - - if (slave.dick > 2 && canPenetrate(slave)) { - return FarmerCashBonus += 0.05; - } - - if (!canSmell(slave)) { - return FarmerCashBonus += 0.05; - } - - if (Farmer.relationshipTarget === slave.ID) { - return FarmerCashBonus -= 0.05; - } else if (V.familyTesting && areRelated(Farmer, slave) > 0) { - return FarmerCashBonus += 0.05; - } else if (Farmer.relationTarget === slave.ID && !V.familyTesting) { - return FarmerCashBonus += 0.05; - } - - return FarmerCashBonus; -}; - -const farmerAgeSkill = function(slave) { - App.Utils.setLocalPronouns(slave); - - if (slave.actualAge > 35) { - return `${His} age and experience also contribute. `; - } -}; - -const farmerExperience = function(slave) { - App.Utils.setLocalPronouns(slave); - - if (setup.farmerCareers.includes(slave.career)) { - return `${He} has experience from ${his} life before ${he} was a slave that helps ${him} in the difficult life of managing animals and property. `; - } else if (slave.skill.farmer >= V.masteredXP) { - return `${He} has experience from working for you that helps ${him} in the difficult life of managing animals and property. `; - } else { - slave.skill.farmer += jsRandom(1, Math.ceil((slave.intelligence + slave.intelligenceImplant) / 32)); - } -}; - -const farmerIntelligence = function(slave) { - App.Utils.setLocalPronouns(slave); - - if (slave.intelligence + slave.intelligenceImplant > 15) { - return `${He} is a clever manager. `; - } -}; - -const farmerDick = function(slave) { - App.Utils.setLocalPronouns(slave); - - if (slave.dick > 2 && canPenetrate(slave)) { - return `${His} turgid dick helps ${him} manage ${his} workers. `; - } -}; - -const farmerSmell = function() { - if (!canSmell(slave)) { - return `${His} lack of a sense of smell protects ${him} from that omnipresent barnyard stench. `; - } -}; - -const farmerRelationshipSlaves = function(length, Farmer) { - for (let i = length; i--;) { - const - s = V.slaveIndices[V.FarmyardiIDs[i]], - slave = V.slaves[s]; - - let t = ``; - - App.Utils.setLocalPronouns(slave); - App.Utils.setLocalPronouns(Farmer, 2); - - if (Farmer.rivalryTarget === slave.ID) { - t += `${He2} forces ${his2} ${rivalryTerm(Farmer)} to service all the slaves in ${V.farmyardName}. `; // TODO: not sure about this - slave.devotion -= 2; slaves.trust -= 2; - if (canDoVaginal(slave)) { - seX(slave, 'vaginal', 'public', 'penetrative', 10); - } - if (canDoAnal(slave)) { - seX(slave, 'anal', 'public', 'penetrative', 10); - } - seX(slave, 'oral', 'public', 'penetrative', 10); - if (jsRandom(1, 100) > 65) { - Farmer.rivalry++; slave.rivalry++; - } - } else if (Farmer.relationshipTarget === slave.ID) { - t += `${He2} dotes over ${his2} ${relationshipTerm(Farmer)}, ${slave.slaveName}, making sure ${he} isn't worked too hard, but unfortunately manages to get in the way of ${his} work. `; - slave.devotion++; - } else if (V.familyTesting && areRelated(Farmer, slave) > 0) { - t += `${He2} pays special attention to ${his2} ${relativeTerm(Farmer.ID, slave.ID)}, ${slave.slaveName}, making sure ${he} is treated well and showing off ${his} skills. `; // TODO: does this need rewriting? - slave.trust++; - } else if (Farmer.relationTarget === slave.ID && !V.familyTesting) { - t += `${He2} pays special attention to ${his2} ${slave.relation}, ${slave.slaveName}, making sure ${he} is treated well and showing off ${his} skills. `; // TODO: does this need rewriting? - slave.trust++; - } - - return t; - } -}; - -const farmerWorks = function(slave) { - let - t = ``, - oldCash = V.cash, - seed, - beauty; - - App.Utils.setLocalPronouns(slave); - - if (V.showEWD) { - t += `<br> ${He} ${saWorkTheFarm(slave)}`; - } else { - t += `<<silently>>${saWorkTheFarm(slave)}<</silently>>`; // TODO: JSify <<silently>>? is it even needed? - } - - seed = V.cash - oldCash; - cashX(Math.trunc(0.5 * seed), 'farmyard'); - seed = Math.trunc(1.5 * seed); - profits += seed; - beauty = Beauty(V.activeSlave); - - t += `<br> Since ${he} doesn't have enough farmhands to manage to keep ${him} busy, ${he} sees ${beauty} customers ${himself} (${Math.trunc(beauty / 7)} a day), earning you <span class="yellowgreen">${cashFormat(seed)}</span> ${He} can charge more for ${his} time, since many citizens find it erotic to fuck the Farmer. `; - - return t; -}; - -const farmerEndWeek = function(slave) { - V.i = FLs; - - if (V.showEWD) { - t += `<br><br>`; - /* 000-250-006 */ // TODO: legacy - needed? - if (V.seeImages && V.seeReportImages) { - t += `<div class="imageRef tinyImg"> - ${SlaveArt(slave, 0, 0)} - </div>`; - } - /* 000-250-006 */ - t += `<u><strong><span class="pink">${SlaveFullName(slave)}</span></strong></u> is serving as the Farmer. `; - t += `<br> `; - t += `${saChoosesOwnClothes(slave)}`; - t += `<<include "SA rules">>`; - t += `<<include "SA diet">>`; - t += `<<include "SA long term effects">>`; - t += `<<include "SA drugs">>`; - t += `<<include "SA relationships">>`; - t += `<<include "SA rivalries">>`; - t += `<br><<include "SA devotion">>`; - } else { - t += `${saChoosesOwnClothes(slave)}`; - t += `<<include "SA rules">>`; - t += `<<include "SA diet">>`; - t += `<<include "SA long term effects">>`; - t += `<<include "SA drugs">>`; - t += `<<include "SA relationships">>`; - t += `<<include "SA rivalries">>`; - t += `<br><<include "SA devotion">>`; - } -}; - -const farmerRelationshipPC = function(slave) { - App.Utils.setLocalPronouns(slave); - - return slave.relationship === -3 && slave.devotion > 50 ? `As your loving ${wife}, ${he} does ${his} best to ensure ${V.farmyardName} runs smoothly. ` : ``; -}; - -const farmerIntro = (slave) => ` ${SlaveFullName(slave)} is serving as the Farmer. `; - -const farmerDevotion = (slave) => slave.devotion < 45 ? slave.devotion += 5 : null; - -const farmerTrust = (slave) => slave.trust < 45 ? slave.trust += 5 : null; - -const farmerLivingRules = (slave) => slave.rules.living !== 'luxurious' ? slave.rules.living = 'luxurious' : null; - -// farmhands - -const farmhandCount = (count) => count > 0 ? ` There ${count !== 1 ? `are ${count} farmhands` : `is one farmhand`} working out of ${V.farmyardName}` : null; - -const farmhandLivingRules = function(slave) { - switch (V.farmyardDecoration) { - case 'Degradation': - case 'standard': - slave.rules.living = 'spare'; - break; - case 'Roman Revivalist': - slave.rules.living = 'luxurious'; - break; - default: - slave.rules.living = 'normal'; - } - // TODO: should FS with 'spare' living rules cause minor health damage and devotion / trust loss? -}; - -const farmhandHealth = function(slave) { - if (slave.health.condition < -80) { - improveCondition(slave, 20); - } else if (slave.health.condition < -40) { - improveCondition(slave, 15); - } else if (slave.health.condition < 0) { - improveCondition(slave, 10); - } else if (slave.health.condition < 90) { - improveCondition(slave, 7); - } -}; - -// TODO: check over all of these numbers, make sure they make sense -const farmhandDevotion = function(slave) { - if (slave.devotion <= 20 && slave.trust >= -20) { - slave.devotion -= 5; slave.trust -= 5; - } else if (slave.devotion < 45) { - slave.devotion += 4; - } else if (slave.devotion > 50) { - slave.devotion -= 4; - } -}; - -const farmhandEndWeek = function(slave) { - App.Utils.setLocalPronouns(slave); - - if (V.showEWD) { - t += `<br><br>`; - /* 000-250-006 */ // TODO: legacy - needed? - if (V.seeImages && V.seeReportImages) { - t += `<div class="imageRef tinyImg"> - ${SlaveArt(slave, 0, 0)} - </div>`; - } - /* 000-250-006 */ - t += `<u><strong><span class="pink">${SlaveFullName(slave)}</span></strong></u> ${slave.choosesOwnAssignment === 2 ? `<<include "SA chooses own job>>` : `if working out of ${V.farmyardName}`}. `; - t += `<br> ${He} ${saWorkTheFarm(slave)}`; - t += `<br> `; - t += `${saChoosesOwnClothes(slave)}`; - t += `<<include "SA rules">>`; - t += `<<include "SA diet">>`; - t += `<<include "SA long term effects">>`; - t += `<<include "SA drugs">>`; - t += `<<include "SA relationships">>`; - t += `<<include "SA rivalries">>`; - t += `<br><<include "SA devotion">>`; - } else { - t += `<<include "SA chooses own job">>`; - t += `${saChoosesOwnClothes(slave)}`; - t += `<<include "SA rules">>`; - t += `<<include "SA diet">>`; - t += `<<include "SA long term effects">>`; - t += `<<include "SA drugs">>`; - t += `<<include "SA relationships">>`; - t += `<<include "SA rivalries">>`; - t += `<br><<include "SA devotion">>`; - } -}; - -const farmhandProfit = function(slave) { - let incomeStats = getSlaveStatisticData(slave, slave.assignment === Job.FARMYARD ? V.facility.farmyard : undefined); - return incomeStats.income; -}; - -const farmhandFood = function(slave) { - let - incomeStats = getSlaveStatisticData(slave, slave.assignment === Job.FARMYARD ? V.facility.farmyard : undefined), - foodWeek = 0; - - foodWeek += incomeStats.food; - if (V.farmMenials > 0) { - foodWeek += (V.farmMenials * 350); - } - - return foodWeek; -}; - -const farmhandTrust = (slave) => slave.trust < 30 ? slave.trust += 5 : null; - -const farmhandEnergy = (slave) => slave.energy > 40 && slave.energy < 95 ? slave.energy++ : null; - -// farmyard - -const farmyardStatsRecords = function() { - // TODO: check over these setters and remove those we don't need - let f = V.facility.farmyard; - - f.farmhandIncome = 0; - f.customers = 0; - f.farmhandCosts = 0; - f.rep = 0; - f.adsCosts = V.farmyardAdsSpending; - f.maintenance = V.farmyard * V.facilityCost; - f.totalIncome = f.farmhandIncome + f.adsIncome; - f.totalExpenses = f.farmhandCosts + f.maintenance; - f.profit = f.totalIncome - f.totalExpenses; - - for (let i of f.income.values()) { - f.farmhandIncome += i.income + i.adsIncome; - f.customers += i.customers; - f.farmhandCosts += i.cost; - f.rep += i.rep; - } -}; - -const farmyardDecoration = function() { - if (V.farmyardDecoration !== 'standard') { - t += `<br>${V.farmyardNameCaps}'s customer's enjoyed `; - if (V.seeBestiality && V.farmyardBreeding > 0 && (V.canines.length || V.hooved.length || V.felines.length)) { - t += `<span class="green">watching farmhands fuck animals in ${V.farmyardDecoration} surroundings.</span>`; - } else if (V.farmyardShows) { - t += `<span class="green">watching farmhands put on shows in ${V.farmyardDecoration} surroundings.</span>`; - } else { - // TODO: not sure about this one - t += `<span class="green">partaking of ${V.farmyardName}'s fine produce in its ${V.farmyardDecoration} décor.</span>`; - } - } -}; - -const farmyardProfit = (profit) => `${V.farmyardNameCaps} ${profit ? `makes you <span class="yellowgreen"${cashFormat(Math.trunc(profit))}</span> and` : ``} produced <span class="chocolate"${massFormat(foodWeek)}</span> of food this week. `; - -const farmyardStatsDisplay = () => `<<FarmyardStatistics 0>><<timed 50ms>><<replace #farmyardstats>><<FarmyardStatistics 1>><</replace>><</timed>>`; -- GitLab