diff --git a/src/facilities/farmyard/reports/farmyardReport.js b/src/facilities/farmyard/reports/farmyardReport.js index b9ef8cc527eb902305f14cce71e41b1b814147a9..44f71f1d5ff41b2ff8c0533fd7ae32b8350f9e0a 100644 --- a/src/facilities/farmyard/reports/farmyardReport.js +++ b/src/facilities/farmyard/reports/farmyardReport.js @@ -1,6 +1,6 @@ // FIXME: needs further review -App.Facilities.Farmyard.farmyardReport = function farmyardReport() { +App.Facilities.Farmyard.farmyardReport = function farmyardReport(slave) { let frag = document.createDocumentFragment(); const @@ -18,42 +18,43 @@ App.Facilities.Farmyard.farmyardReport = function farmyardReport() { // MARK: Farmer function farmerChanges() { - farmerHealth(Farmer); - farmerDevotion(Farmer); - farmerTrust(Farmer); - farmerLivingRules(Farmer); - farmerCashBonus(Farmer); + farmerHealth(); + farmerDevotion(); + farmerTrust(); + farmerLivingRules(); + farmerCashBonus(); } - const farmerHealth = slave => { + function farmerHealth(slave) { if (slave.health.condition < -80) { - improveCondition(slave, 20); + improveCondition(Farmer, 20); } else if (slave.health.condition < -40) { - improveCondition(slave, 15); + improveCondition(Farmer, 15); } else if (slave.health.condition < 0) { - improveCondition(slave, 10); + improveCondition(Farmer, 10); } else if (slave.health.condition < 90) { - improveCondition(slave, 7); + improveCondition(Farmer, 7); } - }; + } - const farmerDevotion = slave => { + function farmerDevotion(slave) { slave.devotion += devBonus; if (slave.devotion < 45) { slave.devotion += 5; } - }; + } - const farmerTrust = slave => { + function farmerTrust(slave) { if (slave.trust < 45) { slave.trust += 5; } - }; + } - const farmerLivingRules = slave => slave.rules.living = 'luxurious'; + const farmerLivingRules = () => slave.rules.living = 'luxurious'; - const farmerCashBonus = slave => { + // FIXME: marked for further review + function farmerCashBonus(slave) { let FarmerCashBonus = Math.min(0.2, slave.skill.farmer * 0.002); FarmerCashBonus += slave.intelligence + slave.intelligenceImplant > 15 ? 0.05 : 0; @@ -82,7 +83,7 @@ App.Facilities.Farmyard.farmyardReport = function farmyardReport() { } return FarmerCashBonus; - }; + } @@ -104,7 +105,7 @@ App.Facilities.Farmyard.farmyardReport = function farmyardReport() { return r.join(' '); } - const farmerFetish = slave => { + function farmerFetish(slave) { // FIXME: change this fetish to something else if (slave.fetish !== 'dom') { if (fetishChangeChance(slave) > jsRandom(0, 100)) { @@ -119,9 +120,9 @@ App.Facilities.Farmyard.farmyardReport = function farmyardReport() { slave.fetishStrength += 4; return 2; } - }; + } - const farmerFetishEffects = (slave, fetish = 0) => { + function farmerFetishEffects(fetish = 0) { const { he, his, himself, He } = getPronouns(slave); @@ -130,9 +131,9 @@ App.Facilities.Farmyard.farmyardReport = function farmyardReport() { } 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 => { + function farmerSkill(slave) { const { he, his, His } = getPronouns(slave); @@ -155,9 +156,9 @@ App.Facilities.Farmyard.farmyardReport = function farmyardReport() { } return r.join(' '); - }; + } - const farmerExperience = slave => { + function farmerExperience(slave) { const { he, his, him, He } = getPronouns(slave); if (setup.farmerCareers.includes(slave.career)) { @@ -167,15 +168,15 @@ App.Facilities.Farmyard.farmyardReport = function farmyardReport() { } else { slave.skill.farmer += jsRandom(1, Math.ceil((slave.intelligence + slave.intelligenceImplant) / 32)); } - }; + } - const farmerDick = slave => { + function farmerDick(slave) { const { his, him } = getPronouns(slave); if (slave.dick > 2 && canPenetrate(slave)) { return `${His} turgid dick helps ${him} manage ${his} workers.`; } - }; + } function farmerRelationshipSlaves(Farmer) { const { he, his, He } = getPronouns(Farmer); @@ -211,7 +212,7 @@ App.Facilities.Farmyard.farmyardReport = function farmyardReport() { } } - const farmerContracts = slave => { + function farmerContracts(slave) { const { he, his } = getPronouns(slave); let @@ -224,39 +225,39 @@ App.Facilities.Farmyard.farmyardReport = function farmyardReport() { } return r; - }; + } - const farmerRelationshipPC = slave => { + function farmerRelationshipPC(slave) { const { he, his, wife } = getPronouns(slave); if (slave.relationship === -3 && slave.devotion > 50) { return `As your loving ${wife}, ${he} does ${his} best to ensure ${V.farmyardName} runs smoothly.`; } - }; + } - const farmerAgeSkill = slave => { + function farmerAgeSkill(slave) { const { His } = getPronouns(slave); if (slave.actualAge > 35) { return `${His} age and experience also contribute.`; } - }; + } - const farmerIntelligence = slave => { + function farmerIntelligence(slave) { const { He } = getPronouns(slave); if (slave.intelligence + slave.intelligenceImplant > 15) { return `${He} is a clever manager.`; } - }; + } - const farmerSmell = slave => { + function farmerSmell(slave) { const { him, His } = getPronouns(slave); if (!canSmell(slave)) { return `${His} lack of a sense of smell protects ${him} from that omnipresent barnyard stench.`; } - }; + } const farmerIntro = slave => `<span class="indent">${SlaveFullName(slave)} is serving as the Farmer</span>.`; @@ -289,11 +290,11 @@ App.Facilities.Farmyard.farmyardReport = function farmyardReport() { // MARK: Farmhands - const farmhandCount = count => { + function farmhandCount(count) { return `<strong>There ${count > 1 ? `are ${count} farmhands` : `is one farmhand`} working out of ${V.farmyardName}.</strong>`; - }; + } - const farmhandLivingRules = slave => { + function farmhandLivingRules(slave) { switch (V.farmyardDecoration) { case 'Degradation': case 'standard': @@ -306,9 +307,9 @@ App.Facilities.Farmyard.farmyardReport = function farmyardReport() { slave.rules.living = 'normal'; break; } - }; + } - const farmhandHealth = slave => { + function farmhandHealth(slave) { if (slave.health.condition < -80) { improveCondition(slave, 20); } else if (slave.health.condition < -40) { @@ -318,9 +319,9 @@ App.Facilities.Farmyard.farmyardReport = function farmyardReport() { } else if (slave.health.condition < 90) { improveCondition(slave, 7); } - }; + } - const farmhandDevotion = slave => { + function farmhandDevotion(slave) { if (slave.devotion <= 20 && slave.trust >= -20) { slave.devotion -= 5; slave.trust -= 5; } else if (slave.devotion < 45) { @@ -328,14 +329,14 @@ App.Facilities.Farmyard.farmyardReport = function farmyardReport() { } else if (slave.devotion > 50) { slave.devotion -= 4; } - }; + } - const farmhandProfit = slave => { + function farmhandProfit(slave) { let incomeStats = getSlaveStatisticData(slave, slave.assignment === Job.FARMYARD ? V.facility.farmyard : undefined); return incomeStats.income; - }; + } - const farmhandFood = slave => { + function farmhandFood(slave) { let incomeStats = getSlaveStatisticData(slave, slave.assignment === Job.FARMYARD ? V.facility.farmyard : undefined), foodWeek = incomeStats.food || 0; @@ -345,19 +346,19 @@ App.Facilities.Farmyard.farmyardReport = function farmyardReport() { } return foodWeek; - }; + } - const farmhandTrust = slave => { + function farmhandTrust(slave) { if (slave.trust < 30) { slave.trust += 5; } - }; + } - const farmhandEnergy = slave => { + function farmhandEnergy(slave) { if (slave.energy > 40 && slave.energy < 95) { slave.energy++; } - }; + } if (slaves) { const intro = App.UI.DOM.appendNewElement("p", frag, '', "indent"); @@ -442,8 +443,9 @@ App.Facilities.Farmyard.farmyardReport = function farmyardReport() { // MARK: Farmyard - const farmyardStatsRecords = () => { + function farmyardStatsRecords() { const f = V.facility.farmyard; + if (typeof f === "undefined") { return; } @@ -463,9 +465,9 @@ App.Facilities.Farmyard.farmyardReport = function farmyardReport() { f.farmhandCosts += i.cost; f.rep += i.rep; } - }; + } - const farmyardDecoration = () => { + function farmyardDecoration() { let r = []; // TODO: add checks for the different FSs @@ -488,9 +490,9 @@ App.Facilities.Farmyard.farmyardReport = function farmyardReport() { } return r; - }; + } - const farmyardProfit = (profit, food) => { + function farmyardProfit(profit, food) { const profitContent = App.UI.DOM.appendNewElement("p", frag, '', "indent"); let r = []; @@ -516,7 +518,7 @@ App.Facilities.Farmyard.farmyardReport = function farmyardReport() { } return $(profitContent).append(r.join(' ')); - }; + } // FIXME: no idea what I'm doing here const statsSpan = document.createElement("span");