From cb1527dc9c63103cfce86cf5624438fe10cffeb6 Mon Sep 17 00:00:00 2001 From: DCoded <dcoded@live.com> Date: Mon, 29 Jun 2020 00:44:42 -0400 Subject: [PATCH] DOMified saWorkTheFarm, marked passages for deep review --- src/endWeek/saWorkTheFarm.js | 353 ++++++++++-------- src/facilities/farmyard/farmyardShows.js | 10 +- .../farmyard/reports/farmyardReport.js | 5 +- 3 files changed, 215 insertions(+), 153 deletions(-) diff --git a/src/endWeek/saWorkTheFarm.js b/src/endWeek/saWorkTheFarm.js index 73d90c0a8e2..1c3795cab00 100644 --- a/src/endWeek/saWorkTheFarm.js +++ b/src/endWeek/saWorkTheFarm.js @@ -1,143 +1,145 @@ +// FIXME: needs further review + /** * @param {App.Entity.SlaveState} slave * @returns {string} */ App.SlaveAssignment.workTheFarm = function(slave) { - const arcology = V.arcologies[0]; - const { - he, him, his, hers, He, His - } = getPronouns(slave), - incomeStats = getSlaveStatisticData(slave, V.facility.farmyard); + let frag = document.createDocumentFragment(); + + const + { he, him, his, hers, He, His } = getPronouns(slave), + incomeStats = getSlaveStatisticData(slave, V.facility.farmyard), + arcology = V.arcologies[0]; - let food = Math.trunc(App.Facilities.Farmyard.foodAmount(slave)); - let t = `works as a farmhand this week. `; + let + food = Math.trunc(App.Facilities.Farmyard.foodAmount(slave)), + r = []; - const foodTotal = (slave, food) => { - t += foodFarmer(); - t += foodDevotion(slave); - t += foodMuscles(slave); - t += foodWeight(slave); - t += foodHealth(slave); - t += foodSight(slave); - t += foodHearing(slave); + + const total = (slave, food) => { + r.push(intro()); + r.push(farmer()); + r.push(devotion(slave)); + r.push(muscles(slave)); + r.push(weight(slave)); + r.push(health(slave)); + r.push(sight(slave)); + r.push(hearing(slave)); t += V.foodMarket ? `As a result, ${he} produces <span class="chocolate">${massFormat(food)}</span> of food over the week. ` : ``; }; - const foodFarmer = () => { + const intro = () => `works as a farmhand this week.`; + + const farmer = () => { if (V.Farmer) { - return `${V.Farmer.slaveName} watches over ${him}, making sure that ${he} doesn't slack off and works as hard as ${he} should. `; + return `${V.Farmer.slaveName} watches over ${him}, making sure that ${he} doesn't slack off and works as hard as ${he} should.`; } - return ``; }; - const foodDevotion = slave => { + const devotion = slave => { if (slave.devotion > 50) { - return `${He}'s so devoted to you that ${he} works harder and produces more food. `; + return `${He}'s so devoted to you that ${he} works harder and produces more food.`; } else if (slave.devotion < -50) { - return `${He}'s so resistant that ${he} doesn't work as hard, and thus produces less food. `; + return `${He}'s so resistant that ${he} doesn't work as hard, and thus produces less food.`; } else { - return ``; // TODO: third case for neutral? + return `${He} doesn't feel particularly compelled to work hard or slack off and produces an average amount of food.`; } }; - const foodHealth = slave => { - return foodHealthCondition(slave) + foodHealthIllness(slave); + const health = slave => { + return healthCondition(slave) + healthIllness(slave); }; - const foodHealthCondition = slave => { + const healthCondition = slave => { if (slave.health.condition > 50) { - return `${His} shining health helps ${him} work harder and longer. `; + return `${His} shining health helps ${him} work harder and longer.`; } else if (slave.health.condition < -50) { - return `${His} poor health impedes ${his} ability to work efficiently. `; + return `${His} poor health impedes ${his} ability to work efficiently.`; } else { return ``; // TODO: third case? } }; - const foodHealthIllness = slave => { - let t = ``; + const healthIllness = slave => { + let r = []; + if (slave.health.illness > 0 || slave.health.tired > 60) { - t += ` ${He} performed worse this week due to<span class="red">`; + r.push(`${He} performed worse this week due to<span class="red">`); if (slave.health.illness === 1) { - t += ` feeling under the weather`; + r.push(`feeling under the weather`); } else if (slave.health.illness === 2) { - t += ` a minor illness`; + r.push(`a minor illness`); } else if (slave.health.illness === 3) { - t += ` being sick`; + r.push(`being sick`); } else if (slave.health.illness === 4) { - t += ` being very sick`; + r.push(`being very sick`); } else if (slave.health.illness === 5) { - t += ` a terrible illness`; + r.push(`a terrible illness`); } + if (slave.health.illness > 0 && slave.health.tired > 60) { - t += ` and`; - foodHealthTired(slave); + r.push(`and`); + if (slave.health.tired > 90) { + r.push(`exhaustion`); + } else if (slave.health.tired > 60) { + r.push(`being tired`); + } } - t += `.</span> `; - t += foodTired(slave); + r.push(`.</span> `); // FIXME: figure out better way to do this + r.push(tired(slave)); } - return t; - }; - const foodHealthTired = slave => { - if (slave.health.tired > 90) { - return ` exhaustion`; - } else if (slave.health.tired > 60) { - return ` being tired`; - } - return ``; + return r; }; - const foodTired = slave => { - let t = ``; + const tired = slave => { if (!slave.fuckdoll) { if (slaveResting(slave)) { - t = ` ${He} spends reduced hours working the soil in order to <span class="green">offset ${his} lack of rest.</span>`; + return `${He} spends reduced hours working the soil in order to <span class="green">offset ${his} lack of rest.</span>`; } else if (slave.health.tired + 20 >= 90 && !willWorkToDeath(slave)) { - t = ` ${He} attempts to refuse work due to ${his} exhaustion, but can do little to stop it or the resulting <span class="trust dec">severe punishment.</span> ${He} <span class="devotion dec">purposefully underperforms,</span> choosing ${his} overall well-being over the consequences, <span class="red">greatly reducing yields.</span>`; - slave.devotion -= 10; - slave.trust -= 5; + slave.devotion -= 10; // FIXME: move this + slave.trust -= 5; // FIXME: move this + + return `${He} attempts to refuse work due to ${his} exhaustion, but can do little to stop it or the resulting <span class="trust dec">severe punishment.</span> ${He} <span class="devotion dec">purposefully underperforms,</span> choosing ${his} overall well-being over the consequences, <span class="red">greatly reducing yields.</span>`; } else { - t = ` Hours of manual labor quickly add up, leaving ${him} <span class="red">physically drained</span> by the end of the day.`; + return `Hours of manual labor quickly add up, leaving ${him} <span class="red">physically drained</span> by the end of the day.`; } } - tired(slave); - - return t; }; - const foodMuscles = slave => { + const muscles = slave => { if (slave.muscles > 50) { - return `${His} muscular form helps ${him} work better, increasing ${his} productivity. `; + return `${His} muscular form helps ${him} work better, increasing ${his} productivity.`; } else if (slave.muscles < -50) { - return `${He} is so weak that ${he} is not able to work effectively. `; + return `${He} is so weak that ${he} is not able to work effectively.`; } else { return ``; // TODO: third case? } }; - const foodWeight = slave => { + const weight = slave => { return slave.weight > 95 ? `${He} is so overweight that ${he} has to stop every few minutes to catch ${his} breath, and so ${his} productivity suffers. ` : ``; }; - const foodSight = slave => { + const sight = slave => { if (!canSee(slave)) { - return `${His} blindness makes it extremely difficult for ${him} to work, severely limiting ${his} production. `; + return `${His} blindness makes it extremely difficult for ${him} to work, severely limiting ${his} production.`; } else if (!canSeePerfectly(slave)) { - return `${His} nearsightedness makes it harder for ${him} to work as hard as ${he} otherwise would. `; + return `${His} nearsightedness makes it harder for ${him} to work as hard as ${he} otherwise would.`; } else { return ``; // TODO: third case? } }; - const foodHearing = slave => { + const hearing = slave => { if (slave.hears === -1) { - return `${He} is hard-of-hearing, which gets in the way of ${his} work whenever ${he} misses directions${V.Farmer ? ` from ${V.Farmer.slaveName}` : ``}. `; + return `${He} is hard-of-hearing, which gets in the way of ${his} work whenever ${he} misses directions${V.Farmer ? ` from ${V.Farmer.slaveName}` : ``}.`; } else if (slave.hears < -1) { - return `${He} is deaf, which gets in the way of ${his} work whenever ${he} misses directions${V.Farmer ? ` from ${V.Farmer.slaveName}` : ``}. `; + return `${He} is deaf, which gets in the way of ${his} work whenever ${he} misses directions${V.Farmer ? ` from ${V.Farmer.slaveName}` : ``}.`; } else { return ``; // TODO: third case? } @@ -146,13 +148,15 @@ App.SlaveAssignment.workTheFarm = function(slave) { if (V.Farmer) { // TODO: keep oral check? replace with something else? - t += `While there, ${he} benefits from ${V.Farmer.slaveName}'s ${V.Farmer.physicalAge < 21 ? `youthful energy` : `care`} ${V.Farmer.skill.oral ? ` and talented tongue` : ``}. `; + t += `While there, ${he} benefits from ${V.Farmer.slaveName}'s ${V.Farmer.physicalAge < 21 ? `youthful energy` : `care`} ${V.Farmer.skill.oral ? ` and talented tongue` : ``}.`; if (slave.devotion < V.FarmerDevotionThreshold) { slave.devotion += V.FarmerDevotionBonus; } + if (slave.devotion < V.FarmerTrustThreshold) { slave.trust += V.FarmerTrustBonus; } + if (slave.health.condition < 100) { improveCondition(slave, V.FarmerHealthBonus); } @@ -168,7 +172,7 @@ App.SlaveAssignment.workTheFarm = function(slave) { V.foodTotal += food; incomeStats.food += food; - foodTotal(slave, food); + total(slave, food); } // Close Food Production @@ -178,73 +182,83 @@ App.SlaveAssignment.workTheFarm = function(slave) { incomeStats.income += App.Facilities.Farmyard.farmShowsIncome(slave); if (V.farmyardShows) { - t += `${He} also puts on shows with animals this week. `; + const shows = App.UI.DOM.appendNewElement("p", frag, '', "indent"); + + let r = []; + + r.push(`${He} also puts on shows with animals this week.`); // Open FS Subsection if (arcology.FSSupremacist !== "unset") { if (slave.race === arcology.FSSupremacistRace) { - t += `Society <span class="red">disapproves</span> of your allowing a member of the elite race to be degraded in such a fashion, and thus ${he} didn't earn as much. `; + r.push(`Society <span class="red">disapproves</span> of your allowing a member of the elite race to be degraded in such a fashion, and thus ${he} didn't earn as much.`); } } + if (arcology.FSSubjugationist !== "unset") { if (slave.race === arcology.FSSubjugationistRace) { - t += `Society <span class="green">approves</span> of the degradation you submit your ${arcology.FSSubjugationistRace} slaves to, and so ${he} earns you a bit more. `; + r.push(`Society <span class="green">approves</span> of the degradation you submit your ${arcology.FSSubjugationistRace} slaves to, and so ${he} earns you a bit more.`); } else { - t += `Society doesn't disapprove of ${him} not being ${arcology.FSSubjugationistRace}, but ${he} doesn't earn as much as ${he} would if ${he} was. `; + r.push(`Society doesn't disapprove of ${him} not being ${arcology.FSSubjugationistRace}, but ${he} doesn't earn as much as ${he} would if ${he} was.`); } } + if (arcology.FSRepopulationFocus !== "unset") { if (slave.pregWeek > 16) { if (slave.eggType !== "human") { - t += `Society is <span class="red">disgusted</span> by ${his} pregnancy when they realize that what it is in ${his} womb is not human. `; + r.push(`Society is <span class="red">disgusted</span> by ${his} pregnancy when they realize that what it is in ${his} womb is not human.`); } else { - t += `Society <span class="green">greatly approves</span> of your having pregnant slaves ${V.seeBestiality ? `have sex` : `put on shows`} with animals. `; + r.push(`Society <span class="green">greatly approves</span> of your having pregnant slaves ${V.seeBestiality ? `have sex` : `put on shows`} with animals.`); } } } + if (arcology.FSRestart !== "unset") { if (slave.pregWeek > 16) { if (slave.eggType !== "human") { - t += `Society is disgusted by ${his} pregnancy until they learn that what is in ${his} womb is not human. `; + r.push(`Society is disgusted by ${his} pregnancy until they learn that what is in ${his} womb is not human.`); } else { - t += `Society is <span class="red">extremely disgusted</span> by ${his} pregnancy and the fact that you would have ${him} ${V.seeBestiality ? `have sex` : `put on shows`} with animals while sporting a baby bump. `; + r.push(`Society is <span class="red">extremely disgusted</span> by ${his} pregnancy and the fact that you would have ${him} ${V.seeBestiality ? `have sex` : `put on shows`} with animals while sporting a baby bump.`); } } } + if (arcology.FSGenderRadicalist !== "unset") { if (slave.dick > 0) { - t += `${His} patrons <span class="green">approve</span> of the fact that ${he} has a dick. `; + r.push(`${His} patrons <span class="green">approve</span> of the fact that ${he} has a dick.`); } else { - t += `${His} patrons <span class="red">are disappointed</span> that ${he} doesn't have a dick. `; + r.push(`${His} patrons <span class="red">are disappointed</span> that ${he} doesn't have a dick.`); } } + if (arcology.FSGenderFundamentalist !== "unset") { if (slave.pregWeek > 16 || setup.fakeBellies.includes(slave.bellyAccessory)) { - t += `${His} viewers <span class="green">approve</span> of the fact that ${he} is sporting a baby bump${setup.fakeBellies.includes(slave.bellyAccessory) - ? `, even though ${hers} isn't real` - : ``}. `; + r.push(`${His} viewers <span class="green">approve</span> of the fact that ${he} is sporting a baby bump${setup.fakeBellies.includes(slave.bellyAccessory) ? `, even though ${hers} isn't real` : ``}.`); } else { - t += `${His} viewers <span class="red">are disappointed</span> that ${he} isn't pregnant. `; + r.push(`${His} viewers <span class="red">are disappointed</span> that ${he} isn't pregnant.`); } if (slave.dick > 0) { // TODO: something here? } } + if (arcology.FSPaternalist !== "unset") { if (V.seeBestiality && V.farmyardBreeding) { - t += `Your citizens are <span class="red">very disapproving</span> of the fact that you would allow something as degrading as having your slaves be knocked up by filthy beasts. `; + r.push(`Your citizens are <span class="red">very disapproving</span> of the fact that you would allow something as degrading as having your slaves be knocked up by filthy beasts.`); } else { - t += `Your citizens <span class="red">disapprove</span> of the fact that you would allow your slaves to be degraded in such a manner. `; + r.push(`Your citizens <span class="red">disapprove</span> of the fact that you would allow your slaves to be degraded in such a manner.`); } } + if (arcology.FSDegradationist !== "unset") { if (V.seeBestiality && V.farmyardBreeding) { - t += `Your citizens are <span class="green">very approving</span> of the fact that you would allow something as degrading as having your slaves be knocked up by filthy beasts. `; + r.push(`Your citizens are <span class="green">very approving</span> of the fact that you would allow something as degrading as having your slaves be knocked up by filthy beasts.`); } else { - t += `Your citizens <span class="green">approve</span> of the fact that you would allow your slaves to be degraded in such a manner. `; + r.push(`Your citizens <span class="green">approve</span> of the fact that you would allow your slaves to be degraded in such a manner.`); } } + if (arcology.FSBodyPurist !== "unset") { /* TODO: requirements for these might change */ if (slave.boobsImplant > 0) { @@ -260,6 +274,7 @@ App.SlaveAssignment.workTheFarm = function(slave) { // TODO: add stuff here } } + if (arcology.FSTransformationFetishist !== "unset") { /* TODO: requirements for these might change */ if (slave.boobsImplant > 0) { @@ -275,31 +290,35 @@ App.SlaveAssignment.workTheFarm = function(slave) { // TODO: add stuff here } } + if (arcology.FSYouthPreferentialist !== "unset") { if (slave.visualAge > 25) { // TODO: not sure about this age - t += `${arcology.name}'s citizens <span class="red">disapprove</span> of your using such old slaves to put on shows. `; + r.push(`${arcology.name}'s citizens <span class="red">disapprove</span> of your using such old slaves to put on shows.`); } else { - t += `${arcology.name}'s citizens <span class="green">approve</span> of your using young slaves to put on shows. `; + r.push(`${arcology.name}'s citizens <span class="green">approve</span> of your using young slaves to put on shows.`); } } + if (arcology.FSMaturityPreferentialist !== "unset") { if (slave.visualAge > 25) { // TODO: not sure about this age - t += `${arcology.name}'s citizens <span class="green">approve</span> of your using mature slaves to put on shows. `; + r.push(`${arcology.name}'s citizens <span class="green">approve</span> of your using mature slaves to put on shows.`); } else { - t += `${arcology.name}'s citizens <span class="red">disapprove</span> of your using such young slaves to put on shows. `; + r.push(`${arcology.name}'s citizens <span class="red">disapprove</span> of your using such young slaves to put on shows.`); } } + if (arcology.FSSlimnessEnthusiast !== "unset") { if (slave.weight > 10) { - t += `Society finds your using a slave with such a flabby body <span class="red">absolutely disgusting.</span> `; + r.push(`Society finds your using a slave with such a flabby body <span class="red">absolutely disgusting.</span> `); } if (slave.boobs > 799) { - t += `Your citizens ${slave.weight > 10 ? `also ` : ``} don't approve of you using a slave with such large tits as a showgirl. `; + r.push(`Your citizens ${slave.weight > 10 ? `also ` : ``} don't approve of you using a slave with such large tits as a showgirl.`); } if (slave.butt > 3) { // TODO: write this } } + if (arcology.FSAssetExpansionist !== "unset") { if (slave.weight > 10) { // TODO: should weight be in here? @@ -311,6 +330,7 @@ App.SlaveAssignment.workTheFarm = function(slave) { // TODO: write this } } + if (arcology.FSPastoralist !== "unset") { if (slave.boobs > 799) { // TODO: does this make sense? @@ -319,6 +339,7 @@ App.SlaveAssignment.workTheFarm = function(slave) { // TODO: write this } } + if (arcology.FSPhysicalIdealist !== "unset") { if (slave.height > 169) { // TODO: write this @@ -326,6 +347,7 @@ App.SlaveAssignment.workTheFarm = function(slave) { // TODO: write this } } + if (arcology.FSHedonisticDecadence !== "unset") { if (slave.weight > 10) { // TODO: write this @@ -333,6 +355,7 @@ App.SlaveAssignment.workTheFarm = function(slave) { // TODO: write this } } + if (arcology.FSChattelReligionist !== "unset") { if (slave.devotion <= 20) { // TODO: write this @@ -343,55 +366,60 @@ App.SlaveAssignment.workTheFarm = function(slave) { if (arcology.FSPetiteAdmiration !== "unset") { if (heightPass(slave)) { - t += `The fact that you are using such small slaves <span class="reputation inc">pleases your citizens</span>. `; + r.push(`The fact that you are using such small slaves <span class="reputation inc">pleases your citizens</span>.`); } else { - t += `The fact that you are using such small slaves <span class="reputation dec">displeases your citizens</span>. `; - } + r.push(`The fact that you are using such small slaves <span class="reputation dec">displeases your citizens</span>.`); + } } if (arcology.FSStatuesqueGlorification !== "unset") { if (heightPass(slave)) { - t += `Your citizens <span class="reputation inc">approve</span> of your using such tall slaves for putting on shows. `; + r.push(`Your citizens <span class="reputation inc">approve</span> of your using such tall slaves for putting on shows.`); } else { - t += `Your citizens <span class="reputation dec">disapprove</span> of your using such tall slaves for putting on shows. `; + r.push(`Your citizens <span class="reputation dec">disapprove</span> of your using such tall slaves for putting on shows.`); } } // Close FS Subsection if (setup.entertainmentCareers.includes(slave.career)) { - t += ` ${He} has experience with putting on shows from ${his} life before ${he} was a slave, making ${him} more effective at putting on shows. `; + r.push(`${He} has experience with putting on shows from ${his} life before ${he} was a slave, making ${him} more effective at putting on shows.`); } + if (setup.farmerCareers.includes(slave.career)) { // TODO: does this even make sense to include? // TODO: write this } + if (slave.prestige === 1) { - t += `Because some of your citizens already know of ${him}, ${he} earns more. `; + r.push(`Because some of your citizens already know of ${him}, ${he} earns more.`); } else if (slave.prestige === 2) { - t += `Because a lot of your citizens already know of ${him}, ${he} earns quite a bit more. `; + r.push(`Because a lot of your citizens already know of ${him}, ${he} earns quite a bit more.`); } else if (slave.prestige === 3) { - t += `Because ${he} is so famous, ${he} earns a lot more then ${he} would otherwise. `; + r.push(`Because ${he} is so famous, ${he} earns a lot more then ${he} would otherwise.`); } + if (slave.porn.prestige === 1) { // TODO: are prestige and pornPrestige mutually exclusive? - t += `${He} earns a bit more because some of your citizens already know ${him} from porn. `; + r.push(`${He} earns a bit more because some of your citizens already know ${him} from porn.`); } else if (slave.porn.prestige === 2) { - t += `${He} earns quite a bit more because a lot of your citizens already know ${him} from porn. `; + r.push(`${He} earns quite a bit more because a lot of your citizens already know ${him} from porn.`); } else if (slave.porn.prestige === 3) { - t += `${He} earns a lot more because ${he} is so famous from porn. `; + r.push(`${He} earns a lot more because ${he} is so famous from porn.`); } + if (slave.health.condition > 20) { - t += `${He} is in such excellent health that ${he} is able to put on longer and more energetic shows, earning you more. `; + r.push(`${He} is in such excellent health that ${he} is able to put on longer and more energetic shows, earning you more.`); } else if (slave.health.condition < -20) { - t += `${His} poor health negatively affects ${his} ability to put on good shows, cutting into your profits. `; + r.push(`${His} poor health negatively affects ${his} ability to put on good shows, cutting into your profits.`); } + if (slave.face > 40) { - t += `${He} is so ${slave.genes === "XY" ? `handsome` : `beautiful`} that ${his} audience is willing to pay more to watch ${him} put on shows. `; + r.push(`${He} is so ${slave.genes === "XY" ? `handsome` : `beautiful`} that ${his} audience is willing to pay more to watch ${him} put on shows.`); } else if (slave.face > 10) { - t += `${He} is so ${slave.genes === "XY" ? `good-looking` : `pretty`} that ${his} audience is willing to pay more to watch ${him} put on shows. `; + r.push(`${He} is so ${slave.genes === "XY" ? `good-looking` : `pretty`} that ${his} audience is willing to pay more to watch ${him} put on shows.`); } else if (slave.face < -10) { - t += `${His} audience isn't willing to pay as much because of how unattractive ${his} face is. `; + r.push(`${His} audience isn't willing to pay as much because of how unattractive ${his} face is.`); } else if (slave.face < -40) { - t += `${His} audience isn't willing to pay as much because of how hard ${his} face is to look at. `; + r.push(`${His} audience isn't willing to pay as much because of how hard ${his} face is to look at.`); } // TODO: write this block with different combinations of trust / devotion if (slave.devotion > 50) { @@ -399,47 +427,59 @@ App.SlaveAssignment.workTheFarm = function(slave) { } else if (slave.devotion < -50) { // TODO: write this } + if (slave.trust > 50) { // TODO: write this } else if (slave.trust < -50) { // TODO: write this } + if (slave.weight > 30 && arcology.FSHedonisticDecadence === "unset") { - t += `Your citizens are not willing to pay as much to see such a fat slave put on shows, so ${he} loses some income. `; + r.push(`Your citizens are not willing to pay as much to see such a fat slave put on shows, so ${he} loses some income.`); } else if (slave.weight < -30) { - t += `Your citizens don't like watching such a sickly-looking slaves put on shows, so ${he} loses some income. `; + r.push(`Your citizens don't like watching such a sickly-looking slaves put on shows, so ${he} loses some income.`); } + if (slave.muscles > 30) { // TODO: write this - do we want something for muscles? } else if (slave.muscles < -30) { // TODO: write this - maybe something about the slave's ability to handle the animal? } + if (!canSeePerfectly(slave)) { - t += `${His} ${!canSee(slave) ? `blindness makes it impossible` : `nearsightedness makes it harder`} for ${him} to see what ${he}'s doing, affecting ${his} ability to put on a good show. `; + r.push(`${His} ${!canSee(slave) ? `blindness makes it impossible` : `nearsightedness makes it harder`} for ${him} to see what ${he}'s doing, affecting ${his} ability to put on a good show.`); } + if (slave.hears < 0) { - t += `${His} ${slave.hears < -1 ? `lack of` : `poor`} hearing makes it difficult for ${him} to do a good job of putting on a show. `; + r.push(`${His} ${slave.hears < -1 ? `lack of` : `poor`} hearing makes it difficult for ${him} to do a good job of putting on a show.`); } + if (slave.boobs > 800) { // TODO: write this } + if (slave.butt > 4) { // TODO: write this } + if (slave.preg > 10) { // TODO: write this } + if (slave.health.tired > 60) { - t += `${He} is so tired that the energy in ${his} shows is basically nonexistent, affecting ${his} profits. `; + r.push(`${He} is so tired that the energy in ${his} shows is basically nonexistent, affecting ${his} profits.`); } + if (slave.chem > 10) { // TODO: write this - would this make sense to include? } + if (slave.intelligence > 50) { // TODO: write this - include something about .intelligenceImplant? } else if (slave.intelligence < -50) { // TODO: write this } + if (slave.energy <= 20) { // TODO: write this } else if (slave.energy <= 40) { @@ -453,6 +493,7 @@ App.SlaveAssignment.workTheFarm = function(slave) { } else { // TODO: write this } + if (slave.fetish === "submissive") { // TODO: write this } else if (slave.fetish === "humiliation") { @@ -460,6 +501,8 @@ App.SlaveAssignment.workTheFarm = function(slave) { } else if (slave.fetish === "masochist") { // TODO: write this } // TODO: incorporate quirks + + $(shows).append(r.join(' ')); } // Close Shows @@ -469,18 +512,20 @@ App.SlaveAssignment.workTheFarm = function(slave) { if (slave.fetishKnown && (slave.fetish === "submissive" || slave.fetish === "humiliation" || slave.fetish === "masochist") || slave.energy > 95) { if (V.farmyardShows) { if (V.seeBestiality) { - t += `Getting fucked by animals is the perfect job for ${him}, as far as ${he} can tell. <span class="devotion inc">${He} is happy</span> to spend ${his} days being utterly degraded. `; + r.push(`Getting fucked by animals is the perfect job for ${him}, as far as ${he} can tell. <span class="devotion inc">${He} is happy</span> to spend ${his} days being utterly degraded.`); } else { - t += `${He} loves putting on shows with animals, and as far as ${he} can tell, it's the perfect job for ${him}. <span class="devotion inc">${He} is happy</span> to spend ${his} days doing something so degrading. `; // TODO: not sure how degrading putting on shows is + r.push(`${He} loves putting on shows with animals, and as far as ${he} can tell, it's the perfect job for ${him}. <span class="devotion inc">${He} is happy</span> to spend ${his} days doing something so degrading.`); // TODO: not sure how degrading putting on shows is } } slave.devotion += 1; + if (slave.need) { slave.need = 0; } } + if (slave.behavioralQuirk === "fitness") { - t += `${slave.slaveName} <span class="devotion inc">privately enjoys</span> the exercise ${he} receives while working in ${V.farmyardName}. `; + r.push(`${slave.slaveName} <span class="devotion inc">privately enjoys</span> the exercise ${he} receives while working in ${V.farmyardName}.`); slave.devotion += 1; } @@ -489,89 +534,103 @@ App.SlaveAssignment.workTheFarm = function(slave) { // Open Vignettes if (V.showVignettes) { + // TODO: move this entire section into new function + + const + vignettes = App.UI.DOM.appendNewElement("div", frag, '', "indent"); + + let r = []; + const vignette = GetVignette(slave); - t += `<span class="story-label">This week</span> ${vignette.text}`; + r.push(`<span class="story-label">This week</span> ${vignette.text}`); + if (vignette.type === "cash") { let FResultNumber = FResult(slave); const cashVign = Math.trunc(FResultNumber * vignette.effect); if (vignette.effect > 0) { - t += ` <span class="yellowgreen">making you an extra ${cashFormat(cashVign)}.</span> `; + r.push(`<span class="yellowgreen">making you an extra ${cashFormat(cashVign)}.</span> `); cashX(cashVign, "slaveAssignmentFarmyardVign", slave); } else if (vignette.effect < 0) { - t += ` <span class="red">losing you ${cashFormat(Math.abs(cashVign))}.</span> `; + r.push(`<span class="red">losing you ${cashFormat(Math.abs(cashVign))}.</span> `); cashX(forceNeg(cashVign), "slaveAssignmentFarmyardVign", slave); } else { - t += ` an incident without lasting effect. `; + r.push(`an incident without lasting effect.`); } + incomeStats.income += cashVign; } else if (vignette.type === "devotion") { if (vignette.effect > 0) { if (slave.devotion > 50) { - t += ` <span class="devotion inc">increasing ${his} devotion to you.</span> `; + r.push(`<span class="devotion inc">increasing ${his} devotion to you.</span> `); } else if (slave.devotion >= 20) { - t += ` <span class="devotion inc">increasing ${his} acceptance of you.</span> `; + r.push(`<span class="devotion inc">increasing ${his} acceptance of you.</span> `); } else if (slave.devotion >= -20) { - t += ` <span class="devotion inc">reducing ${his} dislike of you.</span> `; + r.push(`<span class="devotion inc">reducing ${his} dislike of you.</span> `); } else { - t += ` <span class="devotion inc">reducing ${his} hatred of you.</span> `; + r.push(`<span class="devotion inc">reducing ${his} hatred of you.</span> `); } } else if (vignette.effect < 0) { if (slave.devotion > 50) { - t += ` <span class="devotion dec">reducing ${his} devotion to you.</span> `; + r.push(`<span class="devotion dec">reducing ${his} devotion to you.</span> `); } else if (slave.devotion >= 20) { - t += ` <span class="devotion dec">reducing ${his} acceptance of you.</span> `; + r.push(`<span class="devotion dec">reducing ${his} acceptance of you.</span> `); } else if (slave.devotion >= -20) { - t += ` <span class="devotion dec">increasing ${his} dislike of you.</span> `; + r.push(`<span class="devotion dec">increasing ${his} dislike of you.</span> `); } else { - t += ` <span class="devotion dec">increasing ${his} hatred of you.</span> `; + r.push(`<span class="devotion dec">increasing ${his} hatred of you.</span> `); } } else { - t += ` an incident without lasting effect. `; + r.push(`an incident without lasting effect.`); } + slave.devotion += 1 * vignette.effect; } else if (vignette.type === "trust") { if (vignette.effect > 0) { if (slave.trust > 20) { - t += ` <span class="trust inc">increasing ${his} trust in you.</span> `; + r.push(`<span class="trust inc">increasing ${his} trust in you.</span> `); } else if (slave.trust >= -20) { - t += ` <span class="trust inc">reducing ${his} fear of you.</span> `; + r.push(`<span class="trust inc">reducing ${his} fear of you.</span> `); } else { - t += ` <span class="trust inc">reducing ${his} terror of you.</span> `; + r.push(`<span class="trust inc">reducing ${his} terror of you.</span> `); } } else if (vignette.effect < 0) { if (slave.trust > 20) { - t += ` <span class="trust dec">reducing ${his} trust in you.</span> `; + r.push(`<span class="trust dec">reducing ${his} trust in you.</span> `); } else if (slave.trust >= -20) { - t += ` <span class="trust dec">increasing ${his} fear of you.</span> `; + r.push(`<span class="trust dec">increasing ${his} fear of you.</span> `); } else { - t += ` <span class="trust dec">increasing ${his} terror of you.</span> `; + r.push(`<span class="trust dec">increasing ${his} terror of you.</span> `); } } else { - t += ` an incident without lasting effect. `; + r.push(`an incident without lasting effect.`); } + slave.trust += 1 * vignette.effect; } else if (vignette.type === "health") { if (vignette.effect > 0) { - t += ` <span class="green">improving ${his} health.</span> `; + r.push(`<span class="green">improving ${his} health.</span> `); improveCondition(slave, 2 * vignette.effect); } else if (vignette.effect < 0) { - t += ` <span class="red">affecting ${his} health.</span> `; + r.push(`<span class="red">affecting ${his} health.</span> `); healthDamage(slave, 2 * vignette.effect); } else { - t += ` an incident without lasting effect. `; + r.push(`an incident without lasting effect.`); } } else { let FResultNumber = FResult(slave); if (vignette.effect > 0) { - t += ` <span class="green">gaining you a bit of reputation.</span> `; + r.push(`<span class="green">gaining you a bit of reputation.</span> `); } else if (vignette.effect < 0) { - t += ` <span class="red">losing you a bit of reputation.</span> `; + r.push(`<span class="red">losing you a bit of reputation.</span> `); } else { - t += ` an incident without lasting effect. `; + r.push(`an incident without lasting effect.`); } + repX(Math.trunc(FResultNumber * vignette.effect * 0.1), "vignette", slave); incomeStats.rep += Math.trunc(FResultNumber * vignette.effect * 0.1); } + + $(vignettes).append(r.join(' ')); } // Close Vignettes @@ -580,5 +639,5 @@ App.SlaveAssignment.workTheFarm = function(slave) { const fsGain = 0.0001 * food; FutureSocieties.DecorationBonus(V.farmyardDecoration, fsGain); - return t; + return frag; }; diff --git a/src/facilities/farmyard/farmyardShows.js b/src/facilities/farmyard/farmyardShows.js index 8ab249b9e12..adc0fcb6833 100644 --- a/src/facilities/farmyard/farmyardShows.js +++ b/src/facilities/farmyard/farmyardShows.js @@ -1,3 +1,5 @@ +// FIXME: needs further review + /** * @param {App.Entity.SlaveState} slave * @returns {number} @@ -10,9 +12,9 @@ App.Facilities.Farmyard.farmShowsIncome = function(slave) { if (!slave) { return null; } else { - if (V.Farmer !== 0) { // farmer is assigned + if (V.Farmer) { cash *= 1.1; - if (V.Farmer.skill.farmer >= V.masteredXP) { // farmer is master + if (V.Farmer.skill.farmer >= V.masteredXP) { cash *= 1.1; } } @@ -109,7 +111,7 @@ App.Facilities.Farmyard.farmShowsIncome = function(slave) { } if (arcology.FSYouthPreferentialist !== "unset") { - if (isYoung(slave)) + if (isYoung(slave)) { cash *= 1.2; } else { cash *= 0.8; @@ -292,5 +294,5 @@ App.Facilities.Farmyard.farmShowsIncome = function(slave) { } // TODO: tie in quirks and flaws return cash; - }; + } }; diff --git a/src/facilities/farmyard/reports/farmyardReport.js b/src/facilities/farmyard/reports/farmyardReport.js index 4fa80ad728d..d8998fa7be7 100644 --- a/src/facilities/farmyard/reports/farmyardReport.js +++ b/src/facilities/farmyard/reports/farmyardReport.js @@ -1,3 +1,5 @@ +// FIXME: needs further review + App.Facilities.Farmyard.farmyardReport = function farmyardReport() { let frag = document.createDocumentFragment(); @@ -358,8 +360,7 @@ App.Facilities.Farmyard.farmyardReport = function farmyardReport() { }; if (slaves) { - const - intro = App.UI.DOM.appendNewElement("p", frag, '', "indent"); + const intro = App.UI.DOM.appendNewElement("p", frag, '', "indent"); let r = []; -- GitLab