code:
:: Farm Widgets [widget]
<<widget "destinationfarmroad">>
<<if $bus is "farmroad1">>
	<<link [[Next|Farm Road 1]]>><<endevent>><<set $eventskip to 1>><</link>>
<<elseif $bus is "farmroad2">>
	<<link [[Next|Farm Road 2]]>><<endevent>><<set $eventskip to 1>><</link>>
<<elseif $bus is "farmroad3">>
	<<link [[Next|Farm Road 3]]>><<endevent>><<set $eventskip to 1>><</link>>
<<elseif $bus is "farmroad4">>
	<<link [[Next|Farm Road 4]]>><<endevent>><<set $eventskip to 1>><</link>>
<<elseif $bus is "farmroad5">>
	<<link [[Next|Farm Road 5]]>><<endevent>><<set $eventskip to 1>><</link>>
<<else>>
	<<link [[Next|Farm Road 6]]>><<endevent>><<set $eventskip to 1>><</link>>
<</if>>
<</widget>>

<<widget "hitchhike_journey">>
<<pass 15>>
<<if $phase is 1>>

	You stare out the window as the <<person>> drives, watching the hills roll by. <<He>> takes a peculiar route down a side road, but emerges on Harvest Street all the same. You climb from the car, and <<he>> drives away.

	<<endcombat>>

	<<link [[Next|Harvest Street]]>><<endevent>><<set $eventskip to 1>><</link>>

<<else>>
	You stare out the window as the <<person>> drives, watching the hills roll by. <<He>> takes a peculiar route down a side road, but emerges in the farmlands all the same. You climb from the car, and <<he>> drives away.

	<<endcombat>>

	<<link [[Next|Farmland]]>><<endevent>><<set $eventskip to 1>><</link>>

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

<<widget "hitchhike_journey_nude">>
<<pass 15>>
<<if $phase is 1>>

	<<He>> holds on to your clothes for the remainder of the journey, only giving them up as you drive into town.

	<<He>> watches with amusement as you struggle to dress in the confines of the car. "Better hurry," <<he>> laughs. "Someone will see you."

	<<He>> drives away as soon as you exit the vehicle.

	<<link [[Next|Harvest Street]]>><<clotheson>><<endevent>><<set $eventskip to 1>><</link>>

<<else>>

	<<He>> holds on to your clothes for the remainder of the journey, only giving them up as you approach the farmlands.

	<<He>> watches with amusement as you struggle to dress in the confines of the car. "Better hurry," <<he>> laughs. "Someone will see you."

	<<He>> drives away as soon as you exit the vehicle.

	<<link [[Next|Farmland]]>><<clotheson>><<endevent>><<set $eventskip to 1>><</link>>

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

<<widget "passoutfarmroad">>
/*ToDo: Pregnancy, remove $pregnancyTesting to properly enable*/
<<if $sexStats.vagina.pregnancy.waterBreaking is true and $pregnancyTesting>>
	<<pregnancyWatersBrokenPassout "farmroad">>
<<else>>
	<<passout>>
	You've pushed yourself too much. You pass out.

	<<set $danger to random(1, 10000)>>
	<<if $danger gte (9900 - $allure)>>
		<<if $location is "farm" or $location is "alex_farm" or $location is "alex_cottage">>
			<<link [[Next|Farm Abduction wake]]>><<pass 5>><<set $stress -= 2000>><</link>>
		<<else>>
			<<link [[Next|Moor Abduction Wake]]>><<pass 60>><<set $stress -= 2000>><<set $moor to 50>><</link>>
		<</if>>

	<<else>>
		<<ambulance>>
	<</if>>
<</if>>
<</widget>>

<<widget "hitchhike">>
<<set $rng to random(1, 100)>>
<<if $exposed gte 1>>
	You hear a car approaching. <<covered>> You hide
	<<if $rng gte 81>>
		behind a bush
	<<elseif $rng gte 61>>
		in a ditch
	<<elseif $rng gte 41>>
		behind a tree
	<<elseif $rng gte 21>>
		behind a rock
	<<else>>
		within a copse
	<</if>>
	at the side of the road until it passes.<<gstress>><<stress 6>>

	<<destinationfarmroad>>
<<elseif $rng gte 81>>
	<<generate1>><<person1>>
	A car pulls up beside you. The window drops, revealing a <<person>>.

	"Need a lift?" <<he>> says. "Which way you going?"

	<<link [[To town|Farm Hitchhike Ask]]>><<set $phase to 1>><</link>>

	<<link [[To the farms|Farm Hitchhike Ask]]>><<set $phase to 2>><</link>>

	<<link [[Step away|Farm Hitchhike Refuse]]>><</link>>

<<elseif $rng gte 61>>
	<<generate1>><<person1>>
	A car pulls up beside you. The window drops, revealing a <<person>>.

	"I see you're in need of help there, <<girl>>," <<he>> says. "I'll take you where you need to go." <<He>> opens the car door. "But you need to make it worth my while. Get on your knees."

	<<if $promiscuity gte 55>>
		<<link [[Kneel|Farm Hitchhike Kneel]]>><</link>><<promiscuous4>>

	<</if>>
	<<link [[Refuse|Farm Hitchhike Kneel Refuse]]>><</link>>

<<elseif $rng gte 41>>
	<<generate1>><<person1>>
	A car pulls up beside you. The window drops, revealing a <<person>>.

	"What you doing out here all alone?" <<he>> asks with a sly smile.

	<<link [[Say you need to get to town|Farm Hitchhike Exposed]]>><<set $phase to 1>><</link>>

	<<link [[Say you need to get to the farms|Farm Hitchhike Exposed]]>><<set $phase to 2>><</link>>

	<<link [[Step away|Farm Hitchhike Refuse]]>><</link>>

<<elseif $rng gte 21>>
	<<generate1>><<generate2>><<person1>>
	A car pulls up beside you. The window drops, revealing a <<person>>. A <<person2>><<person>> leans over <<person1>><<him>>.

	<<person2>>
	<<if $player.gender_appearance is "m">>
		"Handsome fella,"
	<<else>>
		"Cute <<girl>>,"
	<</if>>
	<<he>> says. "We'll give you a lift. How about you tell us where you're headed? You can sit between us."

	<<link [[Accept and say you're going to town (0:15)|Farm Hitchhike Pair]]>><<set $phase to 1>><</link>>

	<<link [[Accept and say you're going to the farms (0:15)|Farm Hitchhike Pair]]>><<set $phase to 2>><</link>>

	<<link [[Refuse|Farm Hitchhike Pair Refuse]]>><</link>>

<<else>>
	<<generate1>><<generate2>><<generate3>><<person1>>
	A car pulls up beside you. A <<person>>, <<person2>><<person>> and <<person3>><<person>> step out.

	"All alone?" the <<person1>><<person>> mocks as <<he>> steps behind you. The other two close in. "Nice. You'd best play along. There's no one out here to save you."<<gstress>><<stress 6>>

	<<link [[Run|Farm Hitchhike Run]]>><</link>><<athleticsdifficulty 1 1000>>

	<<link [[Stand your ground|Farm Hitchhike Rape]]>><<set $molestationstart to 1>><</link>>

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

<<widget "fox_gen">>

<<if ($monsterchance gte 1 and $hallucinations gte 1) or ($monsterchance gte 1 and $monsterhallucinations is "f")>>
	<<if $malechance lt random(1, 100)>>
		<<set $fox to "female">>
	<<else>>
		<<set $fox to "male">>
	<</if>>
<<else>>
	<<if $beastmalechance lt random(1, 100)>>
		<<set $fox to "vixen">>
	<<else>>
		<<set $fox to "reynard">>
	<</if>>
<</if>>
<</widget>>

<<widget "fox_text">>
<<if $fox is "male">>
	<<set _text_output to "foxboy">>
<<elseif $fox is "female">>
	<<set _text_output to "foxgirl">>
<<elseif $fox is "vixen">>
	<<set _text_output to "vixen">>
<<elseif $fox is "reynard">>
	<<set _text_output to "fox">>
<</if>>
<<print _text_output>>
<</widget>>

<<widget "fox_he">>
<<if $fox is "male">>
	<<set _text_output to "he">>
<<elseif $fox is "female">>
	<<set _text_output to "she">>
<<elseif $fox is "vixen">>
	<<set _text_output to "it">>
<<elseif $fox is "reynard">>
	<<set _text_output to "it">>
<</if>>
<<print _text_output>>
<</widget>>

<<widget "fox_He">>
<<if $fox is "male">>
	<<set _text_output to "He">>
<<elseif $fox is "female">>
	<<set _text_output to "She">>
<<elseif $fox is "vixen">>
	<<set _text_output to "It">>
<<elseif $fox is "reynard">>
	<<set _text_output to "It">>
<</if>>
<<print _text_output>>
<</widget>>

<<widget "fox_him">>
<<if $fox is "male">>
	<<set _text_output to "him">>
<<elseif $fox is "female">>
	<<set _text_output to "her">>
<<elseif $fox is "vixen">>
	<<set _text_output to "it">>
<<elseif $fox is "reynard">>
	<<set _text_output to "it">>
<</if>>
<<print _text_output>>
<</widget>>

<<widget "fox_his">>
<<if $fox is "male">>
	<<set _text_output to "his">>
<<elseif $fox is "female">>
	<<set _text_output to "her">>
<<elseif $fox is "vixen">>
	<<set _text_output to "its">>
<<elseif $fox is "reynard">>
	<<set _text_output to "its">>
<</if>>
<<print _text_output>>
<</widget>>

<<widget "farm_work_time">>
<<set _farm_work_time to Math.trunc(($time / 20) - 17)>>
<<if _farm_work_time gte 46 or $args[0] is "midnight">>
	<<set _farm_work_time to 46>>
<</if>>
<</widget>>

<<widget "farm_milk_check">>
<<farm_work_time>>
<<if _farm_work_time gte 30>>
	<<set $farm_work.cattle_need to (18 - $farm_work.cattle_milked)>>
<<elseif _farm_work_time gte 10>>
	<<set $farm_work.cattle_need to (12 - $farm_work.cattle_milked)>>
<<else>>
	<<set $farm_work.cattle_need to (6 - $farm_work.cattle_milked)>>
<</if>>
<</widget>>

<<widget "farm_work_update">>
<<alex_clamp>>
<<farm_work_time $args[0]>>

<<if $args[0] is "midnight" and $farm_work>>
	<<if $farm_work.recent_shift gte 660>>
		<<earnFeat "Dawn to Dusk">>
	<</if>>
<</if>>

<<if $farm_work is undefined>>
	<<set $farm_work to {}>>
	<<set $farm_work.time to 0>>
	<<set $farm_work.shower to 0>>
	<<set $farm_work.border to 0>>
	<<set $farm_work.yard to 0>>
	<<set $farm_work.chickens_fed to 0>>
	<<set $farm_work.chickens_out to 0>>
	<<set $farm_work.pigs_fed to 0>>
	<<set $farm_work.pigs_out to 0>>
	<<set $farm_work.horses_brushed to 0>>
	<<set $farm_work.horses_out to 0>>
	<<set $farm_work.horses_satisfied to 0>>
	<<set $farm_work.cattle_out to 0>>
	<<set $farm_work.cattle_milked to 0>>
	<<set $farm_work.cattle_need to 0>>
	<<set $farm_work.dogs_fed to 0>>
	<<set $farm_work.alex_relax to 0>>
	<<set $farm_work.still to 0>>
	<<set $farm_work.tending to 0>>
	<<set $farm_work.hay to 0>>
	<<set $farm_work.admin to 0>>
	<<if $farm>>
		<<if $farm.woodland>>
			<<set $farm_work.woodland to 0>>
		<</if>>
	<</if>>
	<<set $farm_work.event_time to random(60, 300)>>
	<<set $farm_work.recent_shift to 0>>
	<<if $farm_stage gte 5>>
		<<set $farm_work.fence_damage to 0>>
		<<farm_fence_damage 6>>
	<<else>>
		<<if random(1, 3) is 3>>
			<<set $farm_work.fence_damage to random(0, 6)>>
		<</if>>
	<</if>>

	<<set $farm_work.dog to {}>>
	<<set $farm_work.pig to {}>>
	<<set $farm_work.horse to {}>>
	<<set $farm_work.cattle to {}>>

	<<if ($monsterchance gte random(1, 100)) and ($hallucinations gte 1 or $monsterhallucinations is "f")>>
		<<set $farm_work.horse.monster_roll to true>>
	<<else>>
		<<set $farm_work.horse.monster_roll to false>>
	<</if>>
	<<if ($monsterchance gte random(1, 100)) and ($hallucinations gte 1 or $monsterhallucinations is "f")>>
		<<set $farm_work.pig.monster_roll to true>>
	<<else>>
		<<set $farm_work.pig.monster_roll to false>>
	<</if>>
	<<if ($monsterchance gte random(1, 100)) and ($hallucinations gte 1 or $monsterhallucinations is "f")>>
		<<set $farm_work.dog.monster_roll to true>>
	<<else>>
		<<set $farm_work.dog.monster_roll to false>>
	<</if>>
	<<if ($monsterchance gte random(1, 100)) and ($hallucinations gte 1 or $monsterhallucinations is "f")>>
		<<set $farm_work.cattle.monster_roll to true>>
	<<else>>
		<<set $farm_work.cattle.monster_roll to false>>
	<</if>>
	<<unset $farm_kennel>>
	<<farm_gen_all>>
<</if>>
<<set _farm_alex_actions to _farm_work_time - $farm_work.time>>

<<for _i = 0; _i < _farm_alex_actions; _i++>>
	<<if $farm_work.chickens_panic gte 1>>
		<<set $farm_work.chickens_panic to 0>>
		<<set $farm_work.alex to "chickens_panic">>
		<<continue>>
	<</if>>
	<<if $farm_work.pigs_panic gte 1>>
		<<set $farm_work.pigs_panic to 0>>
		<<set $farm_work.alex to "pigs_panic">>
		<<continue>>
	<</if>>
	<<if $farm_work.horses_panic gte 1>>
		<<set $farm_work.horses_panic to 0>>
		<<set $farm_work.alex to "horses_panic">>
		<<continue>>
	<</if>>
	<<if $farm_work.cattle_panic gte 1>>
		<<set $farm_work.cattle_panic to 0>>
		<<set $farm_work.alex to "cattle_panic">>
		<<continue>>
	<</if>>
	<<if $farm_work.dogs_panic gte 1>>
		<<set $farm_work.dogs_panic to 0>>
		<<set $farm_work.alex to "dogs_panic">>
		<<continue>>
	<</if>>
	<<if $farm_work.shower lt 1>>
		<<set $farm_work.shower to 1>>
		<<set $farm_work.alex to "shower">>
		<<continue>>
	<</if>>
	<<if $farm_work.border lt 1>>
		<<set $farm_work.border to 1>>
		<<set $farm_work.alex to "border">>
		<<continue>>
	<</if>>
	<<if $farm_work.yard lt 1>>
		<<set $farm_work.yard to 1>>
		<<set $farm_work.alex to "yard">>
		<<continue>>
	<</if>>
	<<if $farm_work.chickens_fed lt 1>>
		<<set $farm_work.chickens_fed to 1>>
		<<set $farm_work.alex to "chickens_fed">>
		<<continue>>
	<</if>>
	<<if $farm_work.chickens_out lt 1>>
		<<set $farm_work.chickens_out to 1>>
		<<set $farm_work.alex to "chickens_out">>
		<<continue>>
	<<elseif $farm_work.chickens_out lt 2 and _farm_work_time gte 40>>
		<<set $farm_work.chickens_out to 2>>
		<<set $farm_work.alex to "chickens_in">>
		<<continue>>
	<</if>>
	<<if $farm_work.pigs_out lt 1>>
		<<set $farm_work.pigs_out to 1>>
		<<set $farm_work.alex to "pigs_out">>
		<<continue>>
	<<elseif $farm_work.pigs_out lt 2 and _farm_work_time gte 40>>
		<<set $farm_work.pigs_out to 2>>
		<<set $farm_work.alex to "pigs_in">>
		<<continue>>
	<</if>>
	<<if $farm_work.horses_out lt 1>>
		<<set $farm_work.horses_out to 1>>
		<<set $farm_work.alex to "horses_out">>
		<<continue>>
	<<elseif $farm_work.horses_out lt 2 and _farm_work_time gte 40>>
		<<set $farm_work.horses_out to 2>>
		<<set $farm_work.alex to "horses_in">>
		<<continue>>
	<</if>>
	<<if $farm_work.cattle_out lt 1>>
		<<set $farm_work.cattle_out to 1>>
		<<set $farm_work.alex to "cattle_out">>
		<<continue>>
	<<elseif $farm_work.cattle_out lt 2 and _farm_work_time gte 40>>
		<<set $farm_work.cattle_out to 2>>
		<<set $farm_work.alex to "cattle_in">>
		<<continue>>
	<</if>>
	<<if $farm_work.fence_damage gte 1>>
		<<set $farm_work.fence_damage -= 1>>
		<<set $farm_work.alex to "fence_damage">>
		<<continue>>
	<</if>>
	<<if $farm_work.hay lt 6>>
		<<set $farm_work.hay += 1>>
		<<set $farm_work.alex to "hay">>
		<<continue>>
	<</if>>
	<<if $farm>>
		<<if $farm.woodland>>
			<<if $farm_work.woodland lt $farm.woodland>>
				<<set $farm_work.woodland += 1>>
				<<set $farm_work.alex to "woodland">>
				<<continue>>
			<</if>>
		<</if>>
	<</if>>
	<<if $farm_work.cattle_milked lt 6>>
		<<set $farm_work.cattle_milked += 6>>
		<<set $farm_work.alex to "cattle_milked">>
		<<continue>>
	<<elseif $farm_work.cattle_milked lt 12 and _farm_work_time gte 16>>
		<<set $farm_work.cattle_milked += 6>>
		<<set $farm_work.alex to "cattle_milked">>
		<<continue>>
	<<elseif $farm_work.cattle_milked lt 18 and _farm_work_time gte 36>>
		<<set $farm_work.cattle_milked += 6>>
		<<set $farm_work.alex to "cattle_milked">>
		<<continue>>
	<</if>>
	<<farm_milk_check>>
	<<if $farm_work.chicken_eggs lt 1 and _farm_work_time gte 26>>
		<<set $farm_work.chicken_eggs to 1>>
		<<est $farm_work.alex to "chicken_eggs">>
		<<continue>>
	<</if>>
	<<if $farm_work.dogs_fed lt 1 or (_farm_work_time gte 40 and $farm_work.dogs_fed lt 2)>>
		<<set $farm_work.dogs_fed += 1>>
		<<set $farm_work.alex to "dogs_fed">>
		<<continue>>
	<</if>>
	<<if $farm_work.pigs_fed lt 6>>
		<<set $farm_work.pigs_fed += 1>>
		<<set $farm_work.alex to "pigs_fed">>
		<<continue>>
	<</if>>
	<<if $farm_work.horses_brushed lt 6>>
		<<set $farm_work.horses_brushed += 6>>
		<<set $farm_work.alex to "horses_brushed">>
		<<continue>>
	<</if>>
	<<if $farm_work.alex_relax lt 3 and _farm_work_time gte 16>>
		<<set $farm_work.alex_relax += 1>>
		<<set $farm_work.alex to "relax">>
		<<continue>>
	<</if>>
	<<if $farm_work.still lt 3>>
		<<set $farm_work.still += 1>>
		<<set $farm_work.alex to "still">>
		<<continue>>
	<</if>>
	<<if $farm_stage gte 7>>
		/*The PC handles the fields from this point.*/
	<<elseif $farm_stage gte 6>>
		<<if $farm_work.tending lt 18>>
			<<set $farm_work.tending += 1>>
			<<set $farm_work.alex to "tending">>
			<<continue>>
		<</if>>
	<<elseif $farm_stage gte 5>>
		<<if $farm_work.tending lt 14>>
			<<set $farm_work.tending += 1>>
			<<set $farm_work.alex to "tending">>
			<<continue>>
		<</if>>
	<<elseif $farm_stage gte 4>>
		<<if $farm_work.tending lt 10>>
			<<set $farm_work.tending += 1>>
			<<set $farm_work.alex to "tending">>
			<<continue>>
		<</if>>
	<<else>>
		<<if $farm_work.tending lt 6>>
			<<set $farm_work.tending += 1>>
			<<set $farm_work.alex to "tending">>
			<<continue>>
		<</if>>
	<</if>>
	<<if $farm_work.admin lt 6 or $farm_stage is 12>>
		<<set $farm_work.admin += 1>>
		<<set $farm_work.alex to "admin">>
		<<continue>>
	<</if>>

	<<set $farm.clearing -= 1>>
	<<set $farm_work.alex to "clearing">>
<</for>>

<<if _farm_work_time gte 0 or $args[0] is "midnight">>
	<<set $farm_work.time to _farm_work_time>>
<</if>>

<</widget>>

<<widget "farm_alex">>

<<switch $farm_work.alex>>
<<case "shower">>
	You hear running water in the shed beside the farmhouse. Alex is taking a shower.
<<case "border">>
	Alex follows the border of the farm, checking the walls and fences for damage.
<<case "yard">>
	<<if $weather is "snow">>
		Alex is clearing the yard of snow.
	<<else>>
		Alex is clearing the yard of fallen leaves.
	<</if>>
<<case "chickens_fed">>
	Alex is feeding the chickens.
<<case "chickens_out">>
	Alex has let the chickens into the yard, and is cleaning their coop.
<<case "chickens_in">>
	Alex is herding the chickens back into their coop.
<<case "pigs_out">>
	Alex has let the <<farm_text_many pig>> into the outdoor pen, and is cleaning their sty.
<<case "pigs_in">>
	Alex is herding the <<farm_text_many pig>> back into their sty.
<<case "horses_out">>
	Alex is leading the <<farm_text_many horse>> to the field.
<<case "horses_in">>
	Alex is herding the <<farm_text_many horse>> back to the stable.
<<case "cattle_out">>
	Alex has let the <<farm_text_many cattle>> into the field, and is cleaning their barn.
<<case "cattle_in">>
	Alex is herding the <<farm_text_many cattle>> back into their barn.
<<case "cattle_milked">>
	Alex is attaching the <<farm_text_many cattle>> to milking machines.
<<case "chicken_eggs">>
	Alex is gathering chicken eggs.
<<case "pigs_fed">>
	Alex is carrying heavy buckets of pig feed across the yard.
<<case "horses_brushed">>
	Alex is brushing the horses.
<<case "relax">>
	Alex is relaxing under a tree.
<<case "still">>
	<<if $farm_stage gte 9>>
		Alex is working in the lab.
	<<else>>
		Alex has disappeared into an old stone building. The door is locked.
	<</if>>
<<case "tending">>
	Alex is tending to the crops.
<<case "clearing">>
	<<if $farm_stage is 12>>
		Alex leans on an upper story windowsill of the farmhouse, talking on a phone.
	<<else>>
		Alex is battling the weeds that strangle the old fields.
	<</if>>
<<case "chickens_panic">>
	Alex is calming the chickens.
<<case "pigs_panic">>
	Alex is wrestling the <<farm_text_many pig>>, trying to calm them.
<<case "horses_panic">>
	Alex is soothing the <<farm_text_many horse>>.
<<case "cattle_panic">>
	Alex is calming the <<farm_text_many cattle>>.
<<case "dogs_panic">>
	Alex is stroking the <<farm_text_many dog>>.
<<case "panic">>
	Alex rushes around, trying to calm the animals.
<<case "fence_damage">>
	Alex is repairing the perimeter.
<<case "dogs_fed">>
	Alex is feeding the <<farm_text_many dog>>.
<<case "hay">>
	<<if $season is "winter">>
		Alex is checking the buildings for frost damage.
	<<elseif $season is "spring">>
		Alex is tending to the hay field.
	<<else>>
		Alex is gathering hay.
	<</if>>
<<case "woodland">>
	Alex is working in the woods.
<<case "admin">>
	Alex leans on an upper story windowsill of the farmhouse, talking on a phone.
<</switch>>

<</widget>>

<<widget "farm_status">>

<<if $farm_work.border lt 1>>
	Someone needs to check the border for break-ins and other damage.

<<elseif $farm_work.fence_damage gte 10>>
	The perimeter is in dire need of repair.

<<elseif $farm_work.fence_damage gte 5>>
	The perimeter is in dire need of repair.

<<elseif $farm_work.fence_damage gte 1>>
	The perimeter is in need of repair.

<</if>>
<<if $farm_work.yard lt 1>>
	<<if $weather is "snow">>
		The yard is covered in snow.
	<<else>>
		The yard is covered in fallen leaves.
	<</if>>

<</if>>
<<if $farm_work.chickens_panic gte 1>>
	The chickens cluck in a maddening choir.

<<elseif $farm_work.chickens_out lt 1>>
	The chickens cluck at the edge of their coop, eager to be let out.

<<elseif $farm_work.chickens_fed lt 1>>
	Hungry chickens follow you across the yard.

<<elseif $farm_work.chickens_out lt 2 and _farm_work_time gte 36>>
	The chickens avoid the growing shadows.

<</if>>
<<if $farm_work.pigs_panic gte 1>>
	The <<farm_text_many pig>> are a frenzy of squeals. They're trying to dig their way out.

<<elseif $farm_work.pigs_out lt 1>>
	The <<farm_text_many pig>> are restless.

<<elseif $farm_work.pigs_fed lt 1>>
	The <<farm_text_many pig>> root around the mud for leftover scraps.

<<elseif $farm_work.pigs_fed lt 6>>
	The <<farm_text_many pig>> have some food, but not enough to sate their appetites.

<<elseif $farm_work.pigs_out lt 2 and _farm_work_time gte 36>>
	The <<farm_text_many pig>> huddle close together for warmth.

<</if>>
<<if $farm_work.horses_panic gte 1>>
	<<if $farm_work.horses_out lt 1 or $farm_work.horses_out gte 3>>
		The <<farm_text_many horse>> gallop around the field, neighing in a panic.
	<<else>>
		The <<farm_text_many horse>> bash against the doors of their stalls, trying to escape.
	<</if>>

<<elseif $farm_work.horses_out lt 1>>
	<<if $farm_work.horse.monster is true>>
		The centaur shout at you, asking to be let out.

	<<else>>
		The horses pace around their stalls.

	<</if>>
<<elseif $farm_work.horses_brushed lt 1>>
	<<if $farm_work.horse.monster is true>>
		The centaur need brushing.

	<<else>>
		The horses need brushing.

	<</if>>
<<elseif $farm_work.horses_brushed lt 2>>
	<<if $farm_work.horse.monster is true>>
		One centaur is brushed, but the others need attention.

	<<else>>
		One horse is brushed, but the others need attention.

	<</if>>
<<elseif $farm_work.horses_brushed lt 6>>
	<<if $farm_work.horse.monster is true>>
		The centaur need more brushing.

	<<else>>
		The horses need more brushing.

	<</if>>
<<elseif $farm_work.horses_out lt 2 and _farm_work_time gte 36>>
	<<if $farm_work.horse.monster is true>>
		Some of the centaur lie on the grass, worn out for the day.

	<<else>>
		Some of the horses lie on the grass, worn out for the day.

	<</if>>
<<elseif $deviancy gte 35 and $farm_work.horses_satisfied lt 6 and $farm_work.horses_out lt 2>>
	<<if $farm_work.horse.monster is true and $horsedisable is "f">>
		The centaur seem agitated. They need "special" attention.

	<<elseif $bestialitydisable is "f" and $horsedisable is "f">>
		The horses seem agitated. They need "special" attention.

	<</if>>
<</if>>
<<if $farm_work.cattle_panic gte 1>>
	The <<farm_text_many cattle>> pace and shiver.

<<elseif $farm_work.cattle_out lt 1>>
	The <<farm_text_many cattle>> moo from their barn, eager to be let out.

<<elseif $farm_work.cattle_milked lt 6>>
	The <<farm_text_many cattle>> pace uncomfortably. They need milking.

<<elseif $farm_work.cattle_milked lt 12 and _farm_work_time gte 10>>
	The <<farm_text_many cattle>> pace uncomfortably. They need milking.

<<elseif $farm_work.cattle_milked lt 18 and _farm_work_time gte 30>>
	The <<farm_text_many cattle>> pace uncomfortably. They need milking.

<<elseif $farm_work.cattle_out lt 2 and _farm_work_time gte 36>>
	The <<farm_text_many cattle>> crowd around their barn, fearful of the growing shadows.

<</if>>
<<if $farm_work.dogs_panic gte 1>>
	The <<farm_text_many dog>> howl at the sky.

<<elseif $farm_work.dogs_fed lt 1 or ($farm_work.dogs_fed lt 2 and _farm_work_time gte 36)>>
	The <<farm_text_many dog>> watch the gate to the field, eager for their meal.

<</if>>
<<if $farm_stage is 6 and $farm_work.tending lte 18>>
	The crops need tending.

<<elseif $farm_stage is 5 and $farm_work.tending lte 14>>
	The crops need tending.

<<elseif $farm_stage is 4 and $farm_work.tending lte 10>>
	The crops need tending.

<<elseif ($farm_stage is 3 or $farm_stage is 2) and $farm_work.tending lte 6>>
	The crops need tending.

<</if>>
<<if $farm_work.woodland lt $farm.woodland>>
	The woodland needs tending.

<</if>>

<</widget>>

<<widget "farm_actions">>
<<farm_gen_all>>
<<set _actions to 0>>
<<if $farm_work.alex is "shower">>
	<<set $skulduggerydifficulty to 700>>
	<<ind>><<link [[Spy on Alex (0:20)|Farm Spy]]>><<pass 20>><</link>><<promiscuous1>><<skulduggerydifficulty>>

<</if>>
<<if $hour gte 6>>
	<<if $farm_work.border lt 1>>
		<<ind>><<link [[Investigate the perimeter (0:20)|Farm Border]]>><<farm_count 20>><<set $farm_work.border to 1>><<pass 20>><</link>><<run _actions++>>

	<<elseif $farm_work.fence_damage gte 1>>
		<<if $farm_work.alex is "fence_damage">>
			<<ind>><<link [[Help Alex repair the perimeter (0:20)|Farm Perimeter Alex]]>><<npcincr Alex love 1>><<farm_count 20>><<set $farm_work.fence_damage -= 1>><<pass 20>><</link>><<glove>><<run _actions++>>

		<<else>>
			<<ind>><<link [[Repair the perimeter (0:20)|Farm Perimeter]]>><<farm_count 20>><<set $farm_work.fence_damage -= 1>><<pass 20>><</link>><<run _actions++>>

		<</if>>
	<</if>>
<</if>>
	<<if $farm_work.yard lt 1>>
		<<ind>><<link [[Clear the yard (0:20)|Farm Yard]]>><<farm_count 20>><<set $farm_work.yard to 1>><<pass 20>><<tiredness 2>><</link>><<gtiredness>><<run _actions++>>

	<</if>>
<<if $hour gte 6>>
	<<if $farm_work.chickens_panic gte 1>>
		<<chickenicon>><<link [[Calm the chickens (0:20)|Farm Chickens Calm]]>><<farm_count 20>><<pass 20>><</link>><<tendingdifficulty 1 300>><<run _actions++>>

	<<elseif $farm_work.chickens_out lt 1>>
		<<chickenicon>><<link [[Let the chickens out (0:20)|Farm Chickens Out]]>><<farm_count 20>><<set $farm_work.chickens_out to 1>><<pass 20>><</link>><<run _actions++>>

	<<elseif $farm_work.chickens_fed lt 1>>
		<<chickenicon>><<link [[Feed the chickens (0:20)|Farm Chickens Feed]]>><<farm_count 20>><<set $farm_work.chickens_fed to 1>><<pass 20>><</link>><<run _actions++>>

	<<elseif $farm_work.chickens_out lt 2 and _farm_work_time gte 36>>
		<<chickenicon>><<link [[Herd the chickens into their coop (0:20)|Farm Chickens In]]>><<farm_count 20>><<set $farm_work.chickens_out to 2>><<pass 20>><</link>><<run _actions++>>

	<</if>>
	<<if $farm_work.pigs_panic gte 1>>
		<<pigicon>><<link [[Calm the pigs (0:20)|Farm Pigs Calm]]>><<farm_count 20>><<pass 20>><</link>><<physiquedifficulty 1 $physiquemax>><<run _actions++>>

	<<elseif $farm_work.pigs_out lt 1>>
		<<pigicon>><<link [[Let the pigs out (0:20)|Farm Pigs Out]]>><<farm_count 20>><<set $farm_work.pigs_out to 1>><<pass 20>><</link>><<run _actions++>>

	<<elseif $farm_work.pigs_fed lt 6>>
		<<if $farm_work.alex is "pigs_fed">>
			<<pigicon>><<link [[Help Alex feed the pigs (0:20)|Farm Pigs Feed Alex]]>><<farm_count 20>><<set $farm_work.pigs_fed += 1>><<pass 20>><</link>><<run _actions++>>

		<<else>>
			<<pigicon>><<link [[Feed the pigs (0:20)|Farm Pigs Feed]]>><<farm_count 20>><<set $farm_work.pigs_fed += 1>><<pass 20>><<tiredness 2>><</link>><<gtiredness>><<run _actions++>>

		<</if>>
	<<elseif $farm_work.pigs_out lt 2 and _farm_work_time gte 36>>
		<<pigicon>><<link [[Herd the pigs into their sty (0:20)|Farm Pigs In]]>><<farm_count 20>><<set $farm_work.pigs_out to 2>><<pass 20>><</link>><<run _actions++>>

	<</if>>
	<<if $farm_work.horses_panic gte 1>>
		<<horseicon>><<link [[Calm the horses (0:20)|Farm Horses Calm]]>><<farm_count 20>><<pass 20>><</link>><<tendingdifficulty 1 1000>><<run _actions++>>

	<<elseif $farm_work.horses_out lt 1>>
		<<if $farm_work.horse.monster is true>>
			<<horseicon>><<link [[Let the centaur out (0:20)|Farm Horses Out]]>><<farm_count 20>><<set $farm_work.horses_out to 1>><<pass 20>><</link>><<run _actions++>>
		<<else>>
			<<horseicon>><<link [[Let the horses out (0:20)|Farm Horses Out]]>><<farm_count 20>><<set $farm_work.horses_out to 1>><<pass 20>><</link>><<run _actions++>>
		<</if>>

	<<elseif $farm_work.horses_brushed lt 6>>
		<<if $farm_work.horse.monster is true>>
			<<horseicon>><<link [[Brush a centaur (0:20)|Farm Horses Brush]]>><<farm_count 20>><<set $farm_work.horses_brushed += 1>><<pass 20>><<tending 2>><<trauma -2>><</link>><<gtending>><<ltrauma>><<run _actions++>>
		<<else>>
			<<horseicon>><<link [[Brush a horse (0:20)|Farm Horses Brush]]>><<farm_count 20>><<set $farm_work.horses_brushed += 1>><<pass 20>><<tending 2>><<trauma -2>><</link>><<gtending>><<ltrauma>><<run _actions++>>
		<</if>>

	<<elseif $farm_work.horses_out lt 2 and _farm_work_time gte 36>>
		<<if $farm_work.horse.monster is true>>
			<<horseicon>><<link [[Herd the centaur to their stable (0:20)|Farm Horses In]]>><<farm_count 20>><<set $farm_work.horses_out to 2>><<pass 20>><</link>><<run _actions++>>
		<<else>>
			<<horseicon>><<link [[Herd the horses to their stable (0:20)|Farm Horses In]]>><<farm_count 20>><<set $farm_work.horses_out to 2>><<pass 20>><</link>><<run _actions++>>
		<</if>>

	<<elseif $deviancy gte 35 and $farm_work.horses_satisfied lt 6 and $farm_work.horses_out lt 2 and $horsedisable is "f">>
		<<if $farm_work.horse.monster is true>>
			<<horseicon>><<link [[Approach a centaur|Farm Horses Lewd]]>><</link>><<run _actions++>>
		<<elseif $bestialitydisable is "f">>
			<<horseicon>><<link [[Approach a horse|Farm Horses Lewd]]>><</link>><<run _actions++>>
		<</if>>

	<</if>>
	<<if $farm_work.cattle_panic gte 1>>
		<<cowicon>><<link [[Calm the cattle (0:20)|Farm Cattle Calm]]>><<farm_count 20>><<pass 20>><</link>><<tendingdifficulty 1 500>><<run _actions++>>

	<<elseif $farm_work.cattle_out lt 1>>
		<<cowicon>><<link [[Let the cattle out (0:20)|Farm Cattle Out]]>><<farm_count 20>><<set $farm_work.cattle_out to 1>><<pass 20>><</link>><<run _actions++>>

	<<elseif $farm_work.cattle_milked lt 6>>
		<<cowicon>><<link [[Milk the cattle|Farm Cattle Milk]]>><</link>><<run _actions++>>

	<<elseif $farm_work.cattle_milked lt 12 and _farm_work_time gte 10>>
		<<cowicon>><<link [[Milk the cattle|Farm Cattle Milk]]>><</link>><<run _actions++>>

	<<elseif $farm_work.cattle_milked lt 18 and _farm_work_time gte 30>>
		<<cowicon>><<link [[Milk the cattle|Farm Cattle Milk]]>><</link>><<run _actions++>>

	<<elseif $farm_work.cattle_out lt 2 and _farm_work_time gte 36>>
		<<cowicon>><<link [[Herd the cattle into their barn (0:20)|Farm Cattle In]]>><<farm_count 20>><<pass 20>><<set $farm_work.cattle_out to 2>><</link>><<run _actions++>>

	<</if>>
	<<if $farm_work.dogs_panic gte 1>>
		<<dogicon>><<link [[Calm the dogs (0:20)|Farm Dogs Calm]]>><<farm_count 20>><<pass 20>><</link>><<tendingdifficulty 1 700>><<run _actions++>>

	<<elseif $farm_work.dogs_fed lt 1 or _farm_work_time gte 36 and $farm_work.dogs_fed lt 2>>
		<<dogicon>><<link [[Feed the dogs (0:20)|Farm Dogs Feed]]>><<farm_count 20>><<pass 20>><<set $farm_work.dogs_fed += 1>><</link>><<run _actions++>>

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

<<if $farm_work.alex is "relax" and ($exposed lt 2 or $exhibitionism gte 75)>>
	<<ind>><<link [[Join Alex (0:20)|Farm Rest]]>><<farm_count 20>><<trauma -2>><<stress -2>><<npcincr Alex love 1>><<set $phase to 1>><<pass 20>><</link>><<glove>><<ltrauma>><<lstress>>

<</if>>
<<if $farm_stage gte 7>>
	/*The PC tends the field in more detail via the tending system after this point.*/
<<elseif $farm_stage gte 6 and $farm_work.tending lte 18>>
	<<if $farm_work.alex is "tending">>
		<<if ($exposed lt 2 or $exhibitionism gte 75)>>
			<<ind>><<link [[Help Alex tend the crops (0:20)|Farm Tending Alex]]>><<farm_count 20>><<pass 20>><<tending 2>><<tiredness 2>><<physique 2>><<set $farm_work.tending += 1>><</link>><<gtiredness>><<gtending>><<run _actions++>>

		<</if>>
	<<else>>
		<<ind>><<link [[Tend the crops (0:20)|Farm Tending]]>><<farm_count 20>><<pass 20>><<tending 2>><<tiredness 2>><<physique 2>><<set $farm_work.tending += 1>><</link>><<gtiredness>><<gtending>><<run _actions++>>

	<</if>>
<<elseif $farm_stage gte 5 and $farm_work.tending lte 14>>
	<<if $farm_work.alex is "tending">>
		<<if ($exposed lt 2 or $exhibitionism gte 75)>>
			<<ind>><<link [[Help Alex tend the crops (0:20)|Farm Tending Alex]]>><<farm_count 20>><<pass 20>><<tending 2>><<tiredness 2>><<physique 2>><<set $farm_work.tending += 1>><</link>><<gtiredness>><<gtending>><<run _actions++>>

		<</if>>
	<<else>>
		<<ind>><<link [[Tend the crops (0:20)|Farm Tending]]>><<farm_count 20>><<pass 20>><<tending 2>><<tiredness 2>><<physique 2>><<set $farm_work.tending += 1>><</link>><<gtiredness>><<gtending>><<run _actions++>>

	<</if>>
<<elseif $farm_stage gte 4 and $farm_work.tending lte 10>>
	<<if $farm_work.alex is "tending">>
		<<if ($exposed lt 2 or $exhibitionism gte 75)>>
			<<ind>><<link [[Help Alex tend the crops (0:20)|Farm Tending Alex]]>><<farm_count 20>><<pass 20>><<tending 2>><<tiredness 2>><<physique 2>><<set $farm_work.tending += 1>><</link>><<gtiredness>><<gtending>><<run _actions++>>

		<</if>>
	<<else>>
		<<ind>><<link [[Tend the crops (0:20)|Farm Tending]]>><<farm_count 20>><<pass 20>><<tending 2>><<tiredness 2>><<physique 2>><<set $farm_work.tending += 1>><</link>><<gtiredness>><<gtending>><<run _actions++>>

	<</if>>
<<elseif ($farm_stage is 3 or $farm_stage is 2) and $farm_work.tending lte 6>>
	<<if $farm_work.alex is "tending">>
		<<if ($exposed lt 2 or $exhibitionism gte 75)>>
			<<ind>><<link [[Help Alex tend the crops (0:20)|Farm Tending Alex]]>><<farm_count 20>><<pass 20>><<tending 2>><<tiredness 2>><<physique 2>><<set $farm_work.tending += 1>><</link>><<gtiredness>><<gtending>><<run _actions++>>

		<</if>>
	<<else>>
		<<ind>><<link [[Tend the crops (0:20)|Farm Tending]]>><<farm_count 20>><<pass 20>><<tending 2>><<tiredness 2>><<physique 2>><<set $farm_work.tending += 1>><</link>><<gtiredness>><<gtending>><<run _actions++>>

	<</if>>
<</if>>
<<if $farm_stage isnot 12 and $farm_work.alex is "clearing" and ($exposed lt 2 or $exhibitionism gte 75) and $daystate isnot "night">>
	<<ind>><<link [[Help Alex clear a field (0:20)|Farm Clearing]]>><<farm_count 20>><<pass 20>><<tiredness 2>><<physique 2>><<set $farm.clearing -= 1>><</link>><<gtiredness>><<run _actions++>>

<</if>>
<<if $farm_stage isnot 12 and $farm_stage gte 7 and _actions is 0 and $farm_work.alex isnot "clearing" and ($exposed lt 2 or $exhibitionism gte 75)>>
	<<ind>><<link [[Clear a field alone (0:40)|Farm Clearing Alone]]>><<farm_count 40>><<pass 40>><<tiredness 4>><<physique 3>><<set $farm.clearing -= 1>><</link>><<ggtiredness>><<run _actions++>>

<</if>>

<<if (_actions lt 2 or $farm_stage lt 7) and ($farm_work.alex isnot "relax" or $exposed gte 0)>>

	<<ind>><<link [[Rest near the stables (0:15)|Farm Stables Rest]]>><<pass 15>><<stress -2>><</link>><<lstress>>
<</if>>

<</widget>>

<<widget "farm_work">>

<<if $daystate isnot "night">>
	<<farm_alex>>
	<<farm_status>>
<</if>>
<<farm_actions>>

<</widget>>

<<widget "fields_init">>
<<plots_init farm 4 earth 3 large>>
<</widget>>

<<widget "farm_init">>

<<farm_work_update>>
<<if $farm_work.horses_out lt 1>>
	<<set $farm_work.horses_out to 1>>
<</if>>
<<if $farm_work.chickens_fed lt 1>>
	<<set $farm_work.chickens_fed to 1>>
<</if>>
<<if $farm_work.cattle_out lt 1>>
	<<set $farm_work.cattle_out to 1>>
<</if>>
<<if $farm_work.cattle_milked lt 6>>
	<<set $farm_work.cattle_milked to 6>>
<</if>>
<<set $farm to {}>>
<<set $farm.beasts to {}>>
<<set $farm.wage to 1500>>
<<set $farm.beasts.pigs to 0>>
<<set $farm.beasts.horses to 0>>
<<set $farm.beasts.cattle to 0>>
<<set $farm.beasts.dogs to 0>>
<<set $farm_naked_alex to 1>>
<<set $farm.clearing to 100>>

<<farm_update>>
<</widget>>

<<widget "farm_update">>
<<if $farm isnot undefined>>
	<<if $farm.milking is undefined>>
		<<set $farm.milking to {
			caught: false,
			alexNightEvent: false,
			catchChance: 0,
			dayMilking: false,
		}>>
	<</if>>
	<<if $farm.milking.catchChance is NaN>>
		<<set $farm.milking.catchChance to 0>>
	<</if>>
	<<if $farm.build_finished is undefined or $farm.build_finished is 0>>
		<<set $farm.build_finished to []>>
	<</if>>
<</if>>
<</widget>>

<<widget "farm_pigs">>
<<if $args[0]>>
	<<set $farm.beasts.pigs += $args[0]>>
	<<set $farm.beasts.pigs = Math.clamp($farm.beasts.pigs, -30, 30)>>
<</if>>
<</widget>>

<<widget "farm_horses">>
<<if $args[0]>>
	<<set $farm.beasts.horses += $args[0]>>
	<<set $farm.beasts.horses = Math.clamp($farm.beasts.horses, -30, 30)>>
<</if>>
<</widget>>

<<widget "farm_cattle">>
<<if $args[0]>>
	<<set $farm.beasts.cattle += $args[0]>>
	<<set $farm.beasts.cattle = Math.clamp($farm.beasts.cattle, -30, 30)>>
<</if>>
<</widget>>

<<widget "farm_dogs">>
<<if $args[0]>>
	<<set $farm.beasts.dogs += $args[0]>>
	<<set $farm.beasts.dogs = Math.clamp($farm.beasts.dogs, -30, 30)>>
<</if>>
<</widget>>

<<widget "farm_trust">>
<<if $args[0] is "horses">>
	<<set $enemytrust += ($farm.beasts.horses * 3)>>
<<elseif $args[0] is "pigs">>
	<<set $enemytrust += ($farm.beasts.pigs * 3)>>
<<elseif $args[0] is "cattle">>
	<<set $enemytrust += ($farm.beasts.cattle * 3)>>
<<elseif $args[0] is "dogs">>
	<<set $enemytrust += ($farm.beasts.dogs * 3)>>
<</if>>
<</widget>>

<<widget "farm_gen">>
<<if $farm_work[$args[0]].monster_roll is true and ($hallucinations gte 1 or $monsterhallucinations is "f")>>
	<<set $farm_work[$args[0]].monster to true>>
	<<if $beastmalechance gte 100>>
		<<set $farm_work[$args[0]].gender_plural to "m">>
	<<elseif $beastmalechance gte 1>>
		<<set $farm_work[$args[0]].gender_plural to "b">>
	<<else>>
		<<set $farm_work[$args[0]].gender_plural to "f">>
	<</if>>
	<<if $beastmalechance gte random(1, 100)>>
		<<set $farm_work[$args[0]].gender to "m">>
		<<if $cbchance gte random(1, 100)>>
			<<set $farm_work[$args[0]].genitals to "vagina">>
		<<else>>
			<<set $farm_work[$args[0]].genitals to "penis">>
		<</if>>
	<<else>>
		<<set $farm_work[$args[0]].gender to "f">>
		<<if $dgchance gte random(1, 100)>>
			<<set $farm_work[$args[0]].genitals to "penis">>
		<<else>>
			<<set $farm_work[$args[0]].genitals to "vagina">>
		<</if>>
	<</if>>
<<else>>
	<<set $farm_work[$args[0]].monster to false>>
	<<if $beastmalechance gte 100>>
		<<set $farm_work[$args[0]].gender_plural to "m">>
	<<elseif $beastmalechance gte 1>>
		<<set $farm_work[$args[0]].gender_plural to "b">>
	<<else>>
		<<set $farm_work[$args[0]].gender_plural to "f">>
	<</if>>
	<<if $beastmalechance gte random(1, 100)>>
		<<set $farm_work[$args[0]].gender to "m">>
		<<set $farm_work[$args[0]].genitals to "penis">>
	<<else>>
		<<set $farm_work[$args[0]].gender to "f">>
		<<set $farm_work[$args[0]].genitals to "vagina">>
	<</if>>
<</if>>
<</widget>>

<<widget "farm_gen_all">>
<<farm_gen horse>>
<<farm_gen pig>>
<<farm_gen dog>>
<<farm_gen cattle>>
<</widget>>

<<widget "farm_brush">>
<<if currentSkillValue('tending') gte 600>>
	You brush <<farm_his horse>> fur. There's a lot to cover, but you can tell where the <<farm_text horse>> really needs it. <<farm_He horse>> enjoys the attention.

	Another <<farm_text horse>> waits for its turn. You make quick work of the first, and move on to the second.

	<<set $farm_work.horses_brushed += 1>>
<<else>>
	You brush <<farm_his horse>> fur. It's a long process as there's a lot to cover, but the <<farm_text horse>> seems to enjoy it.

<</if>>
<<set $danger to random(1, 10000)>>
<<if $danger gte (9900 - $allure)>>

	<<if $horsedisable is "f" and ($bestialitydisable is "f" or $farm_work.horse.monster is true)>>
		You finish up, and walk toward the gate while cleaning the brush of hair. You hear hooves approach behind you. The <<farm_text horse>> gives chase.

		<<if $farm_work.horse.monster is true>>
			"I'm not finished," <<farm_he horse>> says. "Get back here."
		<<else>>
			It neighs at you, as if angry.
		<</if>>

		<<link [[Run|Farm Horses Brush Run]]>><</link>><<athleticsdifficulty 1 1100>>

		<<link [[Wait|Farm Horses Brush Wait]]>><<farm_horses -1>><<stress 6>><</link>><<gstress>><<lrespect>>

	<<else>>
		The <<farm_text horse>> nips your shoulder when you stop, seeming to want more.<<gpain>><<gstress>><<pain 4>><<stress 6>>

		<<link [[Next|Farm Work]]>><</link>>

	<</if>>
<<else>>
	You finish up, and clean the brush of hair.

	<<link [[Next|Farm Work]]>><</link>>

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

<<widget "farm_milk_actions">>
<<farm_milk_check>>
<<farm_gen cattle>>
<<set $outside to 0>>
<<if $farm_work.cattle_need gte 1>>
	$farm_work.cattle_need need milking.
<<else>>
	The cattle are satisfied.
<</if>>

<<if $hour is 21 and $farm_end is undefined>>
	<<set $farm_end to 1>>
	<<npc Alex>><<person1>>
	<<if $exposed gt 0 and $season is "winter">>
		Alex enters the barn, wiping the sweat off <<his>> forehead as <<he>> approaches you. "Done for another day," <<he>> says, blushing. "It's getting rather cold, you might want to wear something warmer." <<glust>><<npcincr Alex lust 1>>
	<<elseif $exposed gt 0>>
		Alex enters the barn, wiping the sweat off <<his>> forehead as <<he>> approaches you. "Done for another day," <<he>> says, blushing. "It'll be getting colder, you might want to wear a little more." <<glust>><<npcincr Alex lust 1>>
	<<else>>
		Alex enters the barn, wiping the sweat off <<his>> forehead as <<he>> approaches you. "Done for another day," <<he>> says, smiling.
	<</if>>
	<<if $farm_count gte 1 and $farm_stage lte 6>>
		<<set $money += $farm.wage>>
		"Here's a little extra." <<He>> hands you <<printmoney $farm.wage>>.
	<</if>>

	"I'll close up," <<he>> says as you walk outside. <<if $farm_stage lt 7>>"Have a safe journey."<</if>>

<<elseif $farm_work.cattle_need gte 1>>
	<<link [[Milk them with the machine (0:20)|Farm Cattle Milk Machine]]>><<pass 20>><<farm_count 20>><<tending 2>>
		<<if $farm_work.cattle_need gte 6>>
			<<set $farm_work.cattle_milked += 6>>
			<<set $cattle_milked += 6>>
		<<else>>
			<<set $farm_work.cattle_milked += $farm_work.cattle_need>>
			<<set $cattle_milked += $farm_work.cattle_need>>
		<</if>>
	<</link>><<gtending>>

	A <<farm_text cattle>> gives you a strained moo.

	<<link [[Milk by hand (Up to 0:30, depending on skill)|Farm Cattle Milk Hand]]>><<farm_yield 1>><<set $cattle_milked += 1>><<set $farm_work.cattle_milked += 1>><<tending 1>><<farm_cattle 1>><</link>><<deviant1>><<gfarm>><<gtending>><<grespect>>

	<<if $deviancy gte 55 and ($bestialitydisable is "f" or $farm_work.cattle.monster is true)>>
		<<link [[Milk with your mouth (0:03)|Farm Cattle Milk Mouth]]>><<set $cattle_milked += 1>><<set $farm_work.cattle_milked += 1>><<tending 1>><<farm_count 3>><</link>><<deviant4>><<gtending>>
		<<if $farm_work.cattle.genitals is "penis" and $player.virginity.oral is true>>
			| This action will take your oral virginity.
		<</if>>

	<</if>>

<<elseif $deviancy gte 15 and $farm.milking.dayMilking is true>>
	<<if $breastfeedingdisable is "f" and $milk_amount gte 1>>
		<<link [[Milk yourself (0:30)|Farm Barn Breasts]]>>
			<<if $cow gte 6>>
				<<transform cow 1>>
			<</if>>
		<</link>><<deviant2>>

	<</if>>
	<<if $player.penisExist and $semen_amount gte 1>>
		<<if $worn.genitals.type.includes("chastity")>>
			You could milk your penis, if the <<print $worn.genitals.name>> wasn't in the way.

		<<else>>
			<<link [[Milk your penis (0:30)|Farm Barn Penis]]>>
				<<if $cow gte 6>>
					<<transform cow 1>>
				<</if>>
			<</link>><<deviant2>>

		<</if>>
	<</if>>
<</if>>
<<if $hour is 21 and $farm_end is undefined>>
	<<link [[Next|Farmland]]>><<endevent>><</link>>
<<else>>
	<<link [[Leave|Farm Work]]>><<endevent>><</link>>
<</if>>

<</widget>>

<<widget "farm_count">>
<<if $args[0]>>
	<<set $farm_count += $args[0]>>
	<<set $farm_shift += $args[0]>>
	<<set $farm_work.recent_shift += $args[0]>>
<</if>>
<</widget>>

<<widget "farm_aggro">>
<<if $args[0]>>
	<<set _aggro_mod to 1>>
	<<if $args[0] gt 0>>
		<<if $farm.wall gte 1>>
			<<set _aggro_mod -= 0.05>>
		<</if>>
		<<if $farm.tower gte 2 and $farm.tower_guard>>
			<<set _aggro_mod -= 0.10>>
			<<set _aggro_mod -= (0.02 * ($farm.tower_guard_skill / 200))>>
		<<elseif $farm.tower gte 1 and $farm.tower_guard>>
			<<set _aggro_mod -= 0.05>>
			<<set _aggro_mod -= (0.02 * ($farm.tower_guard_skill / 200))>>
		<</if>>
		<<if $farm.kennel gte 1>>
			<<set _aggro_mod -= 0.10>>
		<</if>>
	<</if>>
	<<set $farm.aggro += ($args[0] * _aggro_mod)>>
	<<set $farm.aggro = Math.clamp($farm.aggro, 0, 100)>>
	<<set $farm.aggro = Math.trunc($farm.aggro)>>
<</if>>
<</widget>>

<<widget "farm_relax_end">>
<<farm_work_update>>
<<if $farm_work.alex_relax lt 3>>
	<<He>> looks at <<his>> watch, then reclines and pulls the brim of <<his>> hat over <<his>> face.

	<<link [[Relax (0:20)|Farm Rest]]>><<set $phase to 0>><<trauma -2>><<stress -2>><<npcincr Alex love 1>><<pass 20>><</link>><<glove>><<ltrauma>><<lstress>>

	<<link [[Leave|Farm Work]]>><<endevent>><<unset $farm_relax_drink>><</link>>

<<else>>
	<<He>> looks at <<his>> watch, and sighs. "I'd better get back to work," <<he>> says, rising to <<his>> feet. "Thanks for the company."

	<<link [[Next|Farm Work]]>><<endevent>><<unset $farm_relax_drink>><<set $farm_work.alex to "still">><</link>>

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

<<widget "eventsfarm">>
<<if $farm.build isnot undefined and $farm.build isnot 0 and $hour gte 6 and random(1, 3) gte 2>>
	<<if $exposed gte 2 and $uncomfortable.nude is true or $exposed is 1 and $uncomfortable.underwear is true>>
		You peek around a shed. The yard beyond looks clear. You take a deep breath, and run into the open.

		You don't think anyone is watching, but your heart thunders all the same. You're most of the way across when you hear voices approach from the side.<<gstress>><<stress 6>>

		You could retreat to the shed, but the cottage ahead is closer. There's a risk the door handle has jammed again. You could also run away from the voices. The path dips towards the road, and the terrain might hide you.

		<<link [[Run to the cottage|Farm Builders Exposed Cottage]]>><</link>>

		<<link [[Run to the shed|Farm Builders Exposed Shed]]>><</link>><<athleticsdifficulty 1 1100>>

		<<link [[Run to the road|Farm Builders Exposed Road]]>><</link>>

	<<else>>
		<<set $rng to random(1, 5)>>
		<<switch $rng>>
		<<case 1>>
			<<npc Alex>><<generate2>><<generate3>><<generate4>><<person2>>
			<<if $breastsize gte 3 and random(1, 2) is 2>>
				"Nice tits," says a <<personsimple>>'s voice.
			<<elseif $bottomsize gte 3 and random(1, 2) is 2>>
				"Nice ass," says a <<personsimple>>'s voice.
			<<else>>
				You hear a wolf whistle.
			<</if>>
			You turn and see the culprit, one of the builders, a <<person>>. <<He>> swaggers across the yard with <<his>> tools. Two of <<his>> friends flank <<him>>. <<He>> grins at you.

			<<person1>>
			<<link [[Ignore|Farm Work]]>><<stress 6>><<endevent>><</link>><<gstress>>

			<<link [[Strut|Farm Builders Strut]]>><</link>><<exhibitionist1>>

			<<link [[Get angry|Farm Builders Angry]]>><<def 1>><</link>>

			<<if $submissive lte 500>>
				<<link [[Threaten|Farm Builders Threaten]]>><<trauma -6>><<def 1>><</link>><<ltrauma>><<defianttext>>

			<</if>>
		<<case 2>>
			<<generate1>><<generate2>><<generate3>>
			A few builders, a <<person1>><<person>>, <<person2>><<person>>, and <<person3>><<person>>, sit
			<<if $weather is "snow">>
				on the cottage porch, taking shelter from the snow during their break.
			<<elseif $weather is "rain">>
				on the cottage porch, taking shelter from the rain during their break.
			<<else>>
				by the shed, sipping tea during their break.
			<</if>>

			They nod as you pass.

			<<link [[Encourage (0:15)|Farm Builders Encourage]]>><<pass 15>><</link>> | Low chance of speeding construction.

			<<link [[Just nod back|Farm Work]]>><<endevent>><</link>>

		<<case 3>>
			<<generate1>><<person1>>
			One of the builders, a <<person>>, calls to you. "Could you get us a cup of tea, love?"

			<<link [[Make tea (0:05)|Farm Builders Tea]]>><</link>>

			<<link [[Make tea and chat (0:20)|Farm Builders Tea Chat]]>><<pass 20>><</link>>

			<<link [[Get angry|Farm Builders Tea Angry]]>><<trauma -6>><</link>><<ltrauma>>

			<<link [[Ignore|Farm Work]]>><<endevent>><</link>>

		<<case 4>>
			<<generate1>><<generate2>><<generate3>><<person1>>
			The builders are hauling materials across the yard.

			<<link [[Help out (1:00)|Farm Builders Help]]>><<pass 60>><</link>><<physiquedifficulty 1 16000>> | Might speed construction if successful.

			<<link [[Ignore|Farm Work]]>><<endevent>><</link>>

		<<default>>
			<<generate1>><<person1>>
			<<if $worn.over_lower.name is "naked" and setup.clothes.lower[clothesIndex('lower', $worn.lower)].skirt is 1>>
				One of the builders, a <<person>>, flicks up your skirt as you pass.<<gstress>><<stress 6>>

				<<if $worn.under_lower.name is "naked">>
					"No <<panties>>," <<he>> says. "Naughty <<girl>>."<<gtrauma>><<gstress>><<trauma 6>><<stress 6>>
				<</if>>

				<<link [[Ignore|Farm Work]]>><<endevent>><<stress 6>><</link>><<gstress>>

				<<link [[Get angry|Farm Builders Skirt Angry]]>><<trauma -6>><<def 1>><</link>><<ltrauma>>

				<<if $worn.under_lower.name is "naked">>
					<<if $exhibitionism gte 55>>
						<<link [[Flaunt|Farm Builders Skirt Flaunt]]>><<set $phase to 1>><</link>><<exhibitionist4>>

					<</if>>
				<<else>>
					<<if $exhibitionism gte 15>>
						<<link [[Flaunt|Farm Builders Skirt Flaunt]]>><<set $phase to 0>><</link>><<exhibitionist2>>

					<</if>>
				<</if>>
			<<else>>
				One of the builders, a <<person>>, grabs your <<bottom>> as you pass.<<gstress>><<stress 6>><<gtrauma>><<trauma 6>>

				<<link [[Ignore|Farm Work]]>><<endevent>><<stress 6>><</link>><<gstress>>

				<<link [[Get angry|Farm Builders Skirt Angry]]>><<def 1>><<trauma -6>><</link>><<ltrauma>>

				<<link [[Flirt|Farm Builders Bottom Flirt]]>><</link>><<promiscuous1>>

			<</if>>
		<</switch>>
	<</if>>
<<else>>
	<<set $rng to random(1, 10)>>
	<<switch $rng>>
	<<case 1>>
		A screech tears through the air. It came from the moor, and it drives the animals into a panicked frenzy.<<llfarm>><<farm_yield -5>>

		Alex runs through the yard, rushing to calm the animals.
		<<set $farm_work.alex to "panic">>

		<<link [[Next|Farm Work]]>><</link>>

		<<set $farm_work.horses_panic to 1>>
		<<set $farm_work.chickens_panic to 1>>
		<<set $farm_work.pigs_panic to 1>>
		<<set $farm_work.dogs_panic to 1>>
		<<set $farm_work.cattle_panic to 1>>
	<<case 2>>
		<<npc Alex>><<person1>><<generate2>><<person2>>
		<<if $farm_work.horses_out lt 1 or $farm_work.horses_out gte 3>>
			Alex stands with a <<person2>><<person>>, watching the horses run in the field.
		<<else>>
			Alex stands with a <<person2>><<person>> beside the stable.
		<</if>>

		The <<person2>><<person>> looks at you. "This must be one of your farmhands," <<he>> says.

		<<person1>>
		<<if $farm_stage gte 7>>
			"The co-owner, actually." Alex replies. "We both get stuck in." <<He>> looks at you, and gestures at the <<person2>><<person>>
		<<else>>
			"That's right," Alex replies. <<He>> looks at you, and gestures at the <<person2>><<person>>.
		<</if>>
		"This is one of our clients. We look after <<his>> steed."

		<<if $farm_work.horse.monster is true>>
			<<if $farm_work.horse.gender is "f">>
				The steed in question is a centaur, who watches with arms folded beneath her breasts.
			<<else>>
				The steed in question is a centaur, who watches with his arms folded.
			<</if>>
			<<if $farm.beasts.horses gte 5>>
				<<farm_He horse>> turns to you, and nods in respect.
			<<elseif $farm.beasts.horses lte -5>>
				<<farm_He horse>> turns to you, and gives a derisive laugh.
			<</if>>
		<<else>>
			<<if $farm_work.horse.gender is "f">>
				The steed in question is a mare, who watches with a steady gaze.
			<<else>>
				The steed in question is a stallion, who watches with a steady gaze.
			<</if>>
			<<if $farm.beasts.horses gte 5>>
				<<farm_He horse>> turns to you, and gives a happy neigh.
			<<elseif $farm.beasts.horses lte -5>>
				<<farm_He horse>> turns to you, and gives a derisive snort.
			<</if>>
		<</if>>

		<<if $farm.beasts.horses gte 5>>
			"Looks like <<farm_he horse>> likes you," the <<person2>><<person>> says. "Keep up the good work."<<gfarm>><<farm_yield 1>>
		<<elseif $farm.beasts.horses lte -5>>
			"Not fond of you, is <<farm_he horse>>?" the <<person>> chuckles. "I guess it can't be helped."
		<<else>>
			"I like what I've seen," the <<person>> says. "Keep it up."
		<</if>>

		Alex shows the client to the edge of the farm.

		<<link [[Next|Farm Work]]>><<endevent>><</link>>

	<<case 3>>
		<<npc Alex>><<person1>>
		<<if $exposed gte 1>>
			"Hey," Alex says, blushing and walking up to you. "Need to get some groceries. Would you mind taking care of it?" <<He>> holds out a shopping list, along with some money and a towel. "You'll need t-to cover up if you're going outside. People will wonder what we're getting up to otherwise."

		<<else>>
			"Hey," Alex says, walking up to you. "Need to get some groceries. Would you mind taking care of it?" <<He>> holds out a shopping list, along with some money.

		<</if>>

		<<link [[Go shopping (0:30)|Farm Shopping]]>><<farm_count 30>><<pass 30>><<npcincr Alex love 1>><<towelup>><</link>><<glove>>

		<<link [[Refuse|Farm Shopping Refuse]]>><<npcincr Alex love -1>><<npcincr Alex dom -1>><</link>><<llove>><<ldom>>

	<<case 4>>
		<<npc Alex>><<person1>>
		"Race you to the woods!" Alex says, coming up behind you. <<He>> rushes past.

		<<link [[Race (0:02)|Farm Race]]>><<pass 2>><<farm_count 2>><</link>><<athleticsdifficulty 800 1000>><<glove>>

		<<link [[Just walk after Alex (0:05)|Farm Race Walk]]>><<pass 5>><<farm_count 5>><</link>>

		<<link [[Refuse|Farm Race Refuse]]>><<npcincr Alex love -1>><</link>><<llove>>

	<<case 5>>
		<<if $farm.aggro gte 10 and ($farm.wall is undefined or $farm.wall lt 3)>>
			<<generate1>><<generate2>><<person1>>
			<<if $farm.wall gte 3>>
				You hear a series of sharp, metallic thuds. You investigate the sound, and find a <<person>> and <<person2>><<person>> attacking the fence with axes.
			<<elseif $farm.wall gte 1>>
				You hear a series of thuds and cracks. You investigate the sound, and find a <<person>> and <<person2>><<person>> attacking the wall with axes.
			<<else>>
				You hear a series of thuds, and the creaking of wood. You investigate the sound, and find a <<person>> and <<person2>><<person>> attacking the fence with axes.
			<</if>>

			The <<person1>><<person>> nudges <<his>> colleague, and they both stare at you.

			<<link [[Call Alex|Farm Axe Alex]]>><<farm_aggro 5>><<npcincr Alex dom 1>><<npcincr Alex love 1>><<farm_fence_damage 1>><</link>><<gaggro>><<gdom "Alex">><<glove>>

			<<link [[Threaten|Farm Axe Threaten]]>><<def 1>><</link>><<englishdifficulty 400 1200>>

			<<link [[Fight|Farm Axe Attack]]>><<def 1>><</link>>

		<<else>>
			<<generate1>><<person1>>
			You see a figure stood on hill outside the farm. You can't tell at this distance, but it feels like <<hes>> staring right at you.
			<<if $farm_stage gte 5>>
				<<gaggro>><<farm_aggro 5>>
			<</if>>
			<<gstress>><<stress 6>>

			<<He>> turns and disappears over the crest.

			<<link [[Next|Farm Work]]>><<endevent>><</link>>

		<</if>>
	<<case 6>>
		<<if $farm.aggro gte 20>>
			<<set $rng to random(1, 5)>>
			<<switch $rng>>
			<<case 1>>
				You hear the <<farm_text_many horse>> neigh in terror. Something's spooked them.<<gaggro>><<farm_aggro 5>>

				<<set $farm_work.horses_panic to 1>>
				<<link [[Next|Farm Work]]>><</link>>

			<<case 2>>
				You hear the <<farm_text_many cattle>> moo in terror. Something's spooked them.<<gaggro>><<farm_aggro 5>>

				<<set $farm_work.cattle_panic to 1>>
				<<link [[Next|Farm Work]]>><</link>>

			<<case 3>>
				You hear the <<farm_text_many pig>> squeal in terror. Something's spooked them.<<gaggro>><<farm_aggro 5>>

				<<set $farm_work.pigs_panic to 1>>
				<<link [[Next|Farm Work]]>><</link>>

			<<case 4>>
				You hear the <<farm_text_many dog>> howl in terror. Something's spooked them.<<gaggro>><<farm_aggro 5>>

				<<set $farm_work.dogs_panic to 1>>
				<<link [[Next|Farm Work]]>><</link>>

			<<case 5>>
				You hear the chickens cluck in terror. Something's spooked them.<<gaggro>><<farm_aggro 5>>

				<<set $farm_work.chickens_panic to 1>>
				<<link [[Next|Farm Work]]>><</link>>

			<</switch>>
		<<else>>
			You hear angry barks. A pair of dogs are fighting.

			<<link [[Scold (0:10)|Farm Dogs Split]]>><<pass 10>><<farm_count 10>><</link>><<tendingdifficulty 1 800>>

			<<link [[Ignore|Farm Work]]>><<farm_yield -1>><</link>><<lfarm>>

		<</if>>
	<<case 7>>
		<<if $farm.aggro gte 100>>
			<<npc Alex>><<generate2>>
			You hear shouting from in front of the farm. You walk over, and see a lorry parked at the end of the lane connecting to the road. The driver lies on the ground outside, being kicked from all angles by three rough-looking goons.<<llfarm>><<farm_yield -3>>

			<<person1>>
			Alex arrives at your side. "Shit," <<he>> says. "You fuckers leave <<person2>><<him>> alone." They do so, but start walking toward Alex instead. They roll up their sleeves.

			Alex stands <<person1>><<his>> ground.

			<<link [[Pull Alex to safety (0:15)|Farm Lorry Safety]]>><<farm_yield -3>><<npcincr Alex love -1>><<npcincr Alex dom 1>><</link>><<llfarm>><<llove>><<ldom>>

			<<link [[Stand with Alex|Farm Lorry Stand]]>><<npcincr Alex love 3>><</link>><<gglove>>

		<<else>>
			<<generate1>><<person1>>
			A van pulls up outside the farm, and the driver waves at you.

			"Delivery for Alex," <<he>> says after stepping out. <<He>> throws open the back, and removes two unmarked brown boxes.

			<<He>> helps carry one up to the farmhouse, and leaves it on the porch. <<He>> holds out a notepad. "Sign here."

			<<He>> returns to <<his>> van.

			<<endevent>>
			<<set $skulduggerydifficulty to 400>>
			<<link [[Peek|Farm Lorry Peek]]>><</link>><<skulduggerydifficulty>>

			<<link [[Just take them inside|Farm Lorry Inside]]>><</link>>

		<</if>>
	<<case 8>>
		<<if $farm.aggro gte 40>>
			<<generate1>><<person1>>
			You hear rapid footsteps approach from behind. Before you can turn, a hand clasps against your mouth, and a tongue flicks against your cheek.

			<<link [[Next|Farm Rape]]>><<set $molestationstart to 1>><</link>>

		<<else>>
			<<npc Alex>><<generate2>><<person1>>
			"What's a cute <<nnpc_gendery "Alex">> like you doing working a farm?" You look around, and see a <<person2>><<person>> leaning over the fence and leering at Alex.

			<<set $rng to random(1, 5)>>
			<<switch $rng>>
			<<case 1>>
				Alex ignores the badgering.
			<<case 2>>
				Alex turns to <<him>>. <<person1>>"Fuck off," <<he>> says. "Or I'll use you as pig feed."
			<<case 3>>
				Alex turns to <<him>>. <<person1>>"I'm busy," <<he>> says. "You might have more luck in the kennel."
			<<case 4>>
				Alex turns to <<him>>. <<person1>>"There's a river nearby," <<he>> says. "Go cool yourself off."
			<<case 5>>
				Alex doesn't look at <<him>>. <<person1>>"I'm busy," <<he>> says. "So fuck off home."
			<</switch>>

			<<person2>>The <<person>> throws up <<his>> hands. "Alright, I'm going." <<He>> turns and walks away.

			<<link [[Next|Farm Work]]>><<endevent>><</link>>

		<</if>>
	<<case 9>>
		<<npc Alex>><<person1>>
		"Watch out!" Says Alex from above. You look up, just in time to see a hay bale bearing down on you.

		<<if $physique gte 12000>>
			You raise your arms to catch it, and ease it to the ground.

			"Nice catch," Alex says, dropping to the earth beside you. <<He>> hefts the bale onto <<his>> shoulder. "Gotta get them in storage to keep the weather off." <<He>> walks away.

			<<link [[Next|Farm Work]]>><<endevent>><</link>>

		<<elseif $danceskill gte 800>>
			You step aside, and the bale lands beside you.

			"Nice dodge," Alex says, dropping to the earth. <<He>> hefts the bale onto <<his>> shoulder. "Gotta get them in storage to keep the weather off." <<He>> walks away.

			<<link [[Next|Farm Work]]>><<endevent>><</link>>

		<<else>>
			You raise your hands to catch it, but it's too heavy. You're left flat on your back.<<gpain>><<gstress>><<pain 4>><<stress 6>>

			Alex laughs, and drops to the earth beside you. "Sorry, I couldn't resist." <<He>> hefts the bale onto <<his>> shoulder, freeing you.<<gdom>><<npcincr Alex dom 1>>

			<<link [[Laugh it off|Farm Bale Laugh]]>><<npcincr Alex love 1>><<stress -6>><</link>><<glove>><<lstress>>

			<<link [[Get angry|Farm Bale Angry]]>><<npcincr Alex dom -1>><<npcincr Alex love -1>><</link>><<llove>><<ldom>>

		<</if>>
	<<case 10>>
		<<npc Alex>><<person1>>
		<<if $exposed gte 1>>
			You catch Alex ogling you from a distance, though <<he>> pretends otherwise.<<glust>><<npcincr Alex lust 1>>

			<<link [[Next|Farm Work]]>><<endevent>><</link>>

		<<else>>
			Alex pats your shoulder as <<he>> passes by.

			<<link [[Next|Farm Work]]>><<endevent>><</link>>

		<</if>>
	<</switch>>
<</if>>
<</widget>>

<<widget "alex_clamp">>
<<set $NPCName[$NPCNameList.indexOf("Alex")].love = Math.clamp($NPCName[$NPCNameList.indexOf("Alex")].love, -50, 100)>>
<<set $NPCName[$NPCNameList.indexOf("Alex")].dom = Math.clamp($NPCName[$NPCNameList.indexOf("Alex")].dom, -50, 100)>>
<<set $NPCName[$NPCNameList.indexOf("Alex")].lust = Math.clamp($NPCName[$NPCNameList.indexOf("Alex")].lust, 0, 100)>>
<</widget>>

<<widget "farm_forest_event">>
<<if $NPCName[$NPCNameList.indexOf("Alex")].dom gte 10>>
	<<He>> rushes to place <<himself>> between you and the source of the noise.
<<else>>
	<<He>> rushes to your side.
<</if>>

<<if $rng gte 71>>
	"Whatever it is," Alex whispers. "It's harmless. Probably." The bush rustles, and a snout pokes out, followed by a large body. It's a boar.

	"Shit," Alex says. "We gotta go. Now."

	The boar rushes toward you!<<ggstress>><<stress 12>>

	<<link [[Stand your ground|Farm Race Stand]]>><</link>>

	<<link [[Run|Farm Race Run]]>><</link>><<athleticsdifficulty 800 1000>>

<<else>>
	<<fox_gen>>
	"Whatever it is," Alex whispers. "It's harmless. Probably." The bush rustles, and a <<fox_text>> runs out. <<fox_He>> darts across the leaf-strewn earth, and disappears beneath a mound of earth.

	<<unset $fox>>
	Alex sighs. "Just a fox. Were you scared?"

	<<link [[Yes|Farm Race Yes]]>><<npcincr Alex dom 1>><</link>><<gdom>>

	<<link [[No|Farm Race No]]>><</link>>

	<<link [[Not as scared as you|Farm Race Comeback]]>><<npcincr Alex dom -1>><</link>><<ldom>>

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

<<widget "farm_knotted">>
<<if $phase is 0>>
	<<npc Alex>><<person1>><<generate2>>
	<<earnFeat "A Knot to Remember">>
	"This is our stable." It's Alex. The <<farm_text dog>>'s ears spring up and it lurches forward, <<farm_his dog>> knot still inside you.

	You're pulled across the field, backwards and on all fours. You try to wiggle free, but the knot has yet to shrink at all. It's in too tight.

	"I'm impressed," says an unknown <<person2>><<personsimple>>'s voice.

	"Thanks," replies Alex. "We've yet to dissatisfy a customer."

	Their voices get closer as you near the edge of the field. You'll be seen if you don't act soon.<<ggstress>><<stress 12>>

<<elseif $phase is 1>>

	You hear Alex and the <<personsimple>> chatting as you approach the gate. You'll be seen if you don't act fast.<<ggstress>><<stress 12>>

<<elseif $phase is 2>>

	You hear Alex and the <<personsimple>> discussing payment as you arrive at the gate. You'll be seen if you don't act now.<<ggstress>><<stress 12>>

<<else>>

	You're pulled from the field, onto the road leading to the stable.

<</if>>

<<if $phase lte 2>>
	<<link [[Hold a tuft of grass|Farm Knotted Hold]]>><</link>><<physiquedifficulty 2000 30000>>

	<<link [[Scold|Farm Knotted Scold]]>><</link>><<tendingdifficulty 100 1500>>

	<<if $deviancy gte 75>>
		<<link [[Flaunt|Farm Knotted Deviant]]>><<stress 12>><<trauma 12>><<famebestiality 10 vid>><<farm_yield 10>><<npcincr Alex love -3>><<npcincr Alex dom 5>><<npcincr Alex lust 5>><</link>><<deviant5>><<lllove>><<gggdom>><<gglust>><<gggfarm>>

	<<else>>
		<<link [[Let it happen|Farm Knotted Seen]]>><<stress 12>><<trauma 12>><<famebestiality 10 vid>><<farm_yield 10>><<npcincr Alex love -3>><<npcincr Alex dom 5>><<npcincr Alex lust 5>><</link>><<ggtrauma>><<ggstress>><<lllove>><<gggdom>><<gglust>><<gggfarm>>

	<</if>>
<<else>>
	<<link [[Next|Farm Knotted Seen]]>><<set $phase to 5>><<stress 12>><<trauma 12>><<famebestiality 10 vid>><<farm_yield 10>><<npcincr Alex love -3>><<npcincr Alex dom 5>><<npcincr Alex lust 5>><</link>>

<</if>>
<<set $phase += 1>>
<</widget>>

<<widget "farm_tending_events">>
<<set $rng to random(1, 3)>>
<<if $rng is 3>>
	<<if $bestialitydisable is "f" and $lurkerdisable is "f" and random(1, 2) is 2>>
		You're digging in the earth when you see something dark move in your peripheral, low to the ground. It's gone by the time you look over.

		<<link [[Keep working|Farm Tending Lurker Work]]>><</link>>

		<<if $hour lt 21 or $hour gt 4>>
			<<link [[Call for Alex (0:05)|Farm Tending Lurker Alex]]>><<npcincr Alex dom 1>><<farm_count 5>><<pass 5>><</link>><<gdom "Alex">>
		<<else>>
			<<link [[Call for Alex (0:05)|Farm Tending Lurker Alex Fail]]>><<farm_count 5>><<pass 5>><</link>><<gdom "Alex">>
		<</if>>

	<<else>>
		You're digging in the earth when you see something dark move in your peripheral, low to the ground. It leaps at you before you can look. You tumble backward.<<gtrauma>><<gstress>><<gpain>><<trauma 6>><<stress 6>><<pain 4>>

		It vanishes as fast as it appeared, darting over you and into the plants opposite.

		<<destination_farm>>
	<</if>>
<<elseif $rng is 2>>
	<<if $tentacledisable is "f" and random(1, 2) is 2 and ($hallucinations gte 2 or $backgroundTraits.includes("plantlover"))>>
		Something twists around your ankle, making you fall. You land on a pile of <<if $weather is "rain" or $weather is "snow">>mud<<else>>dirt<</if>>. You look behind, and see a thick shoot wrapping around your leg. Another emerges from the hedge, and grasps your other ankle.<<gpain>><<gstress>><<pain 4>><<stress 6>>

		They try to pull you into the undergrowth.

		<<link [[Soothe|Farm Tending Soothe]]>><</link>><<tendingdifficulty 1 1200>>

		<<link [[Struggle|Farm Tending Tentacle Struggle]]>><</link>><<physiquedifficulty 1 24000>>

		<<if $hour lt 21 or $hour gt 4>>
			<<link [[Scream|Farm Tending Scream]]>><<npcincr Alex dom 3>><><</link>><<ggdom "Alex">>
		<<else>>
			<<link [[Scream|Farm Tending Scream Fail]]>><><</link>><<ggdom "Alex">>
		<</if>>

		<<link [[Brace yourself|Farm Tending Brace]]>><</link>>

	<<else>>
		Your foot catches on something, and you land on a pile of <<if $weather is "rain" or $weather is "snow">>mud<<else>>dirt<</if>>. You look back, but can't see what tripped you.<<gpain>><<gstress>><<pain 4>><<stress 6>>

		<<destination_farm>>

	<</if>>
<<else>>
	<<if $farm_stage gte 5 and $farm.aggro gte 10 and random(1, 2) is 2>>
		<<if $farm.wall gte 4>>
			<<generate1>><<generate2>><<generate3>><<person1>>
			"Hey <<girl>>," says a voice. You look up, and see a <<person>> leering at you across the fence. A <<person2>><<person>> and <<person3>><<person>> flank <<person1>><<him>>. They stare at the barbed wire above.

			"Nice set up you got," <<he>> continues. "Don't think a little metal will keep you safe."

			<<link [[Taunt|Farm Tending Barb Taunt]]>><<def 1>><<trauma -6>><</link>><<ltrauma>>

			<<link [[Ignore|Farm Tending Barb Ignore]]>><</link>>

			<<if $exhibitionism gte 2>>
				<<link [[Flaunt|Farm Tending Barb Flaunt]]>><</link>><<exhibitionist2>>
			<</if>>
		<<elseif $farm.wall gte 3 and random(1, 2) is 2>>
			<<generate1>><<generate2>><<generate3>><<person1>>
			"Hey <<girl>>," says a voice. You look up, and see a <<person>> leering at you across the fence. A <<person2>><<person>> and <<person3>><<person>> flank <<person1>><<him>>. They try to climb the fence, but only make it half way up before sliding down.

			"Nice set up you got," <<he>> continues. "Don't think a little metal will keep you safe."

			<<link [[Taunt|Farm Tending Barb Taunt]]>><<def 1>><<trauma -6>><</link>><<ltrauma>>

			<<link [[Ignore|Farm Tending Barb Ignore]]>><</link>>

			<<if $exhibitionism gte 2>>
				<<link [[Flaunt|Farm Tending Barb Flaunt]]>><</link>><<exhibitionist2>>
			<</if>>
		<<else>>
			<<generate1>><<generate2>><<generate3>><<person1>>
			"Hey <<girl>>," says a voice. You look up, and see a <<person>> leering at you across the fence. "What's a cute<<if pregnancyBellyVisible()>> pregnant<</if>> <<girl>> like you doing working the fields?"

			<<if $skulduggery gte random(500, 700)>>
				You shiver. Something's wrong. This isn't your usual pervert. You glance around, and spot them. A <<person2>><<person>> and <<person3>><<person>> creep through the crops, trying to sneak up on you.

				<<if $hour lt 21 or $hour gt 4>>
					<<link [[Scream|Farm Tending Group Alex]]>><><<npcincr Alex dom 1>><</link>><<gdom "Alex">>
				<<else>>
					<<link [[Scream|Farm Tending Group Alex Fail]]>><><</link>><<gdom "Alex">>
				<</if>>

				<<link [[Seize the initiative|Farm Tending Group Fight]]>><<def 1>>/*<<farm_aggro -5>>*/<</link>>/*<<laggro>>*/

			<<else>>
				You hear movement to the side. You turn, and see a <<person2>><<person>> rush toward you. Before you can respond, a hand clamps over your mouth from behind.

				The <<person1>><<person>> climbs over the fence, and walks closer. "Not gonna lie," <<he>> says. "I enjoy my work."

				<<link [[Next|Farm Tending Gang Rape]]>><<set $molestationstart to 1>><</link>>

			<</if>>
		<</if>>
	<<else>>
		<<generate1>><<person1>>
		"Hey <<girl>>," says a voice. You look up, and see a <<person>> leering at you
		<<if $farm.wall gte 3>>
			through the fence.
		<<elseif $farm.wall gte 1>>
			across the wall.
		<<else>>
			across the fence.
		<</if>>

		"What's a cute<<if pregnancyBellyVisible()>> pregnant<</if>> <<girl>> like you doing working the fields?"

		<<link [[Ignore|Farm Tending Ignore]]>><<set $phase to 0>><</link>>

		<<link [[Respond politely|Farm Tending Polite]]>><</link>>

		<<link [[Flirt|Farm Tending Flirt]]>><</link>><<promiscuous1>>

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

<<widget "farm_tending_alex_events">>
<<set $rng to random(1, 4)>>
<<if $rng is 4>>
	<<npc Alex>><<person1>>
	You hear Alex shout in surprise. You rush over, and find <<him>> lying on <<his>> back.

	"Blighter startled me," <<he>> says.

	<<link [[Offer your arm|Farm Tending Alex Arm]]>><<npcincr Alex love 1>><<npcincr Alex dom -1>><</link>><<ldom>><<glove>>

	<<link [[Get back to work|Farm Tending Alex Back]]>><</link>>

<<elseif $rng is 3>>
	<<npc Alex>><<person1>>
	<<if $NPCName[$NPCNameList.indexOf("Alex")].lust gte 10 and random(1, 2) is 2>>
		You catch Alex sneaking glances at you when <<he>> thinks you're not looking.

		<<link [[Flirt|Farm Tending Alex Flirt]]>><</link>><<promiscuous1>>

		<<link [[Ignore|Farm Tending Alex Ignore]]>><</link>>

	<<elseif $exposed gte 1>>
		You catch Alex sneaking glances at you when <<he>> thinks you're not looking.<<garousal>><<arousal 600>>

		<<link [[Ignore|Farm Tending Alex Ignore]]>><<npcincr Alex lust 1>><</link>><<glust>>

		<<link [[Tease|Farm Tending Alex Tease]]>><<npcincr Alex lust 1>><<arousal 1800>><<trauma -6>><<npcincr Alex dom 1>><</link>><<glust>><<ldom>><<ggarousal>><<ltrauma>>

	<<else>>
		Alex waves at you from across the field. You wave back.<<lstress>><<stress -6>>

		<<destination_farm>>

	<</if>>
<<elseif $rng is 2>>
	You work beside Alex, chatting all the while.<<ltrauma>><<lstress>><<trauma -6>><<stress -6>>

	<<destination_farm>>

<<else>>
	<<npc Alex>><<person1>>
	You chat with Alex as you work. <<Hes>> keen to share <<his>> farming techniques.

	<<if $tending lt 1000>>
		<<link [[Listen (0:10)|Farm Tending Alex Listen]]>><<farm_count 10>><<tending 6>><<pass 10>><<npcincr Alex dom 1>><</link>><<gdom>><<gtending>>

	<<else>>
		<<link [[Teach Alex instead (0:10)|Farm Tending Alex Teach]]>><<pass 10>><<farm_count 10>><<npcincr Alex love 1>><<npcincr Alex dom -1>><</link>><<ldom>><<glove>>

	<</if>>
	<<link [[Focus on working|Farm Tending Alex Focus]]>><</link>>

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

<<widget "barn_img">>
<<machine_init>>
<<if $args[0] is "penis">>
	<<if $args[1] is "livestock">>
		<<set _barn_semen to $livestock_semen>>
	<<elseif $args[1] is "half_livestock">>
		<<set _barn_semen to ($livestock_semen / 2)>>
	<<elseif $args[1] is "no_livestock">>
		<<set _barn_semen to 0>>
	<<else>>
		<<set _barn_semen to $semen_amount>>
	<</if>>
	<<if _barn_semen gte 3000>>
		<<set _semen_img to "semen_7">>
	<<elseif _barn_semen gte 2000>>
		<<set _semen_img to "semen_6">>
	<<elseif _barn_semen gte 1500>>
		<<set _semen_img to "semen_5">>
	<<elseif _barn_semen gte 1000>>
		<<set _semen_img to "semen_4">>
	<<elseif _barn_semen gte 500>>
		<<set _semen_img to "semen_3">>
	<<elseif _barn_semen gte 200>>
		<<set _semen_img to "semen_2">>
	<<else>>
		<<set _semen_img to "semen_1">>
	<</if>>
	<<prop haybale semen penis_pump>>
<<elseif $args[0] is "breasts">>
	<<if $args[1] is "livestock">>
		<<set _barn_milk to $livestock_milk>>
	<<elseif $args[1] is "half_livestock">>
		<<set _barn_milk to ($livestock_milk / 2)>>
	<<elseif $args[1] is "no_livestock">>
		<<set _barn_milk to 0>>
	<<else>>
		<<set _barn_milk to $milk_amount>>
	<</if>>
	<<if _barn_milk gte 3000>>
		<<set _milk_img to "milk_7">>
	<<elseif _barn_milk gte 2000>>
		<<set _milk_img to "milk_6">>
	<<elseif _barn_milk gte 1500>>
		<<set _milk_img to "milk_5">>
	<<elseif _barn_milk gte 1000>>
		<<set _milk_img to "milk_4">>
	<<elseif _barn_milk gte 500>>
		<<set _milk_img to "milk_3">>
	<<elseif _barn_milk gte 200>>
		<<set _milk_img to "milk_2">>
	<<else>>
		<<set _milk_img to "milk_1">>
	<</if>>
	<<prop haybale milk breast_pump>>
<<else>>
	<<if $args[1] is "livestock">>
		<<set _barn_semen to $livestock_semen>>
		<<set _barn_milk to $livestock_milk>>
	<<elseif $args[1] is "half_livestock">>
		<<set _barn_semen to ($livestock_semen / 2)>>
		<<set _barn_milk to ($livestock_milk / 2)>>
	<<elseif $args[1] is "no_livestock">>
		<<set _barn_semen to 0>>
		<<set _barn_milk to 0>>
	<<else>>
		<<set _barn_semen to $semen_amount>>
		<<set _barn_milk to $milk_amount>>
	<</if>>
	<<if _barn_semen gte 3000>>
		<<set _semen_img to "semen_7">>
	<<elseif _barn_semen gte 2000>>
		<<set _semen_img to "semen_6">>
	<<elseif _barn_semen gte 1500>>
		<<set _semen_img to "semen_5">>
	<<elseif _barn_semen gte 1000>>
		<<set _semen_img to "semen_4">>
	<<elseif _barn_semen gte 500>>
		<<set _semen_img to "semen_3">>
	<<elseif _barn_semen gte 200>>
		<<set _semen_img to "semen_2">>
	<<else>>
		<<set _semen_img to "semen_1">>
	<</if>>
	<<if _barn_milk gte 3000>>
		<<set _milk_img to "milk_7">>
	<<elseif _barn_milk gte 2000>>
		<<set _milk_img to "milk_6">>
	<<elseif _barn_milk gte 1500>>
		<<set _milk_img to "milk_5">>
	<<elseif _barn_milk gte 1000>>
		<<set _milk_img to "milk_4">>
	<<elseif _barn_milk gte 500>>
		<<set _milk_img to "milk_3">>
	<<elseif _barn_milk gte 200>>
		<<set _milk_img to "milk_2">>
	<<else>>
		<<set _milk_img to "milk_1">>
	<</if>>
	<<prop haybale semen penis_pump milk breast_pump>>
<</if>>
<<if $images is 1>>

	<<timed 100ms>>
	<<combatimg>>

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

<</widget>>

<<widget "farmCatchChance">>
<<if $args[0] gt 0 or $args[0] lt 0>>
	<<set $farm.milking.catchChance to Math.clamp(parseFloat($farm.milking.catchChance) + parseFloat($args[0]),0,100).toFixed(3)>>
<</if>>
<</widget>>

<<widget "farm_fight_init">>
<<set $farm_fight to {}>>
<<set $farm_fight.action to "rest">>
<<set $farm_fight.stage to 0>>
<<set $farm_fight.distraction to 0>>
<<set $farm_fight.door to 14>>
<<set $farm_fight.screws to 10>>
<</widget>>

<<widget "farm_fight_end">>
<<unset $farm_fight>>
<</widget>>

<<widget "farm_fight_alex">>
<<person1>>
<<if $farm_fight.distraction is 2>>
	<<set $farm_fight.distraction -= 1>>
	<<He>> weaves between the thugs surrouding <<him>>, jabbing them whenever they get close.
<<elseif $farm_fight.distraction is 1>>
	<<set $farm_fight.distraction -= 1>>
	Alex dodges a lunch from the <<person2>><<person>> to <<person1>><<his>> left,
	<<if $farm_fight.stage gte 5>>
		but the <<person6>><<person>> rushes <<person1>><<him>> from behind, grasping <<his>> arms once more.
	<<else>>
		<<if $farm_fight.stage gte 5>>
			but the <<person6>><<person>> follows it up, and grasps <<person1>><<him>> from behind. The thugs close in.
		<<else>>
			but the <<person3>><<person>> follows it up, and knocks <<person1>><<him>> off-balance. The thugs close in.
		<</if>>
	<</if>>
<<else>>

	<<switch $farm_fight.stage>>
	<<case 0>>
		Alex kicks the <<person3>><<person>> grasping <<person1>><<him>>, and manages to struggle free.
	<<case 1>>
		Alex ducks under a swing from a <<person4>><<person>>.
	<<case 2>>
		A <<person5>><<person>> grasps Alex's arm, but <<person1>><<he>> manages to wrest it free.
	<<case 3>>
		A <<person6>><<person>> swings <<his>> fist at Alex, but the young farmer ducks at the last moment.
	<<case 4>>
		The thugs keep Alex penned between them. They're hesitant to approach, but Alex is tiring.
	<<case 5>>
		The <<person5>><<person>> makes another attempt to grapple Alex, and the <<person6>><<person>> backs <<person5>><<him>> up. Alex dodges the former, but the latter grasps <<person1>><<his>> arms from behind.<<npcincr Alex dom -1>><<ldom>>
	<<case 6>>
		Alex struggles against the <<person6>><<persons>> grasp.
	<<case 7>>
		The <<person2>><<person>> approaches the struggling Alex from the front. Alex manages to keep <<him>> at bay with <<his>> feet, but the <<person6>><<person>> forces <<person1>><<him>> to <<his>> knees.<<npcincr Alex dom -3>><<lldom>>
	<<case 8>>
		The <<person4>><<person>> and <<person5>><<person>> kick at the kneeling Alex while <<person1>><<his>> arms are held from behind. <<He>> endures them with a grimace.
	<<case 9>>
		Alex can endure no more. <<He>> falls to the ground and curls up.<<npcincr Alex dom -9>><<llldom>>
	<<default>>
		Alex remains curled up on the ground, kicked and pummelled from all angles.
	<</switch>>
	<<set $farm_fight.stage += 1>>
<</if>>
<</widget>>

<<widget "farm_fight_door">>
<<if $farm_fight.door gte 14>>
	The door is solid.
<<elseif $farm_fight.door gte 11>>
	Thin cracks have appeared in the door.
<<elseif $farm_fight.door gte 8>>
	The cracks in the door have widened.
<<elseif $farm_fight.door gte 5>>
	A draft penetrates the thick cracks in the door.
<<elseif $farm_fight.door gte 2>>
	The cracks in the door are almost wide enough to fit an arm through.
<<else>>
	The door is a mess of splinters. It won't withstand much more.
<</if>>
<<if $farm_fight.screws gte 10>>
	All the door's screws are intact.
<<elseif $farm_fight.screws gte 8>>
	Most of the door's screws are intact.
<<elseif $farm_fight.screws gte 6>>
	Many of the door's screws have been removed, but it's still sturdy.
<<elseif $farm_fight.screws gte 4>>
	Many of the door's screws have been removed. It rattles in the wind.
<<elseif $farm_fight.screws gte 2>>
	Most of the door's screws have been removed.
<<else>>
	Only one screw keeps the door in place.
<</if>>
<</widget>>

<<widget "farm_fight_options">>
<<link [[Bash the door|Farm Fight]]>><<set $farm_fight.action to "bash">><</link>><<physiquedifficulty 10000 20000>>

<<if $farm_fight.toolbox is 1>>
	<<link [[Bash the door with the hammer|Farm Fight]]>><<set $farm_fight.action to "hammer">><</link>><<physiquedifficulty 5000 15000>>

	<<link [[Unscrew the door|Farm Fight]]>><<set $farm_fight.action to "unscrew">><</link>>

<</if>>
<<if $farm_fight.sheet is 1>>
	<<if $farm_fight.chainsaw is 2>>
		<<link [[Chainsaw the door|Farm Fight]]>><<set $farm_fight.action to "chainsaw">><</link>>

	<<elseif $farm_fight.chainsaw is 1>>
		<<if $farm_fight.cupboard is 1>>
			<<link [[Refuel the chainsaw|Farm Fight]]>><<set $farm_fight.action to "refuel">><</link>>

		<</if>>
	<<elseif $farm_fight.chainsaw is undefined>>
		<<link [[Work out how to switch the chainsaw on|Farm Fight]]>><<set $farm_fight.action to "science">><</link>><<skill_difficulty science "Science" 1 700>>

	<</if>>
<</if>>
<<if $farm_fight.shelf is undefined or $farm_fight.toolbox is undefined or $farm_fight.cupboard is undefined or $farm_fight.rakes is undefined or $farm_fight.sheet is undefined>>
	<<link [[Search the shed|Farm Fight Search]]>><<set $farm_fight.action to 0>><</link>>

<</if>>
<<if $farm_fight.stage gte 2 and $farm_fight.distraction lte 0>>
	<<if $farm_fight.breasts isnot 1>>
		<<if $player.gender is "f" or $player.gender_appearance is "f">>
			<<if $exhibitionism gte 55>>
				<<link [[Expose your chest through the window|Farm Fight]]>><<set $farm_fight.action to "breasts">><<set $farm_fight.breasts to 1>><</link>><<exhibitionist4>>

			<</if>>
		<<else>>
			<<link [[Expose your chest through the window|Farm Fight]]>><<set $farm_fight.action to "chest">><<set $farm_fight.breasts to 1>><</link>><<exhibitionist1>>

		<</if>>
	<</if>>
	<<if $farm_fight.bottom isnot 1>>
		<<if $exhibitionism gte 35>>
			<<link [[Expose your ass through the window|Farm Fight]]>><<set $farm_fight.action to "bottom">><<set $farm_fight.bottom to 1>><</link>><<exhibitionist3>>

		<</if>>
	<</if>>
	<<if $farm_fight.genitals isnot 1>>
		<<if $exhibitionism gte 75>>
			<<if $player.penisExist and $player.vaginaExist>>
				<<link [[Expose your genitals through the window|Farm Fight]]>><<set $farm_fight.action to "penis">><<set $farm_fight.genitals to 1>><</link>><<exhibitionist5>>

			<<elseif $player.penisExist>>
				<<link [[Expose your penis through the window|Farm Fight]]>><<set $farm_fight.action to "penis">><<set $farm_fight.genitals to 1>><</link>><<exhibitionist5>>

			<<else>>
				<<link [[Expose your pussy through the window|Farm Fight]]>><<set $farm_fight.action to "vagina">><<set $farm_fight.genitals to 1>><</link>><<exhibitionist5>>

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

<<widget "farm_sleep_options">>
<<if $sleeptrouble is 1 and $controlled is 0>>
	<<link [[Sleep for 10 hours|Farm Sleep]]>><<set $sleephour to 10>><<set $saveDetails.auto.count++>><</link>> (<<timeAfterXHours 10>>)<<ltiredness>>

	<<link [[Sleep for 9 hours|Farm Sleep]]>><<set $sleephour to 9>><<set $saveDetails.auto.count++>><</link>> (<<timeAfterXHours 9>>)<<ltiredness>>

<</if>>
<<link [[Sleep for 8 hours|Farm Sleep]]>><<set $sleephour to 8>><<set $saveDetails.auto.count++>><</link>> (<<timeAfterXHours 8>>)<<ltiredness>>

<<link [[Sleep for 7 hours|Farm Sleep]]>><<set $sleephour to 7>><<set $saveDetails.auto.count++>><</link>> (<<timeAfterXHours 7>>)<<ltiredness>>

<<link [[Sleep for 6 hours|Farm Sleep]]>><<set $sleephour to 6>><<set $saveDetails.auto.count++>><</link>> (<<timeAfterXHours 6>>)<<ltiredness>>

<<link [[Sleep for 5 hours|Farm Sleep]]>><<set $sleephour to 5>><<set $saveDetails.auto.count++>><</link>> (<<timeAfterXHours 5>>)<<ltiredness>>

<<link [[Sleep for 4 hours|Farm Sleep]]>><<set $sleephour to 4>><<set $saveDetails.auto.count++>><</link>> (<<timeAfterXHours 4>>)<<ltiredness>>

<<link [[Sleep for 3 hours|Farm Sleep]]>><<set $sleephour to 3>><<set $saveDetails.auto.count++>><</link>> (<<timeAfterXHours 3>>)<<ltiredness>>

<<link [[Sleep for 2 hours|Farm Sleep]]>><<set $sleephour to 2>><<set $saveDetails.auto.count++>><</link>> (<<timeAfterXHours 2>>)<<ltiredness>>

<<link [[Sleep for 1 hour|Farm Sleep]]>><<set $sleephour to 1>><<set $saveDetails.auto.count++>><</link>>  (<<timeAfterXHours 1>>)<<ltiredness>>

<<link [[Just sleep|Farm Sleep]]>><<set $sleephour to -1>><<set $saveDetails.auto.count++>><</link>> (??:??)<<ltiredness>>

<<if $bus is "farm_alex_room">>
	<<link [[Climb out of bed|Farm Alex Bedroom]]>>
		<<storeon "farm alex bed" "check">>
		<<if _store_check is 1>>
			<<storeon "farm alex bed">>
			<<set $wardrobe_location to "alexFarm">>
			<<wardrobeSelection true>>
		<</if>>
	<</link>>

<<else>>
	<<link [[Climb out of bed|Farm Bedroom]]>><<storeon "Farm Bed">><<set $wardrobe_location to "alexFarm">><<wardrobeSelection>><</link>>
<</if>>

<</widget>>

<<widget "farm_cottage_options">>
<<link [[Your room (0:01)|Farm Bedroom]]>><<pass 1>><</link>>

<<link [[Alex's room (0:01)|Farm Alex Bedroom]]>><<pass 1>><</link>>

<<if $farm.stock>>
	<<link [[Check stock|Farm Stock]]>><</link>>

<</if>>

<<link [[Go outside (0:01)|Farm Work]]>><<pass 1>><</link>>

<</widget>>

<<widget "farm_cottage_tv_options">>

<</widget>>

<<widget "destination_farm">>
<<if $bus is "farm_fields">>
	<<link [[Next|Farm Fields]]>><<endevent>><<set $eventskip to 1>><</link>>

<<else>>
	<<link [[Next|Farm Work]]>><<endevent>><</link>>

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

<<widget "cottage_bailey_options">>
<<if $money gte $rentmoney>>
	<<link [[Pay up|Farm Cottage Bailey Pay]]>><</link>>

	<<link [[Refuse|Farm Cottage Bailey Refuse]]>><<def 1>><</link>>

<<else>>
	<<if $submissive gte 1150>>
		"I-I don't have the money," you tell Bailey. "Please don't hurt Alex."
	<<elseif $submissive lte 850>>
		"I don't have it," you tell Bailey. "And wouldn't give you a penny if I did."
	<<else>>
		"I don't have it," you tell Bailey. "You're wasting your time."
	<</if>>

	Alex rests a hand on your shoulder. "We won't be blackmailed," <<he>> says, glaring at the intruder. "Get the fuck off
	<<if $NPCName[$NPCNameList.indexOf("Alex")].dom gte 20>>
		my
	<<else>>
		our
	<</if>>	property."

	"Fine," Bailey says. "My friends will be glad of it." <<nnpc_He Bailey>> turns and walks away.

	<<if $bailey_encroach gte 1>>
		Bailey will throw more support behind Remy, making encroachment rise faster still. <<nnpc_He Bailey>> will send reinforcements during Remy's assaults.
	<<else>>
		Bailey will support Remy's attacks on the farm, making encroachment rise faster. <<nnpc_He Bailey>> will send reinforcements during Remy's assaults.
	<</if>>

	<<link [[Next|Farm Cottage Bailey Refuse 2]]>><</link>>

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

<<widget "farm_build_day">>
<<if $farm_stage gte 7>>
	<<if $farm.build_timer gte 1>>
		<<set $farm.build_timer -= 1>>
	<</if>>
	<<if $farm.build_timer lte 0>>
		<<switch $farm.build>>
		<<case "wall 1">>
			<<set $farm.wall to 1>>
		<<case "wall 2">>
			<<set $farm.wall to 2>>
		<<case "wall 3">>
			<<set $farm.wall to 3>>
		<<case "wall 4">>
			<<set $farm.wall to 4>>
		<<case "tower 1">>
			<<set $farm.tower to 1>>
		<<case "tower 2">>
			<<set $farm.tower to 2>>
		<<case "woodland 1">>
			<<set $farm.woodland to 1>>
		<<case "woodland 2">>
			<<set $farm.woodland to 2>>
		<<case "woodland 3">>
			<<set $farm.woodland to 3>>
		<<case "kennel 1">>
			<<set $farm.kennel to 1>>
		<<case "barn 1">>
			<<set $farm.barn to 1>>
		<<case "barn 2">>
			<<set $farm.barn to 2>>
		<<case "stable 1">>
			<<set $farm.stable to 1>>
		<<case "coop 1">>
			<<set $farm.coop to 1>>
		<<case "coop 2">>
			<<set $farm.coop to 2>>
		<<case "parasites 1">>
			<<set $farm.parasitebarn to 1>>
		<<case "parasites 2">>
			<<set $farm.parasitebarn to 2>>
			<<set _container to $container.farm>>
			<<set _container.upgrades.capacity to 1>>
			<<set _container.maxCount to 7>>
			<<set _container.upgrades.foodStorage to 1>>
			<<set _container.maxDaysWithoutFood to 31>>
			<<set _container.upgrades.luxury to 3>>
		<<case "irrigation">>
			<<if $farm.irrigation is undefined>>
				<<set $farm.irrigation to 1>>
			<<elseif $farm.irrigation lt 9>>
				<<set $farm.irrigation++>>
			<</if>>
		<</switch>>
		<<if $farm.build_finished is undefined or $farm.build_finished is 0>>
			<<set $farm.build_finished to []>>
		<</if>>
		<<run $farm.build_finished.pushUnique($farm.build)>>
		<<set $farm.build to 0>>
	<</if>>
<</if>>
<</widget>>

<<widget "farm_fence_damage">>
<<if $args[0]>>
	<<set _fence_mod to 1>>
	<<if $farm.wall gte 2>>
		<<set _fence_mod -= 0.5>>
	<</if>>
	<<set $farm_work.fence_damage += ($args[0] * _fence_mod)>>
	<<set $farm_work.fence_damage = Math.clamp($farm_work.fence_damage, 0, 100)>>
<</if>>
<</widget>>

<<widget "farm_fence">>
<<if $farm.wall gte 3>>
	<<set _text_output to "fence">>
<<elseif $farm.wall gte 1>>
	<<set _text_output to "wall">>
<<else>>
	<<set _text_output to "fence">>
<</if>>
<<print _text_output>>
<</widget>>

<<widget "guard_terms">>
<<farm_guard_wage>>
Security skill: <<guard_skill_text>>

Weekly wage: <<printmoney $farm.tower_guard_wage>>

Skill will improve over time, but <<he>> will ask for more pay as it does.
<</widget>>

<<widget "guard_skill_text">>
	<<if $args[0] is "tower" and $farm.tower_guard_skill isnot undefined>>
		<<set _guard_skill to $farm.tower_guard_skill>>
	<<else>>
		<<set _guard_skill to $NPCList[0].skills.security>>
	<</if>>
	<<if _guard_skill gte 1000>>
		S
	<<elseif _guard_skill gte 800>>
		A
	<<elseif _guard_skill gte 600>>
		B
	<<elseif _guard_skill gte 400>>
		C
	<<elseif _guard_skill gte 200>>
		D
	<<else>>
		F
	<</if>>
<</widget>>

<<widget "farm_guard_pay">>
<<if $farm.tower_guard_unpaid gte 1>>
	<<set _owed to ($farm.tower_guard_wage * $farm.tower_guard_unpaid)>>
	You owe <<him>> <<printmoney _owed>> in wages.

	<<if $money gte _owed>>
		<<link [[Pay|Farm Tower Pay]]>><<set $money -= _owed>><<set $NPCList[0].trust += 1>><<farm_guard_paid>><</link>><<gtrust>> | + Security skill |  + Wage

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

<<widget "farm_guard_wage">>
	<<set $farm.tower_guard_wage to 30000 + ($NPCList[0].skills.security * 100)>>
<</widget>>

<<widget "farm_guard_paid">>
<<set $NPCList[0].skills.security += (20 * $farm.tower_guard_unpaid)>>
<<set $NPCList[0].skills.security to Math.clamp($NPCList[0].skills.security, 0, 1000)>>
<<set $farm.tower_guard_skill to clone($NPCList[0].skills.security)>>
<<farm_guard_wage>>
<<set $farm.tower_guard_unpaid to 0>>
<<if $NPCList[0].skills.security gte 1000>>
	<<earnFeat "Reliable Employer">>
<</if>>
<</widget>>

<<widget "farm_stock_init">>
<<set $farm.stock to {}>>
<<set $farm.stock.truffles to 0>>
<<set $farm.stock.eggs to 0>>
<<set $farm.stock.milk to 0>>
<</widget>>

<<widget "farm_stock">>
<<if $args[0]>>
	<<if $args[1] and $args[2]>>
		<<set $farm.stock[$args[0]] += random($args[1], $args[2])>>
	<<elseif $args[1]>>
		<<set $farm.stock[$args[0]] += $args[1]>>
	<<else>>
		<<set $farm.stock[$args[0]] += 1>>
	<</if>>
<</if>>
<</widget>>

<<widget "farm_ride_events">>
<<set $rng to random(1, 4)>>
<<if $rng is 4>>
	<<if $farm.aggro gte 80>>
		You hear hooves approach from behind. Two of Remy's goons gallop after you.

		<<generate2>><<generate3>>
		<<link [[Ride faster|Farm Ride Aggro Faster]]>><</link>><<skill_difficulty thighskill "Thigh Skill" 400 1400>>

		<<link [[Confront|Farm Ride Aggro Confront]]>><</link>>

	<<elseif $farm.aggro gte 40>>
		You hear hooves approach from behind. Two of Remy's goons ride after you. They're catching up.

		<<generate2>><<generate3>>
		<<link [[Ride faster|Farm Ride Faster]]>><</link>><<skill_difficulty thighskill "Thigh Skill" 1 1000>>

		<<link [[Confront|Farm Ride Confront]]>><</link>>

	<<else>>
		You hear hooves approach from behind. Two of Remy's goons ride after you, but they keep their distance.<<gstress>><<stress 6>><<gaggro>><<farm_aggro 1>>

		<<destination_farm_ride>>
	<</if>>
<<elseif $rng is 3>>
	<<if $farm.beasts.horses lt -20 and $horsedisable is "f" and ($monster is 1 or $bestiality is "f")>>
		The <<beasttype>> jerks in another direction, and breaks into a sprint, running across an open field. It stops beside a haybale, and leans forward, dropping you from the saddle.

		You land on the hay, but the <<beasttype>> forces you down with <<bhis>> weight before you can escape.
		<<if $monster gte 1>>
			"Time for your duties," <<bhe>> says. "Slut."
		<</if>>
		<<if $NPCList[0].penis isnot "none">>
			A firm object presses against your <<bottom>>.
		<</if>>

		<<link [[Next|Farm Ride Rape]]>><<set $molestationstart to 1>><</link>>

	<<elseif $farm.beasts.horses lt 0 and $horsedisable is "f" and ($monster is 1 or $bestialitydisable is "f")>>
		The <<beasttype>> pulls to a stop, and refuses to take a step further.
		<<if $monster is 1>>
			"I'm frustrated," <<bhe>> says. "It's your job to fix it.""
		<<else>>
			It neighs in frustration.
		<</if>>

		<<if $deviancy gte 35>>
			<<link [[Handjob|Farm Ride Hand]]>><</link>><<deviant3>>

		<</if>>
		<<link [[Force it to continue|Farm Ride Force]]>><</link>><<skill_difficulty thighskill "Thigh Skill" 1 1400>>

		<<link [[Continue on foot|Farm Ride Foot]]>><</link>>

	<<elseif $farm.beasts.horses lt 20>>
		<<if $monster gte 1>>
			The <<beasttype>> is silent as you ride, seeming lost in thought.
		<<else>>
			The <<beasttype>> doesn't cause a fuss as you ride.
		<</if>>

		<<destination_farm_ride>>
	<<else>>
		<<if $monster gte 1>>
			The <<beasttype>> chats as you ride, and praises you for your management of the farm.
		<<else>>
			The <<beasttype>> seems happy to stretch <<bhis>> legs, and happy for you to ride it.
		<</if>>

		<<destination_farm_ride>>
	<</if>>
<<elseif $rng is 2>>
	The <<beasttype>> slows. It's tiring already.

	<<link [[Give it a break (0:10)|Farm Ride Break]]>><<pass 10>><</link>>

	<<link [[Push it|Farm Ride Push]]>><</link>><<skill_difficulty thighskill "Thigh Skill" 1 1000>>

<<else>>
	A car honks as it drives by, agitating your <<beasttype>>. <<bHe>> veers away from the road, almost falling into a ditch.

	<<link [[Soothe|Farm Ride Soothe]]>><</link>><<tendingdifficulty 1 1200>>

	<<link [[Take charge|Farm Ride Charge]]>><<def 1>><</link>><<skill_difficulty thighskill "Thigh Skill" 1 1200>>

	<<link [[Ignore|Farm Ride Ignore]]>><<farm_horses -1>><</link>><<lrespect>>

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

<<widget "destination_farm_ride">>
<<if $bus is "farm">>
	You arrive at the farm, and dismount your steed.

	<<link [[Next|Farm Work]]>><<endevent>><</link>>

<<else>>
	You see the town up ahead. You leave your steed in a field to graze, and walk the rest of the way on foot.

	<<link [[Next|Harvest Street]]>><<endevent>><<set $eventskip to 1>><</link>>

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

<<widget "farm_attack_auto">>
<<set _farm_fight to 0>>
<<if $farm.kennel gte 1>>
	<<set _farm_fight += 1>>
<</if>>
<<if $farm.wall gte 4>>
	<<set _farm_fight += 4>>
<<elseif $farm.wall gte 3>>
	<<set _farm_fight += 3>>
<<elseif $farm.wall gte 2>>
	<<set _farm_fight += 2>>
<<elseif $farm.wall gte 1>>
	<<set _farm_fight += 1>>
<</if>>
<<if $farm.tower gte 2 and $farm.tower_guard>>
	<<set _farm_fight += Math.trunc($farm.tower_guard_skill / 250)>>
<<elseif $farm.tower gte 1 and $farm.tower_guard>>
	<<set _farm_fight += Math.trunc($farm.tower_guard_skill / 500)>>
<</if>>
<<switch $farm_stage>>
<<case 12>>
	<<set _farm_damage to (9 - _farm_fight)>>
<<case 11>>
	<<set _farm_damage to (8 - _farm_fight)>>
<<case 10>>
	<<set _farm_damage to (7 - _farm_fight)>>
<<case 9>>
	<<set _farm_damage to (6 - _farm_fight)>>
<<case 8>>
	<<set _farm_damage to (5 - _farm_fight)>>
<<default>>
	<<set _farm_damage to (4 - _farm_fight)>>
<</switch>><<set $farm_test to _farm_fight>>
<<if _farm_damage is 0 and $farm_stage gte 12>>
	<<earnFeat "Heroic Victory">>
<</if>>
<<damage_farm _farm_damage>>
<<set $farm_attack_timer to random(17, 24)>>
<<set $farm_attacked to 1>>
<</widget>>

<<widget "damage_farm">>
<<if $fields_damaged is undefined>>
	<<set $fields_damaged to 0>>
<</if>>
<<if $args[0] gt 0>>
	<<set _field_number to $args[0]>>
	<<for _i to 0; _i lt _field_number; _i ++>>
		<<if $plots.farm[_i]>>
			<<if $plots.farm[_i].stage gte 1>>
				<<clear_plot farm _i>>
				<<set $fields_damaged += 1>>
			<<else>>
				<<set _field_number ++>>
			<</if>>
		<<else>>
			<<set $farm_destroyed to true>>
			<<break>>
		<</if>>
	<</for>>
<</if>>
<</widget>>

<<widget "farm_damage_report">>
<<if $fields_damaged is 0>>
	<<if $farm_destroyed is true>>
		The farm was attacked while you were gone, but there were no fields to burn.

	<<else>>
		The farm was attacked while you were gone, but the defenders fought valiantly, and not a single field was lost.

	<</if>>
<<elseif $field_damaged is 1>>
	The farm was attacked while you were gone, and a field torched before the defenders drove them off.<<gtrauma>><<trauma 6>>

<<elseif $fields_damaged is 9>>
	The farm was attacked while you were gone, the defenders defeated, and all the fields torched.<<gggtrauma>><<trauma 24>>

<<else>>
	The farm was attacked while you were gone, and <<number $fields_damaged>> fields torched before the defenders drove them off.<<ggtrauma>><<trauma 12>>

<</if>>
<<unset $fields_damaged>>
<<unset $farm_destroyed>>
<<unset $farm_attacked>>
<</widget>>

<<widget "farm_assault_intro">>
Alex is ready to fight.

<<if $farm.kennel gte 1>>
	The hounds are trained and ready to defend their masters.
<<else>>
	The hounds are ready to defend the farm, but don't have any special training.
<</if>>

<<if $farm.tower gte 2>>
	<<if $farm.tower_guard>>
		The watchtower and searchlight are operated by $farm.tower_guard, with <<guard_skill_text "tower">> security skill.
	<<else>>
		The watchtower is empty, but you could use it to get a better view.
	<</if>>
<<elseif $farm.tower gte 1>>
	<<if $farm.tower_guard>>
		The watchtower is operated by $farm.tower_guard, with <<guard_skill_text "tower">> security skill.
	<<else>>
		The watchtower is empty, but you could use it to get a better view.
	<</if>>
<</if>>

<<if $farm.wall gte 4>>
	The barbed metal fence around the farm is unclimbable. Attackers will need to cut their way in, which will take a while.
<<elseif $farm.wall gte 3>>
	The tall metal fence around the farm will greatly slow attackers.
<<elseif $farm.wall gte 2>>
	The reinforced wall around the farm will slow attackers.
<<elseif $farm.wall gte 1>>
	The wall around the farm will slightly slow attackers.
<<else>>
	The wall and fence enclosing the farm provide a meager barrier.
<</if>>

<</widget>>

<<widget "farm_upgrades_current">>
<<if $farm.build>>
		<<switch $farm.build>>
		<<case "parasites 1">>
			The parasite barn is being built.
		<<case "parasites 2">>
			The parasite barn is being expanded.
		<<case "wall 1">>
			The wall is undergoing a thorough repair.
		<<case "wall 2">>
			The wall is being reinforced.
		<<case "wall 3">>
			A metal fence is being built atop the stone wall.
		<<case "wall 4">>
			Barbed wire is being affixed atop the fence.
		<<case "tower 1">>
			A watchtower is being constructed at the edge of the fields.
		<<case "tower 2">>
			Searchlights are being affixed atop the watchtower.
		<<case "kennel 1">>
			A guard dog training facility is being contructed.
		<<case "barn 1" "barn 2">>
			The barn is being expanded.
		<<case "woodland 1" "woodland 2" "woodland 3">>
			A fence is being built around the nearby woodland.
		<<case "stable 1">>
			The stable is being expanded.
		<<case "coop 1" "coop 2">>
			The coop is being expanded.
		<<case "irrigation">>
			Irrigation is being installed in a field.
		<</switch>>
		<<if $farm.build_timer is 1>>
			It'll be finished tomorrow.
		<<else>>
			It'll be finished in $farm.build_timer days.
		<</if>>

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

repo_name: Area/degrees

license: mit