code:
:: P food crisis [nobr]

/* feel free to move this into a different folder */

<<set $nextButton = "Continue", $nextLink = "Random Nonindividual Event">>

<<if ($PC.skill.trading >= 100) || ($PC.career == "capitalist")>>
	<<set _price = 2500>>
<<elseif ($PC.skill.trading >= 50) || ($PC.career == "capitalist")>>
	<<set _price = 5000>>
<<else>>
	<<set _price = 10000>>
<</if>>

<<switch $foodCrisis>>
<<case 1>>

	The region supplying much of the Free City's food had been battling a famine for quite some time now — between the deteriorating weather and the war raging on — but it had always seemed the situation was improving, and your arcology's citizens never really had to worry about going to bed hungry. Unfortunately, that all changed this week. A firefight had broken out near one of the region's largest farms, and one of the main reserves of food was caught in the crossfire.

	Supplies steadily began to dwindle, and it wasn't long before the prices of food began to rise as a result. <<if $arcologyUpgrade.hydro == 1>>Even the hydroponics system you had installed earlier could barely put a dent in the needs of your citizens.<</if>> Now, the poorest in your arcology are facing starvation. Seeing no other choice, they turned to you to provide them with sustenance. ''This is a unique opportunity.'' It's unlikely your citizens would ask for your help again, should you choose not to help them.

	<<link "Provide them with ample rations">>
		<<replace "#result">>
		You have enough to go around, so you decide to help the desperate citizens. You have a number of rationing stations set up throughout $arcologies[0].name and announce that each citizen is entitled to four full meals a day, more than enough to sate the hunger of even the most famished of men. Your citizens are @@.green;thrilled@@ to hear that their leader is looking out for them.
		<<run repX(5000, "event")>>
		<<set cashX(forceNeg(_price*2), "farmyard")>>
		<<set $rations = 2>>
		<</replace>>
	<</link>>
	<<if ($PC.skill.trading >= 50) || ($PC.career == "capitalist")>>//This will cost <<print cashFormat(_price*2)>> and some upkeep, @@.springgreen;reduced by your knowledge of trading@@//<<else>>//This will cost <<print cashFormat(_price*2)>> and incur significant upkeep costs//<</if>>

<<link "Give them enough to survive on">>
		<<replace "#result">>
		You have your own problems to deal with, but that doesn't mean you don't look out for your own. You have a number of rationing stations set up throughout $arcologies[0].name and announce that each citizen is entitled to two full meals a day, just enough for your citizens not to starve. Your citizens are @@.green;happy@@ to hear that their leader is looking out for them.
		<<run repX(2500, "event")>>
		<<set cashX(forceNeg(_price), "farmyard")>>
		<<set $rations = 1>>
		<</replace>>
	<</link>>
	<<if ($PC.skill.trading >= 50) || ($PC.career == "capitalist")>>//This will cost <<print cashFormat(_price)>> and some upkeep, @@.springgreen;reduced by your knowledge of trading@@//<<else>>//This will cost <<print cashFormat(_price)>> and incur significant upkeep costs//<</if>>

<<link "They can figure their problem out on their own">>
		<<replace "#result">>
		You have your own problems to deal with, and you simply can't afford to drop everything and solve theirs at the moment. That you can't take care of your arcology's citizen @@.red;reflects poorly on you.@@
		<<run repX(-500, "event")>>
		<</replace>>
	<</link>>

<<case 2>>

	It's been a few weeks since your citizens had approached you asking for aid, and since then, the situation hasn't improved. In fact, it had gotten worse, and food prices have reached a record high. The tension in $arcologies[0].name is palpable, and small riots have broken out more than once over disputes about food. You are not surprised, then, when you receive a visit from some of the "middle class" /* TODO: still not really happy with this */ citizens. They state that they noticed that you have been giving out rations to the poorer citizens, and, now that the situation has become dire, were wondering if you would be willing to do the same for them.

	<<link "Give them generous rations as well">>
		<<replace "#result">>
		You still have more than enough to go around, so you inform the leaders that you have decided you will give them large rations, enough to feed even the hungriest citizen. The leaders are @@.green;very pleased@@ to hear that you are taking care of them as well.
		<<run repX(5000, "event")>>
		<<set cashX(forceNeg(_price*2), "farmyard")>>
		<<set $rations = 4>>
		<</replace>>
	<</link>>
	<<if ($PC.skill.trading >= 50) || ($PC.career == "capitalist")>>//This will cost <<print cashFormat(_price*2)>> and some upkeep, @@.springgreen;reduced by your knowledge of trading@@//<<else>>//This will cost <<print cashFormat(_price*2)>> and incur significant upkeep costs//<</if>>

<<link "Provide them with enough sustenance to survive on too">>
		<<replace "#result">>
		As much as you'd like to provide them with all of the food in the world, it simply is not feasible in your current situation. Therefore, you announce to the leaders that you will provide them only enough rations to live off of. The leaders understand, and are @@.green;pleased@@ to hear that you would provide for them at all.
		<<run repX(2500, "event")>>
		<<set cashX(forceNeg(_price), "farmyard")>>
		<<set $rations = 3>>
		<</replace>>
	<</link>>
	<<if ($PC.skill.trading >= 50) || ($PC.career == "capitalist")>>//This will cost <<print cashFormat(_price)>> and some upkeep, @@.springgreen;reduced by your knowledge of trading@@//<<else>>//This will cost <<print cashFormat(_price)>> and incur significant upkeep costs//<</if>>

<<link "Change your mind about giving out any rations at all">>
		<<replace "#result">>
		Having given the people rations at all was a mistake, you think to yourself. You have a great number of your own problems to deal with, and providing rations to everyone that can't afford food is putting an unnecessary strain on your own situation. With this is mind, you tell the leaders that you simply can't help them at this time, and have decided that you can't help anyone with food at all. The citizens are understandably @@.red;angry@@ that you would go back on your word.
		<<run repX(-1000, "event")>>
		<<set $rations = 0>>
		<</replace>>
	<</link>>

<<case 3>>

	Another few weeks has passed since your last meeting with your citizens regarding rationing, and things have only deteriorated further since then. It was only a matter of time, then, before the wealthier citizens of $arcologies[0].name paid you a visit one afternoon. While being able to afford food wasn't exactly difficult for them as of yet, they could read the writing on the wall, and knew it would only be a matter of time before the prices of food were so high that even they would be forced to beg for handouts.

	Seeing the progress you had made since taking control of the arcology, they decided their best course of action was to come to you with a proposition. They would allow you to take full control of the food supply in $arcologies[0].name, and in return you would keep them well-fed. ''This is a unique opportunity.'' If you turn their offer down, the citizens of your arcology will find another way of surviving.

<<link "Set up a food market">>
		<<replace "#result">>
		You know that a proposition like this wouldn't have been easy for your citizens to make, and you also know that there is no one better suited to a task like this than you. You announce that you will be setting up a market to buy, sell, and store food in, and that you'll make sure that the citizens will continue to be well-fed. Your citizens are @@.green;glad@@ to hear that you are looking out for their best interests.
		<<run repX(5000, "event")>>
		<<set cashX(forceNeg(_price*5), "farmyard")>>
		<<set $foodMarket = 1>>
		<<unset $rations>>
		<</replace>>
	<</link>>
	<<if ($PC.skill.trading >= 50) || ($PC.career == "capitalist")>>//This will cost an initial investment of <<print cashFormat(_price*5)>>, @@.springgreen;reduced by your knowledge of trading@@//<<else>>//This will cost an initial investment of <<print cashFormat(_price*5)>>//<</if>>

<<link "Politely decline their offer, but continue giving them rations">>
		<<replace "#result">>
		Things have been going fairly well for you, but not //that// well — setting up an entirely new place to buy, sell, and store food would no doubt be an expensive undertaking. You tell the citizens that while you can't spare the resources to create a new market at the moment, you will honor your past agreement and continue giving them free rations. The people initially seem a bit disappointed that you don't seem to want to expand $arcologies[0].name, but are ultimately @@.green;glad@@ to hear that you'll continue taking care of them.
		<<run repX(2500, "event")>>
		<<set cashX(forceNeg(_price), "farmyard")>>
		<<set $rations = 5>>
		<</replace>>
	<</link>>
	<<if ($PC.skill.trading >= 50) || ($PC.career == "capitalist")>>//This will cost <<print cashFormat(_price)>> and some upkeep, @@.springgreen;reduced by your knowledge of trading@@//<<else>>//This will cost <<print cashFormat(_price)>> and incur significant upkeep costs//<</if>>

<<link "Turn down their offer and end rationing completely">>
		<<replace "#result">>
		While a new place to buy, sell, and store food in $arcologies[0].name would most likely come in quite handy in the future, you ultimately decide that you simply cannot spare the resources required. In fact, giving rations at all was a costly venture, and after not having seen any sort of return-on-investment, you decide that you are unable to continue giving out rations anymore. Your citizens are @@.red;angry@@ at the fact that you seem not to care about them at all, but that's their problem.
		<<run repX(-1000, "event")>>
		<<unset $rations>>
		<</replace>>
	<</link>>

<</switch>>


code:
/* Putting them here because commenting them out was breaking for some reason */

	<<if $animalsBought.germanShepherds == 0>>
		<<link "Purchase German Shepherds" "FarmyardAnimals">><<set cashX(forceNeg(Math.trunc(20000*$upgradeMultiplierArcology)), "farmyard"), $animalsBought.germanShepherds = 1, $animalsBought.canines += 1, $canines.push("German Shepherds")>><</link>>

	<<elseif $animalsBought.germanShepherds == 1>>
		German Shepherds
		<<if $activeCanine.breed != "German Shepherd">>
			[[Set as active canine|FarmyardAnimals][$activeCanine = {species: "dog", speciesCap: "Dog", speciesPlural: "dogs", breed: "German Shepherd", type: "canine", dickSize: "big", ballType: "dog"}]]
		<<else>>
			//Set as active canine//
		<</if>>

	<</if>>
	<<if $animalsBought.goldenRetrievers == 0>>
		<<link "Purchase Golden Retrievers" "FarmyardAnimals">><<set cashX(forceNeg(Math.trunc(20000*$upgradeMultiplierArcology)), "farmyard"), $animalsBought.goldenRetrievers = 1, $animalsBought.canines += 1, $canines.push("Golden Retrievers")>><</link>>

	<<elseif $animalsBought.goldenRetrievers == 1>>
		Golden Retrievers
		<<if $activeCanine.breed != "Golden Retriever">>
			[[Set as active canine|FarmyardAnimals][$activeCanine = {species: "dog", speciesCap: "Dog", speciesPlural: "dogs", breed: "Golden Retriever", type: "canine", dickSize: "big", ballType: "dog"}]]
		<<else>>
			//Set as active canine//
		<</if>>

	<</if>>
	<<if $animalsBought.frenchBulldogs == 0>>
		<<link "Purchase French Bulldogs" "FarmyardAnimals">><<set cashX(forceNeg(Math.trunc(20000*$upgradeMultiplierArcology)), "farmyard"), $animalsBought.frenchBulldogs = 1, $animalsBought.canines += 1, $canines.push("French Bulldogs")>><</link>>

	<<elseif $animalsBought.frenchBulldogs == 1>>
		French Bulldogs
		<<if $activeCanine.breed != "French Bulldog">>
			[[Set as active canine|FarmyardAnimals][$activeCanine = {species: "dog", speciesCap: "Dog", speciesPlural: "dogs", breed: "French Bulldog", type: "canine", dickSize: "big", ballType: "dog"}]]
		<<else>>
			//Set as active canine//
		<</if>>

	<</if>>
	<<if $animalsBought.bulldogs == 0>>
		<<link "Purchase Bulldogs" "FarmyardAnimals">><<set cashX(forceNeg(Math.trunc(20000*$upgradeMultiplierArcology)), "farmyard"), $animalsBought.bulldogs = 1, $animalsBought.canines += 1, $canines.push("Bulldogs")>><</link>>

	<<elseif $animalsBought.bulldogs == 1>>
		Bulldogs
		<<if $activeCanine.breed != "Bulldog">>
			[[Set as active canine|FarmyardAnimals][$activeCanine = {species: "dog", speciesCap: "Dog", speciesPlural: "dogs", breed: "Bulldog", type: "canine", dickSize: "big", ballType: "dog"}]]
		<<else>>
			//Set as active canine//
		<</if>>

	<</if>>
	<<if $animalsBought.beagles == 0>>
		<<link "Purchase Beagles" "FarmyardAnimals">><<set cashX(forceNeg(Math.trunc(20000*$upgradeMultiplierArcology)), "farmyard"), $animalsBought.beagles = 1, $animalsBought.canines += 1, $canines.push("Beagles")>><</link>>

	<<elseif $animalsBought.beagles == 1>>
		Beagles
		<<if $activeCanine.breed != "Beagle">>
			[[Set as active canine|FarmyardAnimals][$activeCanine = {species: "dog", speciesCap: "Dog", speciesPlural: "dogs", breed: "Beagle", type: "canine", dickSize: "big", ballType: "dog"}]]
		<<else>>
			//Set as active canine//
		<</if>>

	<</if>>
	<<if $animalsBought.poodles == 0>>
		<<link "Purchase Poodles" "FarmyardAnimals">><<set cashX(forceNeg(Math.trunc(20000*$upgradeMultiplierArcology)), "farmyard"), $animalsBought.poodles = 1, $animalsBought.canines += 1, $canines.push("Poodles")>><</link>>

	<<elseif $animalsBought.poodles == 1>>
		Poodles
		<<if $activeCanine.breed != "Poodle">>
			[[Set as active canine|FarmyardAnimals][$activeCanine = {species: "dog", speciesCap: "Dog", speciesPlural: "dogs", breed: "Poodle", type: "canine", dickSize: "big", ballType: "dog"}]]
		<<else>>
			//Set as active canine//
		<</if>>

	<</if>>
	<<if $animalsBought.rottweilers == 0>>
		<<link "Purchase Rottweilers" "FarmyardAnimals">><<set cashX(forceNeg(Math.trunc(20000*$upgradeMultiplierArcology)), "farmyard"), $animalsBought.rottweilers = 1, $animalsBought.canines += 1, $canines.push("Rottweilers")>><</link>>

	<<elseif $animalsBought.rottweilers == 1>>
		Rottweilers
		<<if $activeCanine.breed != "Rottweiler">>
			[[Set as active canine|FarmyardAnimals][$activeCanine = {species: "dog", speciesCap: "Dog", speciesPlural: "dogs", breed: "Rottweiler", type: "canine", dickSize: "big", ballType: "dog"}]]
		<<else>>
			//Set as active canine//
		<</if>>

	<</if>>
	<<if $animalsBought.yorkshireTerriers == 0>>
		<<link "Purchase Yorkshire Terriers" "FarmyardAnimals">><<set cashX(forceNeg(Math.trunc(20000*$upgradeMultiplierArcology)), "farmyard"), $animalsBought.yorkshireTerriers = 1, $animalsBought.canines += 1, $canines.push("Yorkshire Terriers")>><</link>>

	<<elseif $animalsBought.yorkshireTerriers == 1>>
		Yorkshire Terriers
		<<if $activeCanine.breed != "Yorkshire Terrier">>
			[[Set as active canine|FarmyardAnimals][$activeCanine = {species: "dog", speciesCap: "Dog", speciesPlural: "dogs", breed: "Yorkshire Terrier", type: "canine", dickSize: "big", ballType: "dog"}]]
		<<else>>
			//Set as active canine//
		<</if>>

	<</if>>
	<<if $animalsBought.siberianHuskies == 0>>
		<<link "Purchase Siberian Huskies" "FarmyardAnimals">><<set cashX(forceNeg(Math.trunc(20000*$upgradeMultiplierArcology)), "farmyard"), $animalsBought.siberianHuskies = 1, $animalsBought.canines += 1, $canines.push("Siberian Huskies")>><</link>>

	<<elseif $animalsBought.siberianHuskies == 1>>
		Siberian Huskies
		<<if $activeCanine.breed != "Siberian Husky">>
			[[Set as active canine|FarmyardAnimals][$activeCanine = {species: "dog", speciesCap: "Dog", speciesPlural: "dogs", breed: "Siberian Husky", type: "canine", dickSize: "big", ballType: "dog"}]]
		<<else>>
			//Set as active canine//
		<</if>>

	<</if>>

<<if $farmyardCages > 0>>

	Cats:

	<<if $animalsBought.siameses == 0>>
		<<link "Purchase Siamese cats" "FarmyardAnimals">><<set cashX(forceNeg(Math.trunc(20000*$upgradeMultiplierArcology)), "farmyard"), $animalsBought.siameses = 1, $animalsBought.felines += 1, $felines.push("Siamese cats")>><</link>>

	<<elseif $animalsBought.siameses == 1>>
		Siamese cats
		<<if $activeFeline.breed != "Siamese">>
			[[Set as active canine|FarmyardAnimals][$activeFeline = {species: "cat", speciesCap: "Cat", speciesPlural: "cats", breed: "Siamese", type: "feline", dickSize: "small", ballType: "cat"}]]
		<<else>>
			//Set as active feline//
		<</if>>

	<</if>>
	<<if $animalsBought.persians == 0>>
		<<link "Purchase Persian cats" "FarmyardAnimals">><<set cashX(forceNeg(Math.trunc(20000*$upgradeMultiplierArcology)), "farmyard"), $animalsBought.persians = 1, $animalsBought.felines += 1, $felines.push("Persian cats")>><</link>>

	<<elseif $animalsBought.persians == 1>>
		Persian cats
		<<if $activeFeline.breed != "Persian">>
			[[Set as active feline|FarmyardAnimals][$activeFeline = {species: "cat", speciesCap: "Cat", speciesPlural: "cats", breed: "Persian", type: "feline", dickSize: "small", ballType: "cat"}]]
		<<else>>
			//Set as active feline//
		<</if>>

	<</if>>
	<<if $animalsBought.maineCoons == 0>>
		<<link "Purchase Maine Coon cats" "FarmyardAnimals">><<set cashX(forceNeg(Math.trunc(20000*$upgradeMultiplierArcology)), "farmyard"), $animalsBought.maineCoons = 1, $animalsBought.felines += 1, $felines.push("Maine Coon cats")>><</link>>

	<<elseif $animalsBought.maineCoons == 1>>
		Maine Coon cats
		<<if $activeFeline.breed != "Maine Coon">>
			[[Set as active feline|FarmyardAnimals][$activeFeline = {species: "cat", speciesCap: "Cat", speciesPlural: "cats", breed: "Maine Coon", type: "feline", dickSize: "small", ballType: "cat"}]]
		<<else>>
			//Set as active feline//
		<</if>>

	<</if>>
	<<if $animalsBought.ragdolls == 0>>
		<<link "Purchase Ragdoll cats" "FarmyardAnimals">><<set cashX(forceNeg(Math.trunc(20000*$upgradeMultiplierArcology)), "farmyard"), $animalsBought.ragdolls = 1, $animalsBought.felines += 1, $felines.push("Ragdoll cats")>><</link>>

	<<elseif $animalsBought.ragdolls == 1>>
		Ragdoll cats
		<<if $activeFeline.breed != "Ragdoll">>
			[[Set as active feline|FarmyardAnimals][$activeFeline = {species: "cat", speciesCap: "Cat", speciesPlural: "cats", breed: "Ragdoll", type: "feline", dickSize: "small", ballType: "cat"}]]
		<<else>>
			//Set as active feline//
		<</if>>

	<</if>>
	<<if $animalsBought.bengals == 0>>
		<<link "Purchase Bengal cats" "FarmyardAnimals">><<set cashX(forceNeg(Math.trunc(20000*$upgradeMultiplierArcology)), "farmyard"), $animalsBought.bengals = 1, $animalsBought.felines += 1, $felines.push("Bengal cats")>><</link>>

	<<elseif $animalsBought.bengals == 1>>
		Bengal cats
		<<if $activeFeline.breed != "Bengal">>
			[[Set as active feline|FarmyardAnimals][$activeFeline = {species: "cat", speciesCap: "Cat", speciesPlural: "cats", breed: "Bengal", type: "feline", dickSize: "small", ballType: "cat"}]]
		<<else>>
			//Set as active feline//
		<</if>>

	<</if>>
	<<if $animalsBought.abbysinians == 0>>
		<<link "Purchase Abbysinian cats" "FarmyardAnimals">><<set cashX(forceNeg(Math.trunc(20000*$upgradeMultiplierArcology)), "farmyard"), $animalsBought.abbysinians = 1, $animalsBought.felines += 1, $felines.push("Abbysinian cats")>><</link>>

	<<elseif $animalsBought.abbysinians == 1>>
		Abbysinian cats
		<<if $activeFeline.breed != "Abbysinian">>
			[[Set as active feline|FarmyardAnimals][$activeFeline = {species: "cat", speciesCap: "Cat", speciesPlural: "cats", breed: "Abbysinian", type: "feline", dickSize: "small", ballType: "cat"}]]
		<<else>>
			//Set as active feline//
		<</if>>

	<</if>>
	<<if $animalsBought.birmans == 0>>
		<<link "Purchase Birman cats" "FarmyardAnimals">><<set cashX(forceNeg(Math.trunc(20000*$upgradeMultiplierArcology)), "farmyard"), $animalsBought.birmans = 1, $animalsBought.felines += 1, $felines.push("Birman cats")>><</link>>

	<<elseif $animalsBought.birmans == 1>>
		Birman cats
		<<if $activeFeline.breed != "Birman">>
			[[Set as active feline|FarmyardAnimals][$activeFeline = {species: "cat", speciesCap: "Cat", speciesPlural: "cats", breed: "Birman", type: "feline", dickSize: "small", ballType: "cat"}]]
		<<else>>
			//Set as active feline//
		<</if>>

	<</if>>
	<<if $animalsBought.orientalShorthairs == 0>>
		<<link "Purchase Oriental Shorthair cats" "FarmyardAnimals">><<set cashX(forceNeg(Math.trunc(20000*$upgradeMultiplierArcology)), "farmyard"), $animalsBought.orientalShorthairs = 1, $animalsBought.felines += 1, $felines.push("Oriental Shorthair cats")>><</link>>

	<<elseif $animalsBought.orientalShorthairs == 1>>
		Oriental Shorthair cats
		<<if $activeFeline.breed != "Oriental Shorthair">>
			[[Set as active feline|FarmyardAnimals][$activeFeline = {species: "cat", speciesCap: "Cat", speciesPlural: "cats", breed: "Oriental Shorthair", type: "feline", dickSize: "small", ballType: "cat"}]]
		<<else>>
			//Set as active feline//
		<</if>>

	<</if>>
	<<if $animalsBought.sphynxes == 0>>
		<<link "Purchase Sphynx cats" "FarmyardAnimals">><<set cashX(forceNeg(Math.trunc(20000*$upgradeMultiplierArcology)), "farmyard"), $animalsBought.sphynxes = 1, $animalsBought.felines += 1, $felines.push("Sphynx cats")>><</link>>

	<<elseif $animalsBought.sphynxes == 1>>
		Sphynx cats
		<<if $activeFeline.breed != "Sphynx">>
			[[Set as active feline|FarmyardAnimals][$activeFeline = {species: "cat", speciesCap: "Cat", speciesPlural: "cats", breed: "Sphynx", type: "feline", dickSize: "small", ballType: "cat"}]]
		<<else>>
			//Set as active feline//
		<</if>>

	<</if>>
	<<if $animalsBought.russianBlues == 0>>
		<<link "Purchase Russian Blue cats" "FarmyardAnimals">><<set cashX(forceNeg(Math.trunc(20000*$upgradeMultiplierArcology)), "farmyard"), $animalsBought.russianBlues = 1, $animalsBought.felines += 1, $felines.push("Russian Blue cats")>><</link>>

	<<elseif $animalsBought.russianBlues == 1>>
		Russian Blue cats
		<<if $activeFeline.breed != "Russian Blue">>
			[[Set as active feline|FarmyardAnimals][$activeFeline = {species: "cat", speciesCap: "Cat", speciesPlural: "cats", breed: "Russian Blue", type: "feline", dickSize: "small", ballType: "cat"}]]
		<<else>>
			//Set as active feline//
		<</if>>

	<</if>>
<</if>>

	<<if $animalsBought.foxes == 0>>
		<<link "Purchase foxes" "FarmyardAnimals">><<set cashX(forceNeg(Math.trunc(20000*$upgradeMultiplierArcology)), "farmyard"), $animalsBought.foxes = 1, $animalsBought.canines += 1, $canines.push("foxes")>><</link>>

	<<elseif $animalsBought.foxes == 1>>
		/*Red foxes play in one corner of their kennels, chasing one another.(OLD)*/
		Foxes
		<<if $activeCanine.species != "fox">>
			[[Set as active canine|FarmyardAnimals][$activeCanine = {species: "fox", speciesCap: "Fox", speciesPlural: "foxes", type: "canine", dickSize: "large", ballType: "fox"}]]
		<<else>>
			//Set as active canine//
		<</if>>

	<</if>>
	<<if $animalsBought.jackals == 0>>
		<<link "Purchase jackals" "FarmyardAnimals">><<set cashX(forceNeg(Math.trunc(20000*$upgradeMultiplierArcology)), "farmyard"), $animalsBought.jackals = 1, $animalsBought.canines += 1, $canines.push("jackals")>><</link>>

	<<elseif $animalsBought.jackals == 1>>
		/*A group of male jackals are fighting over a potential mate, causing quite a ruckus.(OLD)*/
		Jackals
		<<if $activeCanine.species != "jackal">>
			[[Set as active canine|FarmyardAnimals][$activeCanine = {species: "jackal", speciesCap: "Jackal", speciesPlural: "jackals", type: "canine", dickSize: "large", ballType: "jackal"}]]
		<<else>>
			//Set as active canine//
		<</if>>

	<</if>>
	<<if $animalsBought.dingos == 0>>
		<<link "Purchase dingos" "FarmyardAnimals">><<set cashX(forceNeg(Math.trunc(20000*$upgradeMultiplierArcology)), "farmyard"), $animalsBought.dingos = 1, $animalsBought.canines += 1, $canines.push("dingos")>><</link>>

	<<elseif $animalsBought.dingos == 1>>
		/*The dingos are eating their meal, growling at each other when one gets to close to another's food.(OLD)*/
		Dingos
		<<if $activeCanine.species != "dingo">>
			[[Set as active canine|FarmyardAnimals][$activeCanine = {species: "dingo", speciesCap: "Dingo", speciesPlural: "dingos", type: "canine", dickSize: "large", ballType: "dingo"}]]
		<<else>>
			//Set as active canine//
		<</if>>

	<</if>>

<<if $farmyardStable > 1>>

	Hooved Animals:

	<<if $animalsBought.zebras == 0>>
		<<link "Purchase zebras" "FarmyardAnimals">><<set cashX(forceNeg(Math.trunc(20000*$upgradeMultiplierArcology)), "farmyard"), $animalsBought.zebras = 1, $animalsBought.hooved += 1, $hooved.push("zebras")>><</link>>
	<<elseif $animalsBought.zebras == 1>>
		Zebras
		<<if $activeHooved.species != "zebra">>
			[[Set as active hooved|FarmyardAnimals][$activeHooved = {species: "zebra", speciesCap: "Zebra", speciesPlural: "zebras", type: "hooved", dickSize: "huge", ballType: "zebra"}]]
		<<else>>
			//Set as active hooved//
		<</if>>
	<</if>>

<</if>>

<<if $animalsBought.cougars == 0>>
		<<link "Purchase cougars" "FarmyardAnimals">><<set cashX(forceNeg(Math.trunc(30000*$upgradeMultiplierArcology)), "farmyard"), $animalsBought.cougars = 1, $animalsBought.felines += 1, $felines.push("cougars")>><</link>>

	<<elseif $animalsBought.cougars == 1>>
		/*The cougars are sleeping, their lean bodies scattered around under trees. (OLD)*/
		Cougars
		<<if $activeFeline.species != "cougar">>
			[[Set as active feline|FarmyardAnimals][$activeFeline = {species: "cougar", speciesCap: "Cougar", speciesPlural: "cougars", type: "feline", dickSize: "large", ballType: "cougar"}]]
		<<else>>
			//Set as active feline//
		<</if>>

	<</if>>
	<<if $animalsBought.jaguars == 0>>
		<<link "Purchase jaguars" "FarmyardAnimals">><<set cashX(forceNeg(Math.trunc(30000*$upgradeMultiplierArcology)), "farmyard"), $animalsBought.jaguars = 1, $animalsBought.felines += 1, $felines.push("jaguars")>><</link>>

	<<elseif $animalsBought.jaguars == 1>>
		/*You can see a few jaguars laying around in the trees in their enclosure. (OLD)*/
		Jaguars
		<<if $activeFeline.species != "jaguar">>
			[[Set as active feline|FarmyardAnimals][$activeFeline = {species: "jaguar", speciesCap: "Jaguar", speciesPlural: "jaguars", type: "feline", dickSize: "large", ballType: "jaguar"}]]
		<<else>>
			//Set as active feline//
		<</if>>

	<</if>>
	<<if $animalsBought.lynx == 0>>
		<<link "Purchase lynxs" "FarmyardAnimals">><<set cashX(forceNeg(Math.trunc(30000*$upgradeMultiplierArcology)), "farmyard"), $animalsBought.lynx = 1, $animalsBought.felines += 1, $felines.push("lynx")>><</link>>

	<<elseif $animalsBought.lynx == 1>>
		/*The lynxes are playfully running around their enclosure. (OLD)*/
		Lynx
		<<if $activeFeline.species != "lynx">>
			[[Set as active feline|FarmyardAnimals][$activeFeline = {species: "lynx", speciesCap: "Lynx", speciesPlural: "lynx", type: "feline", dickSize: "large", ballType: "lynx"}]]
		<<else>>
			//Set as active feline//
		<</if>>

	<</if>>
	<<if $animalsBought.leopards == 0>>
		<<link "Purchase leopards" "FarmyardAnimals">><<set cashX(forceNeg(Math.trunc(30000*$upgradeMultiplierArcology)), "farmyard"), $animalsBought.leopards = 1, $animalsBought.felines += 1, $felines.push("leopards")>><</link>>

	<<elseif $animalsBought.leopards == 1>>
		/*The leopards are lazing about in the trees in their enclosure. (OLD)*/
		Leopards
		<<if $activeFeline.species != "leopard">>
			[[Set as active feline|FarmyardAnimals][$activeFeline = {species: "leopard", speciesCap: "Leopard", speciesPlural: "leopards", type: "feline", dickSize: "large", ballType: "leopard"}]]
		<<else>>
			//Set as active feline//
		<</if>>

	<</if>>
	<<if $animalsBought.tigers == 0>>
		<<link "Purchase tigers" "FarmyardAnimals">><<set cashX(forceNeg(Math.trunc(30000*$upgradeMultiplierArcology)), "farmyard"), $animalsBought.tigers = 1, $animalsBought.felines += 1, $felines.push("tigers")>><</link>>

	<<elseif $animalsBought.tigers == 1>>
		/*Some of the tigers are swimming, and the ones that aren't are lazing about. (OLD)*/
		Tigers
		<<if $activeFeline.species != "tiger">>
			[[Set as active feline|FarmyardAnimals][$activeFeline = {species: "tiger", speciesCap: "Tiger", speciesPlural: "tigers", type: "feline", dickSize: "large", ballType: "tiger"}]]
		<<else>>
			//Set as active feline//
		<</if>>

	<</if>>

repo_name: KnightBoulegard/fc

license: mit


code:
App.Facilities.Farmyard.farmyardReport = function farmyardReport() {
	"use strict";

	const
		Farmer = V.Farmer,
		FL = App.Entity.facilities.farmyard.employeesIDs().size;

	let
		t = ``,
		profits = 0,
		foodWeek = 0;
	let he, him, his, hers, himself, girl, loli, He, His;   // TODO: alternative method?

	// FARMER

	const farmerHealth = 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 = 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 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> `;
		}
	};

	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}. `;
		}

		t += slave.actualAge > 35 ?`${His} age and experience also contribute. ` : ``;

		return t;
	};

	const farmerCashBonus = slave => {
		let FarmerCashBonus = Math.min(0.2, slave.skill.farmer * 0.002);

		FarmerCashBonus += slave.intelligence + slave.intelligenceImplant > 15 ? 0.05 : 0;
		FarmerCashBonus += slave.dick > 2 && canPenetrate(slave) ? 0.05 : 0;
		FarmerCashBonus += !canSmell(slave) ? 0.05 : 0;

		if (slave.actualAge > 35) {
			FarmerCashBonus += 0.05;
		} else if (!V.AgePenalty) {
			FarmerCashBonus += 0.05;
		}

		if (setup.farmerCareers.includes(slave.career)) {
			FarmerCashBonus += 0.05;
			if (slave.skill.farmer >= V.masteredXP) {
				FarmerCashBonus += 0.05;
			}
		} else if (slave.skill.farmer >= V.masteredXP) {
			FarmerCashBonus += 0.05;
		}

		if (Farmer.relationshipTarget === slave.ID) {
			FarmerCashBonus -= 0.05;
		} else if (areRelated(Farmer, slave)) {
			FarmerCashBonus += 0.05;
		}

		return FarmerCashBonus;
	};

	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. `;
		} 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 farmerDick = slave => {
		if (slave.dick > 2 && canPenetrate(slave)) {
			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)) {

			let t = ``;

			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
				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. `;
				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. `;
				slave.trust++;
			}

			return t;
		}
	}

	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);
		}

		seed = V.cash - oldCash;
		cashX(Math.trunc(0.5 * seed), 'farmyard');
		seed = Math.trunc(1.5 * seed);
		profits += seed;
		beauty = Beauty(V.activeSlave);

		t += `
    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 ${cashFormat(seed)} ${He} can charge more for ${his} time, since many citizens find it erotic to fuck the Farmer. `;

		return t;
	};

	const farmerEndWeek = slave => {
		let t = ``;

		if (V.showEWD) {
			t += `<br><br>`;
			/* 000-250-006 */   // TODO: legacy - needed?
			if (V.seeImages && V.seeReportImages) {
				t += `

					  ${SlaveArt(slave, 0, 0)}

`;
			}
			/* 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>>`;
		}

		return t;
	};

	const farmerRelationshipPC = slave => slave.relationship === -3 && slave.devotion > 50 ? `As your loving ${wife}, ${he} does ${his} best to ensure ${V.farmyardName} runs smoothly. ` : ``;

	const farmerAgeSkill = slave => slave.actualAge > 35 ? `${His} age and experience also contribute. ` : ``;

	const farmerIntelligence = slave => slave.intelligence + slave.intelligenceImplant > 15 ? `${He} is a clever manager. ` : ``;

	const farmerSmell = slave => !canSmell(slave) ? `${His} lack of a sense of smell protects ${him} from that omnipresent barnyard stench. ` : ``;

	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}.` : ``;

	const farmhandLivingRules = 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 = 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 = 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 = slave => {
		let t = ``;

		if (V.showEWD) {
			t += `<br><br>`;
			/* 000-250-006 */   // TODO: legacy - needed?
			if (V.seeImages && V.seeReportImages) {
				t += `

					  ${SlaveArt(slave, 0, 0)}

`;
			}
			/* 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>>`;
		}

		return t;
	};

	const farmhandProfit = slave => {
		let incomeStats = getSlaveStatisticData(slave, slave.assignment === Job.FARMYARD ? V.facility.farmyard : undefined);
		return incomeStats.income;
	};

	const farmhandFood = 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;

	// MENIALS

	if (V.farmMenials > 0) {
		let farmMenialProductivity = 9;

		if (V.farmyardUpgrade.pump) {
			farmMenialProductivity += 1;
		}
		if (V.farmyardUpgrade.fertilizer) {
			farmMenialProductivity += 2;
		}
		if (V.farmyardUpgrade.seeds) {
			farmMenialProductivity += 3;
		}
		if (V.farmyardUpgrade.machinery) {
			farmMenialProductivity += 3;
		}

		foodWeek += (V.farmMenials * farmMenialProductivity);
	}

	// FARMYARD

	const farmyardStatsRecords = () => {
		// 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 = () => {
		let t = ``;

		// TODO: add checks for the different FSs
		if (V.farmyardDecoration !== 'standard') {
			if (!profits && !foodWeek) {
				t += `<br>`;
			}
			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>`;
			}
		}

		return t;
	};

	const farmyardProfit = (profit, foodWeek) => {
		let t = ``;

		if (profit || foodWeek) {
			t += `<br><br>${V.farmyardNameCaps} `;
			if (profit) {
				t += `makes you <span class="yellowgreen">${cashFormat(Math.trunc(profit))}</span>`;
			}
			if (profit && foodWeek && V.foodMarket) {
				t += ` and `;
			}
			if (foodWeek && V.foodMarket) {
				t += `produced <span class="chocolate"> ${massFormat(foodWeek)}</span> of food`;
			}
			t += ` this week. `;
		}

		return t;
	};

	const farmyardStatsDisplay = () => `<<FarmyardStatistics 0>><<timed 50ms>><<replace #farmyardstats>><<FarmyardStatistics 1>><</replace>><</timed>>`;

	t += `<span id="farmyardstats"></span>`;

	// MAIN LOOP

	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);
	}

	t += farmhandCount(FL);

	if (Farmer) {
		t += farmerEndWeek(Farmer);
	}

	if (FL > 0) {
		let oldCash = V.cash,
			oldFood = V.food;

		for (const slave of App.Utils.sortedEmployees(App.Entity.facilities.farmyard)) {
			V.i = V.slaveIndices[slave.ID];

			({
				he, him, his, hers, himself, girl, He, His, loli
			} = getPronouns(slave));

			farmhandLivingRules(slave);
			farmhandHealth(slave);
			farmhandDevotion(slave);
			farmhandTrust(slave);
			farmhandEnergy(slave);
			farmhandFood(slave);
			profits += farmhandProfit(slave);

			t += farmhandEndWeek(slave);
		}

		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;
};


code:
App.Data.Facilities.headGirlSuite = {
	baseName: "HGSuite",
	genericName: null,
	jobs: {
		HGToy: {
			position: "Head Girl's toy",
			assignment: Job.HEADGIRLSUITE,
			publicSexUse: true,
			fuckdollAccepted: false,
			description: {
				rulesAssistant: {
					assigned:()=> `live in your Head Girl's private suite`
				}
			}
		}
	},
	defaultJob: "HGToy",
	manager: {
		position: "Head Girl",
		assignment: Job.HEADGIRL,
		careers: App.Data.misc.HGCareers,
		skill: "headGirl",
		publicSexUse: false,
		fuckdollAccepted: false,
		broodmotherAccepted: false,
		shouldWalk: true,
		shouldHold: true,
		shouldSee: true,
		shouldHear: true,
		shouldTalk: true,
		shouldThink: true,
		requiredDevotion: 51
	}
};

App.Entity.Facilities.HeadGirlSuite = class extends App.Entity.Facilities.SingleJobFacility {
	constructor() {
		super(App.Data.Facilities.headGirlSuite);
	}

	/** @override */
	get UIName() {
		const nameCaps = this.nameCaps;
		return nameCaps === "The Head Girl Suite" ? "Head Girl Suite"  : nameCaps;
	}

	/** @override */
	occupancyReport(long) {
		return this.manager.currentEmployee
			? `HG${this.hostedSlaves ? long
				? ` and ${getPronouns(this.manager.currentEmployee).his} slave`
				: ", 1" : ""}`
			: "";
	}
};

App.Entity.facilities.headGirlSuite = new App.Entity.Facilities.HeadGirlSuite();


code:
App.Data.Facilities.incubator = {
	baseName: "incubator",
	genericName: null,
	jobs: {
		tank: {
			position: "tank",
			assignment: Job.TANK,
			publicSexUse: false,
			fuckdollAccepted: false
		}
	},
	defaultJob: "tank",
	manager: null
};

App.Entity.Facilities.IncubatorTankJob = class extends App.Entity.Facilities.Job {
	/**
	 * @override
	 * @returns {App.Entity.SlaveState[]}
	 */
	employees() {
		return V.tanks;
	}

	/** @override */
	employeesIDs() {
		return new Set(this.employees().map(s => s.ID));
	}
};

App.Entity.Facilities.Incubator = class extends App.Entity.Facilities.Facility {
	constructor() {
		super(App.Data.Facilities.incubator, {
			tank: new App.Entity.Facilities.IncubatorTankJob()
		});
	}

};

App.Entity.facilities.incubator = new App.Entity.Facilities.Incubator();


code:
App.Data.Facilities.masterSuite = {
	baseName: "masterSuite",
	genericName: "Master Suite",
	jobs: {
		fucktoy: {
			position: "fucktoy",
			assignment: Job.MASTERSUITE,
			publicSexUse: false,
			fuckdollAccepted: false,
			description: {
				rulesAssistant: {
					assigned:()=> `${V.masterSuiteName}`
				}
			}
		}
	},
	defaultJob: "fucktoy",
	manager: {
		position: "concubine",
		positionAbbreviation: "C",
		assignment: Job.CONCUBINE,
		careers: [],
		skill: null,
		publicSexUse: false,
		fuckdollAccepted: false,
		broodmotherAccepted: true,
		shouldWalk: false,
		shouldHold: false,
		shouldSee: false,
		shouldHear: false,
		shouldTalk: false,
		shouldThink: false,
		requiredDevotion: 51
	}
};

App.Entity.Facilities.MasterSuiteFuckToyJob = class extends App.Entity.Facilities.FacilitySingleJob {
	/**
	 * @param {App.Entity.SlaveState} slave
	 * @returns {string[]}
	 */
	checkRequirements(slave) {
		let r = super.checkRequirements(slave);
		if (!App.Entity.Facilities.Job._isBrokenEnough(slave, 20, -51, -21, -50)) {
			r.push(`${slave.slaveName} is not sufficiently broken for ${this.facility.name}.`);
		}

		return r;
	}
};

App.Entity.Facilities.ConcubineJob = class extends App.Entity.Facilities.ManagingJob {
	checkRequirements(slave) {
		let r = super.checkRequirements(slave);
		if (isAmputee(slave)) {
			r.push(`${slave.slaveName} can't serve as your Concubine without limbs.`);
		}
		return r;
	}
};

App.Entity.facilities.masterSuite = new App.Entity.Facilities.SingleJobFacility(
	App.Data.Facilities.masterSuite,
	{
		fucktoy: new App.Entity.Facilities.MasterSuiteFuckToyJob()
	},
	new App.Entity.Facilities.ConcubineJob()
);


code:
:: AC Dump

<<if (ndef $activeChild) || ($activeChild == 0)>>

	@@.red;ERROR:@@ AC Dump, activeChild invalid, returnTo is '$returnTo', previous passage was '<<print previous()>>'. Please report this.

	<<link "Continue">><<goto $returnTo>><</link>> | [[Go Back|previous()]]

<<else>>

	<<set _CL = $cribs.length, _ID = $activeChild.ID>>

	<<if $i >= 0 && $i < _CL && $cribs[$i].ID == _ID>> /* shortcut if $i is already pointing to this slave */
		<<set $cribs[$i] = $activeChild>>
	<<else>>
		<<set $i = $cribs.findIndex(function(s) { s.ID === _ID; })>> /* find $i if exists */
		<<if $i != -1>> /* not found, so new slave */
			@@.red;ERROR:@@ $activeChild.slaveName not found! Please report this.
		<<else>>
			<<set $cribs[$i] = $activeChild>>
		<</if>>
	<</if>>

	<<goto $returnTo>>

<</if>>