diff --git a/js/003-data/gameVariableData.js b/js/003-data/gameVariableData.js index 71425c1b3a560524d84b7e1b9f1c74df0f80dfb9..580b2906b254b8db1f89ee644a56db66111ce247 100644 --- a/js/003-data/gameVariableData.js +++ b/js/003-data/gameVariableData.js @@ -794,10 +794,10 @@ App.Data.resetOnNGPlus = { masterSuiteNameCaps: "The Master Suite", // Nursery Subsection - nursery: 0, /* counts the number of children the nursery can support */ + nursery: 0, /* counts the number of children the nursery can support */ nurseryNannies: 0, /* counts the number of nannies the nursery can support */ nurseryBabies: 0, /* counts the number of children currently in the nursery */ - MatronInfluence: 0, /* check for whether the children are influenced by the Matron */ + MatronInfluence: 0, /* check for whether the children are influenced by the Matron */ nannyInfluence: 0, /* check for whether the children are influenced by the nannies */ nurseryDecoration: "standard", nurseryWeight: 0, @@ -816,7 +816,7 @@ App.Data.resetOnNGPlus = { sortNurseryList: "Unsorted", targetAgeNursery: 18, - // Farmyard Subsection %/ + // Farmyard Subsection farmyard: 0, farmyardShowgirls: [], /* array of farmhands putting on shows */ farmyardFarmers: [], /* array of farmhands farming */ @@ -834,7 +834,44 @@ App.Data.resetOnNGPlus = { activeHooved: 0, activeFeline: 0, animalsBought: { - canines: 0, hooved: 0, felines: 0, labradorRetrievers: 0, germanShepherds: 0, goldenRetrievers: 0, frenchBulldogs: 0, bulldogs: 0, beagles: 0, poodles: 0, rottweilers: 0, yorkshireTerriers: 0, siberianHuskies: 0, horses: 0, bulls: 0, pigs: 0, siameses: 0, persians: 0, maineCoons: 0, ragdolls: 0, bengals: 0, abbysinians: 0, birmans: 0, orientalShorthairs: 0, sphynxes: 0, russianBlues: 0, wolves: 0, foxes: 0, jackals: 0, dingos: 0, zebras: 0, cougars: 0, jaguars: 0, pumas: 0, lynx: 0, leopards: 0, lions: 0, tigers: 0 + canines: 0, + hooved: 0, + felines: 0, + labradorRetrievers: 0, + germanShepherds: 0, + goldenRetrievers: 0, + frenchBulldogs: 0, + bulldogs: 0, + beagles: 0, + poodles: 0, + rottweilers: 0, + yorkshireTerriers: 0, + siberianHuskies: 0, + horses: 0, + bulls: 0, + pigs: 0, + siameses: 0, + persians: 0, + maineCoons: 0, + ragdolls: 0, + bengals: 0, + abbysinians: 0, + birmans: 0, + orientalShorthairs: 0, + sphynxes: 0, + russianBlues: 0, + wolves: 0, + foxes: 0, + jackals: 0, + dingos: 0, + zebras: 0, + cougars: 0, + jaguars: 0, + pumas: 0, + lynx: 0, + leopards: 0, + lions: 0, + tigers: 0, }, canines: [], hooved: [], diff --git a/src/facilities/farmyard/reports/farmyardReport.js b/src/facilities/farmyard/reports/farmyardReport.js index 7cd5f8d1202d980702604cba083dab7233032be5..00485ad80bd791986f2a626f9ea14ee49ec858eb 100644 --- a/src/facilities/farmyard/reports/farmyardReport.js +++ b/src/facilities/farmyard/reports/farmyardReport.js @@ -1,19 +1,28 @@ App.Facilities.Farmyard.farmyardReport = function farmyardReport() { - "use strict"; + let frag = document.createDocumentFragment(); const - Farmer = V.Farmer, - FL = App.Entity.facilities.farmyard.employeesIDs().size; + slaves = App.Utils.sortedEmployees(App.Entity.facilities.farmyard), + devBonus = (V.farmyardDecoration !== "standard") ? 1 : 0, + Farmer = S.Farmer; + // arcology = V.arcologies[0]; let - t = ``, profits = 0, - foodWeek = 0; - let he, him, his, hers, himself, girl, loli, He, His; // TODO: alternative method? + foodWeek = 0, + farmerBonus = 0; - // FARMER + // MARK: FARMER + + function farmerChanges() { + farmerHealth(Farmer); + farmerDevotion(Farmer); + farmerTrust(Farmer); + farmerLivingRules(Farmer); + farmerCashBonus(Farmer); + } const farmerHealth = slave => { if (slave.health.condition < -80) { @@ -27,50 +36,22 @@ App.Facilities.Farmyard.farmyardReport = function farmyardReport() { } }; - const farmerFetish = slave => { - if (slave.fetish !== 'dom') { - if (fetishChangeChance(slave) > jsRandom(0, 100)) { - slave.fetishKnown = 1; - slave.fetish = 'dom'; - return 1; - } - } else if (!slave.fetishKnown) { - slave.fetishKnown = 1; - return 1; - } else { - slave.fetishStrength += 4; - return 2; - } - }; + const farmerDevotion = slave => { + slave.devotion += devBonus; - const farmerFetishEffects = (fetish = 0) => { - 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> `; + if (slave.devotion < 45) { + slave.devotion += 5; } }; - const farmerSkill = slave => { - let t = ``; - - 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}. `; + const farmerTrust = slave => { + if (slave.trust < 45) { + slave.trust += 5; } - - t += slave.actualAge > 35 ?`${His} age and experience also contribute. ` : ``; - - return t; }; + const farmerLivingRules = slave => slave.rules.living = 'luxurious'; + const farmerCashBonus = slave => { let FarmerCashBonus = Math.min(0.2, slave.skill.farmer * 0.002); @@ -103,49 +84,122 @@ App.Facilities.Farmyard.farmyardReport = function farmyardReport() { }; + + function farmerText() { + let r = []; + + r.push(farmerIntro(Farmer)); + r.push(farmerRelationshipPC(Farmer)); + r.push(farmerFetishEffects(Farmer, farmerFetish(Farmer))); + r.push(farmerSkill(Farmer)); + r.push(farmerAgeSkill(Farmer)); + r.push(farmerExperience(Farmer)); + r.push(farmerIntelligence(Farmer)); + r.push(farmerDick(Farmer)); + r.push(farmerSmell(Farmer)); + r.push(farmerRelationshipSlaves(Farmer)); + r.push(farmerContracts(Farmer)); + + return r.join(' '); + } + + const farmerFetish = slave => { + // FIXME: change this fetish to something else + if (slave.fetish !== 'dom') { + if (fetishChangeChance(slave) > jsRandom(0, 100)) { + slave.fetishKnown = 1; + slave.fetish = 'dom'; + return 1; + } + } else if (!slave.fetishKnown) { + slave.fetishKnown = 1; + return 1; + } else { + slave.fetishStrength += 4; + return 2; + } + }; + + const farmerFetishEffects = (slave, fetish = 0) => { + const + { he, his, himself, He } = getPronouns(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 = slave => { + const + { he, his } = getPronouns(slave); + + let r = []; + + if (slave.skill.farmer <= 10) { + r.push(`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) { + r.push(`${slave.slaveName}'s basic skills marginally <span class="yellowgreen">improve</span> business at ${V.farmyardName}.`); + } else if (slave.skill.farmer <= 60) { + r.push(`${slave.slaveName}'s skills <span class="yellowgreen">improve</span> business at ${V.farmyardName}.`); + } else if (slave.skill.farmer < 100) { + r.push(`${slave.slaveName}'s skills greatly <span class="yellowgreen">improve</span> business at ${V.farmyardName}.`); + } else { + r.push(`${slave.slaveName}'s mastery immensely <span class="yellowgreen">improves</span> business at ${V.farmyardName}.`); + } + + if (slave.actualAge > 35) { + r.push(`${His} age and experience also contribute.`); + } + + return r.join(' '); + }; + const farmerExperience = 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. `; + 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. `; + 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 farmerDick = slave => { if (slave.dick > 2 && canPenetrate(slave)) { - return `${His} turgid dick helps ${him} manage ${his} workers. `; + return `${His} turgid dick helps ${him} manage ${his} workers.`; } }; - /** @param {App.Entity.SlaveState} Farmer */ function farmerRelationshipSlaves(Farmer) { - const p = getPronouns(Farmer); - for (const slave of App.Utils.sortedEmployees(App.Entity.facilities.farmyard)) { + const { he, his, He } = getPronouns(Farmer); - let t = ``; + for (const slave of slaves) { + let r = []; if (Farmer.rivalryTarget === slave.ID) { - t += `${p.He} forces ${p.his} ${rivalryTerm(Farmer)} to service all the slaves in ${V.farmyardName}. `; // TODO: not sure about this + r.push(`${He} forces ${his} ${rivalryTerm(Farmer)} to service all the slaves in ${V.farmyardName}.`); // TODO: not sure about this slave.devotion -= 2; slave.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 += `${p.He} dotes over ${p.his} ${relationshipTerm(Farmer)}, ${slave.slaveName}, making sure ${he} isn't worked too hard, but unfortunately manages to get in the way of ${his} work. `; + r.push(`${He} dotes over ${his} ${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 (areRelated(Farmer, slave)) { - t += `${p.He} pays special attention to ${p.his} ${relativeTerm(Farmer, slave)}, ${slave.slaveName}, making sure ${he} is treated well and showing off ${his} skills. `; + r.push(`${He} pays special attention to ${his} ${relativeTerm(Farmer, slave)}, ${slave.slaveName}, making sure ${he} is treated well and showing off ${his} skills.`); slave.trust++; } @@ -153,87 +207,77 @@ App.Facilities.Farmyard.farmyardReport = function farmyardReport() { } } - const farmerWorks = slave => { - let - t = ``, - oldCash = V.cash, - seed, - beauty; - - if (V.showEWD) { - t += `<br> ${He} ${App.SlaveAssignment.workTheFarm(slave)}`; - } else { - App.SlaveAssignment.workTheFarm(slave); - } + // FIXME: will need to be redone + const farmerContracts = slave => { + const { he, his, himself, He } = getPronouns(slave); - seed = V.cash - oldCash; - cashX(Math.trunc(0.5 * seed), 'farmyard'); - seed = Math.trunc(1.5 * seed); - profits += seed; - beauty = Beauty(V.activeSlave); + let + r = []; - 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. `; + r.push(document.createElement("br")); + r.push(`<span class="indent">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.</span>`); - return t; + return r; }; - const farmerEndWeek = slave => { - let t = ``; + const farmerRelationshipPC = slave => { + if (slave.relationship === -3 && slave.devotion > 50) { + return `As your loving ${wife}, ${he} does ${his} best to ensure ${V.farmyardName} runs smoothly.`; + } + }; - 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 += `<span class="slave-name">${SlaveFullName(slave)}</span> is serving as the Farmer. `; - t += `<br> `; - t += App.SlaveAssignment.choosesOwnClothes(slave); - t += `<<include "SA rules">>`; - t += `<<include "SA diet">>`; - t += `<<include "SA long term effects">>`; - t += App.SlaveAssignment.drugs(slave); - t += `<<include "SA relationships">>`; - t += `<<include "SA rivalries">>`; - t += `<br><<include "SA devotion">>`; - } else { - App.SlaveAssignment.choosesOwnClothes(slave); - t += `<<silently>><<include "SA rules">><</silently>>`; - t += `<<silently>><<include "SA diet">><</silently>>`; - t += `<<silently>><<include "SA long term effects">><</silently>>`; - App.SlaveAssignment.drugs(slave); - t += `<<silently>><<include "SA relationships">><</silently>>`; - t += `<<silently>><<include "SA rivalries">><</silently>>`; - t += `<<silently>><br><<include "SA devotion">><</silently>>`; + const farmerAgeSkill = slave => { + if (slave.actualAge > 35) { + return `${His} age and experience also contribute.`; } + }; - return t; + const farmerIntelligence = slave => { + if (slave.intelligence + slave.intelligenceImplant > 15) { + return `${He} is a clever manager.`; + } }; - const farmerRelationshipPC = slave => slave.relationship === -3 && slave.devotion > 50 ? `As your loving ${wife}, ${he} does ${his} best to ensure ${V.farmyardName} runs smoothly. ` : ``; + const farmerSmell = slave => { + if (!canSmell(slave)) { + return `${His} lack of a sense of smell protects ${him} from that omnipresent barnyard stench.`; + } + }; - const farmerAgeSkill = slave => slave.actualAge > 35 ? `${His} age and experience also contribute. ` : ``; + const farmerIntro = slave => `<span class="indent">${SlaveFullName(slave)} is serving as the Farmer</span>.`; - const farmerIntelligence = slave => slave.intelligence + slave.intelligenceImplant > 15 ? `${He} is a clever manager. ` : ``; + if (Farmer) { + V.i = V.slaveIndices[Farmer.ID]; + App.Utils.setLocalPronouns(Farmer); // needed for "include"s - const farmerSmell = slave => !canSmell(slave) ? `${His} lack of a sense of smell protects ${him} from that omnipresent barnyard stench. ` : ``; + if (V.showEWD) { + const + farmerEntry = App.UI.DOM.appendNewElement("div", frag, '', "slave-report"); - const farmerIntro = slave => ` ${SlaveFullName(slave)} is serving as the Farmer. `; + if (V.seeImages && V.seeReportImages) { + App.UI.DOM.appendNewElement("div", farmerEntry, App.Art.SlaveArtElement(Farmer, 0, 0), ["imageRef", "tinyImg"]); + } - const farmerDevotion = slave => slave.devotion < 45 ? slave.devotion += 5 : null; + $(farmerEntry).append(`<span class="slave-name">${SlaveFullName(Farmer)}</span> is serving as your Matron.`); + $(farmerEntry).append(standardSlaveReport(Farmer, false)); + } else { + standardSlaveReport(Farmer, true); + } + } - const farmerTrust = slave => slave.trust < 45 ? slave.trust += 5 : null; + const + farmerEffects = App.UI.DOM.appendNewElement("p", frag, '', "indent"); - const farmerLivingRules = slave => slave.rules.living !== 'luxurious' ? slave.rules.living = 'luxurious' : null; + if (Farmer) { + farmerChanges(); + $(farmerEffects).append(farmerText()); + } - // FARMHANDS + // MARK: FARMHANDS - const farmhandCount = count => count > 0 ? ` There ${count !== 1 ? `are ${count} farmhands` : `is one farmhand`} working out of ${V.farmyardName}.` : ``; + const farmhandCount = count => `There ${count > 1 ? `are ${count} farmhands` : `is one farmhand`} working out of ${V.farmyardName}.`; const farmhandLivingRules = slave => { switch (V.farmyardDecoration) { @@ -273,43 +317,16 @@ App.Facilities.Farmyard.farmyardReport = function farmyardReport() { } }; - const farmhandEndWeek = slave => { - let t = ``; + if (slaves) { + const + intro = App.UI.DOM.appendNewElement("p", frag, '', "indent"); - 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 += `<span class="slave-name">${SlaveFullName(slave)}</span> ${slave.choosesOwnAssignment === 2 ? `<<include "SA chooses own job">>` : `is working out of ${V.farmyardName}`}. `; - t += `<br> ${He} ${App.SlaveAssignment.workTheFarm(slave)}`; - t += `<br> `; - t += App.SlaveAssignment.choosesOwnClothes(slave); - t += `<<include "SA rules">>`; - t += `<<include "SA diet">>`; - t += `<<include "SA long term effects">>`; - t += App.SlaveAssignment.drugs(slave); - t += `<<include "SA relationships">>`; - t += `<<include "SA rivalries">>`; - t += `<br><<include "SA devotion">>`; - } else { - t += `<<silently>><<include "SA chooses own job">><</silently>>`; - App.SlaveAssignment.choosesOwnClothes(slave); - t += `<<silently>><<include "SA rules">><</silently>>`; - t += `<<silently>><<include "SA diet">><</silently>>`; - t += `<<silently>><<include "SA long term effects">><</silently>>`; - App.SlaveAssignment.drugs(slave); - t += `<<silently>><<include "SA relationships">><</silently>>`; - t += `<<silently>><<include "SA rivalries">><</silently>>`; - t += `<<silently>><br><<include "SA devotion">><</silently>>`; - } + let r = []; - return t; - }; + r.push(farmhandCount); + + $(intro).append(r.join(' ')); + } const farmhandProfit = slave => { let incomeStats = getSlaveStatisticData(slave, slave.assignment === Job.FARMYARD ? V.facility.farmyard : undefined); @@ -319,9 +336,8 @@ App.Facilities.Farmyard.farmyardReport = function farmyardReport() { const farmhandFood = slave => { let incomeStats = getSlaveStatisticData(slave, slave.assignment === Job.FARMYARD ? V.facility.farmyard : undefined), - foodWeek = 0; + foodWeek = incomeStats.food || 0; - foodWeek += incomeStats.food; if (V.farmMenials > 0) { foodWeek += (V.farmMenials * 350); } @@ -333,8 +349,53 @@ App.Facilities.Farmyard.farmyardReport = function farmyardReport() { const farmhandEnergy = slave => slave.energy > 40 && slave.energy < 95 ? slave.energy++ : null; + for (const slave of slaves) { + V.i = V.slaveIndices[slave.ID]; + + slave.devotion += devBonus; + + App.Utils.setLocalPronouns(slave); // needed for "include"s + + if (V.showEWD) { + const + slaveEntry = App.UI.DOM.appendNewElement("div", frag, '', "slave-report"); + + if (V.seeImages && V.seeReportImages) { + App.UI.DOM.appendNewElement("div", slaveEntry, App.Art.SlaveArtElement(slave, 0, 0), ["imageRef", "tinyImg"]); + } + + $(slaveEntry).append(`<span class="slave-name">${SlaveFullName(slave)}</span> `); - // MENIALS + if (slave.choosesOwnAssignment === 2) { + $(slaveEntry).append(App.UI.DOM.renderPassage("SA chooses own job")); + } else { + $(slaveEntry).append(`is working out of ${V.nurseryName}.`); + } + + farmhandLivingRules(slave); + farmhandHealth(slave); + farmhandDevotion(slave); + farmhandTrust(slave); + farmhandEnergy(slave); + farmhandFood(slave); + profits += farmhandProfit(slave); + + t += farmhandEndWeek(slave); + + const + farmhandContent = App.UI.DOM.appendNewElement("div", slaveEntry, '', "indent"); + + $(farmhandContent).append(`${He} ${App.SlaveAssignment.workTheFarm(slave, farmerBonus)}`); + $(slaveEntry).append(standardSlaveReport(slave, false)); + } else { // silently discard return values + App.SlaveAssignment.workTheFarm(slave, farmerBonus); + standardSlaveReport(slave, true); + } + } + + + + // MARK: MENIALS if (V.farmMenials > 0) { let farmMenialProductivity = 9; @@ -356,7 +417,8 @@ App.Facilities.Farmyard.farmyardReport = function farmyardReport() { } - // FARMYARD + + // MARK: FARMYARD const farmyardStatsRecords = () => { // TODO: check over these setters and remove those we don't need @@ -381,114 +443,90 @@ App.Facilities.Farmyard.farmyardReport = function farmyardReport() { }; const farmyardDecoration = () => { - let t = ``; + let r = []; // TODO: add checks for the different FSs if (V.farmyardDecoration !== 'standard') { - if (!profits && !foodWeek) { - t += `<br>`; - } - t += `<br>${V.farmyardNameCaps}'s customer's enjoyed `; + const decorationEffects = App.UI.DOM.appendNewElement("p", frag, '', "indent"); + + $(decorationEffects).append(document.createElement("br")); + + r.push(`${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>`; + r.push(`<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>`; + r.push(`<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>`; + r.push(`<span class="green">partaking of ${V.farmyardName}'s fine produce in its ${V.farmyardDecoration} décor.</span>`); } + + $(decorationEffects).append(r.join(' ')); } - return t; + return r; }; const farmyardProfit = (profit, foodWeek) => { - let t = ``; + let r = []; if (profit || foodWeek) { - t += `<br><br>${V.farmyardNameCaps} `; + r.push(`<br><br>${V.farmyardNameCaps}`); if (profit) { - t += `makes you <span class="yellowgreen">${cashFormat(Math.trunc(profit))}</span>`; + r.push(`makes you <span class="yellowgreen">${cashFormat(Math.trunc(profit))}</span>`); } if (profit && foodWeek && V.foodMarket) { - t += ` and `; + r.push(` and `); } if (foodWeek && V.foodMarket) { - t += `produced <span class="chocolate"> ${massFormat(foodWeek)}</span> of food`; + r.push(`produced <span class="chocolate"> ${massFormat(foodWeek)}</span> of food`); } - t += ` this week. `; + r.push(` this week.`); } - return t; + return r; }; - const farmyardStatsDisplay = () => `<<FarmyardStatistics 0>><<timed 50ms>><<replace #farmyardstats>><<FarmyardStatistics 1>><</replace>><</timed>>`; + // MARK: MAIN LOOP (may get rid of this entirely, we'll see) - t += `<span id="farmyardstats"></span>`; - - // MAIN LOOP + farmyardStatsRecords(); + t += farmyardProfit(profits, foodWeek); + t += farmyardDecoration(); + t += farmyardStatsDisplay(); - if (Farmer) { - t += farmerHealth(Farmer); - t += farmerDevotion(Farmer); - t += farmerTrust(Farmer); - t += farmerLivingRules(Farmer); - - getSlaveStatisticData(Farmer, V.facility.farmyard); // make sure we have registered living expenses - - t += farmerIntro(Farmer); - t += farmerRelationshipPC(Farmer); - t += farmerFetishEffects(farmerFetish(Farmer)); - t += farmerSkill(Farmer); - t += farmerCashBonus(Farmer); - t += farmerAgeSkill(Farmer); - t += farmerExperience(Farmer); - t += farmerIntelligence(Farmer); - t += farmerDick(Farmer); - t += farmerSmell(Farmer); - t += farmerRelationshipSlaves(Farmer); - t += farmerWorks(Farmer); - } + V.food += foodWeek; - t += farmhandCount(FL); - if (Farmer) { - t += farmerEndWeek(Farmer); - } - if (FL > 0) { - let oldCash = V.cash, - oldFood = V.food; + /** + * Generates (and returns if not silent) a standard slave report + * @param {App.Entity.SlaveState} slave + * @param {boolean} silent + * @returns {HTMLElement|null} + */ + function standardSlaveReport(slave, silent) { + const + clothes = App.SlaveAssignment.choosesOwnClothes(slave); + tired(slave); - for (const slave of App.Utils.sortedEmployees(App.Entity.facilities.farmyard)) { - V.i = V.slaveIndices[slave.ID]; + const + rules = App.UI.DOM.renderPassage("SA rules"), + diet = App.UI.DOM.renderPassage("SA diet"), + ltEffects = App.UI.DOM.renderPassage("SA long term effects"), + drugs = App.SlaveAssignment.drugs(slave), + relationships = App.UI.DOM.renderPassage("SA relationships"), + rivalries = App.UI.DOM.renderPassage("SA rivalries"), + devotion = App.UI.DOM.renderPassage("SA devotion"); - ({ - he, him, his, hers, himself, girl, He, His, loli - } = getPronouns(slave)); + if (!silent) { + const content = App.UI.DOM.makeElement("div", '', "indent"); - farmhandLivingRules(slave); - farmhandHealth(slave); - farmhandDevotion(slave); - farmhandTrust(slave); - farmhandEnergy(slave); - farmhandFood(slave); - profits += farmhandProfit(slave); + $(content).append(clothes, rules, diet, ltEffects, drugs, relationships, rivalries, document.createElement('br'), devotion); - t += farmhandEndWeek(slave); + return content; } - - profits += V.cash - oldCash; // FIXME: equal to 0 - what is this supposed to represent? - oldCash = V.cash; - foodWeek += V.food + oldFood; } - farmyardStatsRecords(); - t += farmyardProfit(profits, foodWeek); - t += farmyardDecoration(); - t += farmyardStatsDisplay(); - - V.food += foodWeek; - return t; };