code:
:: Social [widget]

<<widget "social">>

	<<silently>>
		<>
	<</silently>>

Primary Relationships

		<<for _k = 0; _k lt _importantNPCs.length; _k++>>
		<<relation-box _importantNPCs[_k] _npcConfig[_importantNPCs[_k].nam]>>
		<</for>>

People of Interest

		<<for _k= 0; _k lt _otherNPCs.length; _k++>>
			<<relation-box _otherNPCs[_k] _npcConfig[_otherNPCs[_k].nam]>>
		<</for>>

Reputation

		<<silently>>
			/* Police config */
			<<set _policeCrimeConfig = { currentValue : $crimehistory, states : [
				{ requiredValue: 0,		color: 'green',		description: 'The police aren\'t concerned with you,'},
				{ requiredValue: 1000,	color: 'teal',		description: 'The police have you on their records,'},
				{ requiredValue: 2000,  color: 'lblue',		description: 'The police consider you a person of interest,'},
				{ requiredValue: 3000,	color: 'blue',		description: 'The police consider you a troublemaker,'},
				{ requiredValue: 5000,	color: 'purple',	description: 'The police consider you a criminal,'},
				{ requiredValue: 10000,	color: 'pink',		description: 'The police have a binder devoted to you,'},
				{ requiredValue: 30000,	color: 'red',		description: 'The police have a filing cabinet devoted to you,'}
			]}>>
			<<set _policeEvidenceConfig = { currentValue : $crimehistory, secondaryValue : $crime, states : [
				{ requiredValue: 0, secondaryStates : [
					{ requiredValue: 0,	color: 'green',	description: 'and have no evidence linking you to any crime.'},
					{ requiredValue: 1,	color: 'teal',	description: 'despite having a little evidence linking you to crime.'},
				]},
				{ requiredValue: 1000, secondaryStates : [
					{ requiredValue: 0,		color: 'green',	description: 'but lack enough evidence for an arrest.'},
					{ requiredValue: 1000,	color: 'pink',	description: 'and have enough evidence for an arrest.'},
					{ requiredValue: 5000,	color: 'red',	description: 'and have more than enough evidence for an arrest.'},
				]}
			]}>>
			<<set _policeBoxConfig = { name : "Police", icon : "img/misc/icon/barb.png", description: "<<relation-text _policeCrimeConfig>> <<relation-text _policeEvidenceConfig>>"}>>

			/* Orphanage */
			<<set _orphanageMoodConfig = { currentValue: $orphan_hope, secondaryValue: $orphan_reb, preText: 'The atmosphere in the orphanage is ', states : [
				{ requiredValue: -100, secondaryStates : [
					{ requiredValue: -100,	color: 'pink',	description: 'hopeless.'},
					{ requiredValue: -40,	color: 'pink',	description: 'crestfallen.'},
					{ requiredValue: -10,	color: 'pink',	description: 'unhappy.'},
					{ requiredValue: 10,	color: 'pink',	description: 'spiteful.'},
					{ requiredValue: 40,	color: 'def',	description: 'vengeful.'},
				]},
				{ requiredValue: -40, secondaryStates : [
					{ requiredValue: -100,	color: 'purple',	description: 'morose.'},
					{ requiredValue: -40,	color: 'purple',	description: 'dispirited.'},
					{ requiredValue: -10,	color: 'purple',	description: 'resigned.'},
					{ requiredValue: 10,	color: 'purple',	description: 'disobedient.'},
					{ requiredValue: 40,	color: 'def',		description: 'unruly.'},
				]},
				{ requiredValue: -10, secondaryStates : [
					{ requiredValue: -100,	color: 'blue',	description: 'obedient.'},
					{ requiredValue: -40,	color: 'blue',	description: 'compliant.'},
					{ requiredValue: -10,	color: 'blue',	description: 'calm.'},
					{ requiredValue: 10,	color: 'blue',	description: 'subversive.'},
					{ requiredValue: 40,	color: 'def',	description: 'defiant.'},
				]},
				{ requiredValue: 10, secondaryStates : [
					{ requiredValue: -100,	color: 'teal',	description: 'enduring.'},
					{ requiredValue: -40,	color: 'teal',	description: 'unresistant.'},
					{ requiredValue: -10,	color: 'teal',	description: 'optimistic.'},
					{ requiredValue: 10,	color: 'teal',	description: 'rebellious.'},
					{ requiredValue: 40,	color: 'def',	description: 'mutinous.'},
				]},
				{ requiredValue: 40, secondaryStates : [
					{ requiredValue: -100,	color: 'green',	description: 'kind.'},
					{ requiredValue: -40,	color: 'green',	description: 'friendly.'},
					{ requiredValue: -10,	color: 'green',	description: 'hopeful.'},
					{ requiredValue: 10,	color: 'green',	description: 'idealistic.'},
					{ requiredValue: 40,	color: 'def',	description: 'revolutionary.'},
				]},
			]}>>
			<<set _orphanageBoxConfig = { name : "Orphanage", icon : "img/misc/icon/orphanage.png", description: "<<relation-text _orphanageMoodConfig>>"}>>

			/* School config */
			<<set _teacherRepConfig = { currentValue: $delinquency, preText: 'You are considered ', postText: ' by the teachers.', states : [
				{ requiredValue: 0,		color: 'green',		description: 'an ideal student'},
				{ requiredValue: 10,	color: 'teal',		description: 'a normal student'},
				{ requiredValue: 200,	color: 'lblue',		description: 'a bad student'},
				{ requiredValue: 400,	color: 'blue',		description: 'a delinquent'},
				{ requiredValue: 600,	color: 'purple',	description: 'a delinquent'},
				{ requiredValue: 800,	color: 'pink',		description: 'a delinquent'},
				{ requiredValue: 1000,	color: 'red',		description: 'a terror'}
			]}>>
			<<set _studentRepConfig = { currentValue: $cool, preText: 'Your fellow students think you\'re ', states : [
				{ requiredValue: 0,		color: 'red',		preText: 'Your fellow students ', description: 'avoid you.'},
				{ requiredValue: 40,	color: 'pink',		description: 'odd.'},
				{ requiredValue: 80,	color: 'purple',	description: 'dorky.'},
				{ requiredValue: 120,	color: 'blue',		description: 'ok.'},
				{ requiredValue: 160,	color: 'lblue',		description: 'cool.'},
				{ requiredValue: 240,	color: 'teal',		description: 'very cool.'},
				{ requiredValue: 400,	color: 'green',		preText: 'Your fellow students ', description: 'aspire to be seen with you.'}
			]}>>
			<<set _teacherBoxConfig = { name : "Teachers", icon : "img/misc/icon/school.png", description: "<<relation-text _teacherRepConfig>> <<statbar $delinquency 1000>>"}>>
			<<set _studentBoxConfig = { name : "Students", icon : "img/misc/icon/oxford.png", description: "<<relation-text _studentRepConfig>> <<statbarinverted $cool $coolmax>>"}>>

			/*Crossdressing*/
			<<if $schoolrep.crossdress neq 0>>
				<<set _crossdressRepConfig = { currentValue: $schoolrep.crossdress, states : [
					{ requiredValue: 1,	color: 'lblue',		description: 'A few cliques at school whisper amongst themselves about your crossdressing ways. Few believe it.'},
					{ requiredValue: 2,	color: 'blue',		description: 'A rumour has taken root at school. Some say you\'re a crossdresser.'},
					{ requiredValue: 3,	color: 'purple',	description: 'Students gossip about your supposed crossdressing, though most think it only a joke.'},
					{ requiredValue: 4,	color: 'pink',		description: 'Everyone at school has heard the rumours of your crossdressing.'},
					{ requiredValue: 5,	color: 'red',		description: 'Everyone at school knows that you crossdress, including the teachers.'}
				]}>>
				<<set _crossdressBoxConfig = { name : "Crossdressing", description : '<<relation-text _crossdressRepConfig>>'}>>
			<</if>>

			/*Cult*/
			<<if $cultdiscovered is 1>>
				<<set _cultRepConfig = { currentValue: $cultrep, preText: 'The cult considers you to be ', states : [
					{ requiredValue: -100, color: 'red', description: 'an enemy to their faith.'},
					{ requiredValue: -40, color: 'pink', description: 'barely welcome in their faith.'},
					{ requiredValue: 0, color: 'purple', description: 'a disreputable member of their faith.'},
					{ requiredValue: 30, color: 'blue', description: 'an ordinary member of their faith.'},
					{ requiredValue: 120, color: 'lblue', description: 'a good member of their faith.'},
					{ requiredValue: 180, color: 'teal', description: 'a recognized member of their faith.'},
					{ requiredValue: 300, color: 'pink', description: 'the saviour of their faith.'}
				]}>>
				<<set _cultBoxConfig = { name : "Cult opinion", description: "<<relation-text _cultRepConfig>>"}>>
			<</if>>

			/*Herm*/
			<<if $schoolrep.herm neq 0>>
				<<set _hermRepConfig = { currentValue: $schoolrep.herm, states : [
					{ requiredValue: 1,	color: 'lblue',		description: 'A few cliques at school gossip about a student with both boy and girl parts. Few believe it.'},
					{ requiredValue: 2,	color: 'blue',		description: 'Rumours of a student with both boy and girl parts have spread through the school.'},
					{ requiredValue: 3,	color: 'purple',	description: 'The school is rife with gossip about a student with both boy and girl parts.'},
					{ requiredValue: 4,	color: 'pink',		description: 'Everyone at school has heard the rumours about your unique genitalia.'},
					{ requiredValue: 5,	color: 'red',		description: 'Everyone at school has heard of your unique genitalia, including the teachers.'}
				]}>>
				<<set _hermBoxConfig = { name : "Genitalia", description : '<<relation-text _hermRepConfig>>'}>>
			<</if>>

			/* Prison */
			<<if $prison>>
				<<set _prisonMoodConfig = { currentValue: $prison.hope, secondaryValue: $prison.reb, preText: 'The atmosphere in the prison is ', states : [
					{ requiredValue: 0, secondaryStates : [
						{ requiredValue: 0,	color: 'pink',	description: 'hopeless.'},
						{ requiredValue: 20,	color: 'pink',	description: 'crestfallen.'},
						{ requiredValue: 40,	color: 'pink',	description: 'unhappy.'},
						{ requiredValue: 60,	color: 'pink',	description: 'spiteful.'},
						{ requiredValue: 80,	color: 'def',	description: 'vengeful.'},
					]},
					{ requiredValue: 20, secondaryStates : [
						{ requiredValue: 0,	color: 'purple',	description: 'morose.'},
						{ requiredValue: 20,	color: 'purple',	description: 'dispirited.'},
						{ requiredValue: 40,	color: 'purple',	description: 'resigned.'},
						{ requiredValue: 60,	color: 'purple',	description: 'disobedient.'},
						{ requiredValue: 80,	color: 'def',		description: 'unruly.'},
					]},
					{ requiredValue: 40, secondaryStates : [
						{ requiredValue: 0,	color: 'blue',	description: 'obedient.'},
						{ requiredValue: 20,	color: 'blue',	description: 'compliant.'},
						{ requiredValue: 40,	color: 'blue',	description: 'calm.'},
						{ requiredValue: 60,	color: 'blue',	description: 'subversive.'},
						{ requiredValue: 80,	color: 'def',	description: 'defiant.'},
					]},
					{ requiredValue: 60, secondaryStates : [
						{ requiredValue: 0,	color: 'teal',	description: 'enduring.'},
						{ requiredValue: 20,	color: 'teal',	description: 'unresistant.'},
						{ requiredValue: 40,	color: 'teal',	description: 'optimistic.'},
						{ requiredValue: 60,	color: 'teal',	description: 'rebellious.'},
						{ requiredValue: 80,	color: 'def',	description: 'mutinous.'},
					]},
					{ requiredValue: 80, secondaryStates : [
						{ requiredValue: 0,	color: 'green',	description: 'tolerant.'},
						{ requiredValue: 20,	color: 'green',	description: 'patient.'},
						{ requiredValue: 40,	color: 'green',	description: 'hopeful.'},
						{ requiredValue: 60,	color: 'green',	description: 'idealistic.'},
						{ requiredValue: 80,	color: 'def',	description: 'revolutionary.'},
					]},
				]}>>
				<<set _guardRepConfig = { currentValue: $prison.guards, preText: 'The guards ', states : [
					{ requiredValue: 0,		color: 'red',		description: 'have you under constant surveillance.'},
					{ requiredValue: 15,	color: 'pink',		description: 'consider you a problem.'},
					{ requiredValue: 30,	color: 'purple',		description: 'watch you.'},
					{ requiredValue: 45,	color: 'blue',		description: 'are keeping an eye on you.'},
					{ requiredValue: 60,	color: 'lblue',		description: 'expect no trouble from you.'},
					{ requiredValue: 80,	color: 'teal',		description: 'overlook you.'},
					{ requiredValue: 100,	color: 'green',		description: 'forget you are here.'}
				]}>>
				<<set _inmateRepConfig = { currentValue: $prison.inmates, preText: 'Most fellow inmates ', states : [
					{ requiredValue: 0,		color: 'red',		description: 'see you as meat.'},
					{ requiredValue: 15,	color: 'pink',		description: 'think you\'re a fucktoy.'},
					{ requiredValue: 30,	color: 'purple',	description: 'consider you a bitch.'},
					{ requiredValue: 45,	color: 'blue',		description: 'see you as one of them.'},
					{ requiredValue: 60,	color: 'lblue',		description: 'have a good opinion of you.'},
					{ requiredValue: 80,	color: 'teal',		description: 'respect you.'},
					{ requiredValue: 100,	color: 'green',		description: 'think you\'re the boss.'}
				]}>>
				<<set _prisonBoxConfig = { name : "Prison atmosphere", icon : "img/misc/icon/police.png", description: "<<relation-text _prisonMoodConfig>>"}>>
				<<set _guardBoxConfig = { name : "Prison guards", icon : "img/misc/icon/police.png", description: "<<relation-text _guardRepConfig>>"}>>
				<<set _inmateBoxConfig = { name : "Prison inmates", icon : "img/misc/icon/police.png", description: "<<relation-text _inmateRepConfig>>"}>>
			<</if>>
		<</silently>>
		<<relation-box-simple _policeBoxConfig>>
		<<relation-box-simple _orphanageBoxConfig>>
		<<relation-box-simple _teacherBoxConfig>>
		<<relation-box-simple _studentBoxConfig>>
		<<if $schoolrep.crossdress neq 0>>
			<<relation-box-simple _crossdressBoxConfig>>
		<</if>>
		<<if $schoolrep.herm neq 0>>
			<<relation-box-simple _hermBoxConfig>>
		<</if>>
		<<if $cultdiscovered is 1>>
			<<relation-box-simple _cultBoxConfig>>
		<</if>>
		<<if $prison>>
			<<relation-box-simple _guardBoxConfig>>
			<<relation-box-simple _inmateBoxConfig>>
			<<relation-box-simple _prisonBoxConfig>>
		<</if>>

	<<if $farm_stage gte 2>>
		<<silently>>
			/* Farm Animals */
			/*Horses*/
			<<set _farmHorseRepConfig = { currentValue: $farm.beasts.horses, preText: 'The steeds of the farm ', postText: ' you.', states: [
				{ requiredValue: -100,	color: 'pink',		description: 'see you as a fucktoy.', postText: ' '},
				{ requiredValue: -20,	color: 'purple',	description: 'have little respect', postText: ' for you.'},
				{ requiredValue: -5,	color: '',			description: 'are wary of'},
				{ requiredValue: 5,		color: 'lblue',		description: 'trust'},
				{ requiredValue: 20,	color: 'green',		description: 'respect'}
			]}>>
			/*Pigs*/
			<<set _farmPigRepConfig = { currentValue: $farm.beasts.pigs, preText: 'The pigs ', postText: ' you.', states: [
				{ requiredValue: -100,	color: 'pink',		description: 'see you as a fucktoy.', postText: ' '},
				{ requiredValue: -20,	color: 'purple',	description: 'have little respect', postText: ' for you.'},
				{ requiredValue: -5,	color: '',			description: 'are wary of'},
				{ requiredValue: 5,		color: 'lblue',		description: 'trust'},
				{ requiredValue: 20,	color: 'green',		description: 'respect'}
			]}>>
			/*Cattle*/
			<<set _farmCattleRepConfig = { currentValue: $farm.beasts.cattle, preText: 'The cattle ', postText: ' you.', states: [
				{ requiredValue: -100,	color: 'pink',		description: 'see you as an annoyance.', postText: ' '},
				{ requiredValue: -20,	color: 'purple',	description: 'have little respect', postText: ' for you.'},
				{ requiredValue: -5,	color: '',			description: 'are wary of'},
				{ requiredValue: 5,		color: 'lblue',		description: 'trust'},
				{ requiredValue: 20,	color: 'green',		description: 'respect'}
			]}>>
			/*Dogs*/
			<<set _farmDogRepConfig = { currentValue: $farm.beasts.dogs, preText: 'The dogs ', postText: ' you.', states: [
				{ requiredValue: -100,	color: 'pink',		description: 'see you as a fucktoy.', postText: ' '},
				{ requiredValue: -20,	color: 'purple',	description: 'have little respect', postText: ' for you.'},
				{ requiredValue: -5,	color: '',			description: 'are wary of'},
				{ requiredValue: 5,		color: 'lblue',		description: 'trust'},
				{ requiredValue: 20,	color: 'green',		description: 'respect'}
			]}>>
			<<set _farmHorseBoxConfig = 	{ name: "Horses",	description : '<<relation-text _farmHorseRepConfig>>'}>>
			<<set _farmPigBoxConfig = 		{ name: "Pigs",		description : '<<relation-text _farmPigRepConfig>>'}>>
			<<set _farmCattleBoxConfig = 	{ name: "Cattle",	description : '<<relation-text _farmCattleRepConfig>>'}>>
			<<set _farmDogBoxConfig = 		{ name: "Dogs",		description : '<<relation-text _farmDogRepConfig>>'}>>

			<<if $farm_stage gte 5>>
				/* Farm Sabotage */
				<<set _farmSabotageConfig = { currentValue: $farm.aggro, states: [
					{ requiredValue: 0,		color: 'green',		description: 'The farm is peaceful.'},
					{ requiredValue: 1,		color: 'teal',		description: 'Strange people have been seen watching the farm.'},
					{ requiredValue: 10,	color: 'lblue',		description: 'Signs of intrusion have been found around the farm.'},
					{ requiredValue: 20,	color: 'blue',		description: 'Something is spooking the beasts of the farm.'},
					{ requiredValue: 40,	color: 'purple',	description: 'The farm is being sabotaged at night.'},
					{ requiredValue: 60,	color: 'pink',		description: 'The farm is being sabotaged, day and night.'},
					{ requiredValue: 100,	color: 'red',		description: 'Remy\'s goons operate in the open, sabotaging the farm and its business.'},
				]}>>
				<<set _farmSabotageBoxConfig = { name: "Farm Safety", description : '<<relation-text _farmSabotageConfig>>'}>>
			<</if>>
		<</silently>>

Farm Status

			<<relation-box-simple _farmHorseBoxConfig>>
			<<relation-box-simple _farmPigBoxConfig>>
			<<relation-box-simple _farmCattleBoxConfig>>
			<<relation-box-simple _farmDogBoxConfig>>
			<<if $farm_stage gte 5>>
			<<relation-box-simple _farmSabotageBoxConfig>>
			<</if>>

	<</if>>

Fame

		<<silently>>
			<<set _fameStates = [
				{ requiredValue: 0,		color: 'green',		description: ' Unknown'},
				{ requiredValue: 30,	color: 'teal',		description: ' Obscure'},
				{ requiredValue: 100,	color: 'lblue',		description: ' Low-key'},
				{ requiredValue: 200,	color: 'blue',		description: ' Known'},
				{ requiredValue: 400,	color: 'purple',	description: ' Recognised'},
				{ requiredValue: 600,	color: 'pink',		description: ' Famous'},
				{ requiredValue: 1000,	color: 'red',		description: ' Notorious _config.flavorText'}
			]>>
			<<set _inverseFameStates = [
				{ requiredValue: 0,		color: 'red',		description: ' Unknown'},
				{ requiredValue: 30,	color: 'pink',		description: ' Obscure'},
				{ requiredValue: 100,	color: 'purple',	description: ' Low-key'},
				{ requiredValue: 200,	color: 'blue',		description: ' Known'},
				{ requiredValue: 400,	color: 'lblue',		description: ' Recognised'},
				{ requiredValue: 600,	color: 'teal',		description: ' Famous'},
				{ requiredValue: 1000,	color: 'green',		description: ' Notorious _config.flavorText'}
			]>>

			<<set _sexFameConfig =				{ currentValue: $famesex,			preText: 'Sex:',			flavorText: 'slut',			states: _fameStates }>>
			<<set _prostitutionFameConfig =		{ currentValue: $fameprostitution,	preText: 'Prostitution:',	flavorText: 'whore',		states: _fameStates }>>
			<<set _rapeFameConfig =				{ currentValue: $famerape,			preText: 'Rape:',			flavorText: 'fucktoy',		states: _fameStates }>>
			<<if $bestialitydisable is "f">>
				<<set _bestialityFameConfig =		{ currentValue: $famebestiality,	preText: 'Bestiality:',	flavorText: 'bitch',		states: _fameStates }>>
			<<else>>
				<<set _bestialityFameConfig =		{ currentValue: $famebestiality,	preText: 'Monster People:',	flavorText: 'monster fucker',		states: _fameStates }>>
			<</if>>
			<<set _exhibitionismFameConfig =	{ currentValue: $fameexhibitionism,	preText: 'Exhibitionism:',	flavorText: 'flaunter',		states: _fameStates }>>
			<<if $famepregnancy gte 600>>
				<<set $_name to "broodmother">>
			<<elseif $famepregnancy gte 200>>
				<<set $_name to "breeder">>
			<<else>>
				<<set $_name to "mother">>
			<</if>>
			<<set _pregnancyFameConfig = 		{ currentValue: $famepregnancy,		preText: 'Pregnancy:',	flavorText: $_name,		states: _fameStates }>>
			<<set _combatFameConfig =			{ currentValue: $famescrap,			preText: 'Combat:',		flavorText: 'scrapper',		states: _inverseFameStates }>>
			<<set _kindnessFameConfig =			{ currentValue: $famegood,			preText: 'Kindness:',		flavorText: 'do-gooder',	states: _inverseFameStates }>>
			<<set _businessFameConfig =			{ currentValue: $famebusiness,		preText: 'Business:',		flavorText: 'entrepreneur',	states: _inverseFameStates }>>
			<<set _socialFameConfig =			{ currentValue: $famesocial,		preText: 'Socialite:',		flavorText: 'schmoozer',	states: _inverseFameStates }>>
			<<set _modelFameConfig =			{ currentValue: $famemodel,		preText: 'Modelling:',		flavorText: 'show off',	states: _inverseFameStates }>>
			<<set _overallFameConfig =			{ currentValue: $fame,				preText: 'Overall:',		flavorText: '', states: [
				{ requiredValue: 0,		color: 'green',		description: ' Unknown'},
				{ requiredValue: 100,	color: 'teal',		description: ' Obscure'},
				{ requiredValue: 500,	color: 'lblue',		description: ' Low-key'},
				{ requiredValue: 1000,	color: 'blue',		description: ' Known'},
				{ requiredValue: 2000,	color: 'purple',	description: ' Recognised'},
				{ requiredValue: 3000,	color: 'pink',		description: ' Famous'},
				{ requiredValue: 4000,	color: 'red',		description: ' Notorious'}
			]}>>

			<<set _sexFameBoxConfig =			{ description : '<<relation-text _sexFameConfig>>' }>>
			<<set _prostitutionFameBoxConfig =	{ description : '<<relation-text _prostitutionFameConfig>>' }>>
			<<set _rapeFameBoxConfig =			{ description : '<<relation-text _rapeFameConfig>>' }>>
			<<set _bestialityFameBoxConfig =	{ description : '<<relation-text _bestialityFameConfig>>' }>>
			<<set _exhibitionismFameBoxConfig =	{ description : '<<relation-text _exhibitionismFameConfig>>' }>>
			<<set _pregnancyFameBoxConfig = 	{ description : '<<relation-text _pregnancyFameConfig>>' }>>
			<<set _combatFameBoxConfig =		{ description : '<<relation-text _combatFameConfig>>' }>>
			<<set _kindnessFameBoxConfig =		{ description : '<<relation-text _kindnessFameConfig>>' }>>
			<<set _businessFameBoxConfig =		{ description : '<<relation-text _businessFameConfig>>' }>>
			<<set _socialFameBoxConfig =		{ description : '<<relation-text _socialFameConfig>>' }>>
			<<set _modelFameBoxConfig =			{ description : '<<relation-text _modelFameConfig>>' }>>
			<<set _overallFameBoxConfig =		{ description : '<<relation-text _overallFameConfig>>' }>>
		<</silently>>

		<<relation-box-simple _sexFameBoxConfig>>
		<<relation-box-simple _prostitutionFameBoxConfig>>
		<<relation-box-simple _rapeFameBoxConfig>>
		<<relation-box-simple _bestialityFameBoxConfig>>
		<<relation-box-simple _exhibitionismFameBoxConfig>>
		<<if $famemodel gte 1>>
			<<relation-box-simple _modelFameBoxConfig>>
		<</if>>
		/*ToDo: Pregnancy, remove check to properly enable*/
		<<if $pregnancyTesting>>
			<<relation-box-simple _pregnancyFameBoxConfig>>
		<</if>>
		<<relation-box-simple _combatFameBoxConfig>>
		<<relation-box-simple _kindnessFameBoxConfig>>
		<<relation-box-simple _businessFameBoxConfig>>
		<<relation-box-simple _socialFameBoxConfig>>
		<<relation-box-simple _overallFameBoxConfig>>

	The townsfolk know you as <<overworld_nickname>>. Those in the criminal underworld call you <<underworld_nickname>>.

	<<if $syndromewolves is 1 or $dockwork gte 2>>

Other

	<</if>>
	<<if $syndromewolves is 1>>

				Wolf pack harmony:

					<<set $percent=Math.floor(($wolfpackharmony/20)*100)>>
					<<print '

'>>

				Wolf pack ferocity:

					<<set $percent=Math.floor(($wolfpackferocity/20)*100)>>
					<<print '

'>>

	<</if>>

	<<if $dockwork gte 2>>

				Docks:
				<<set $dockstatus = Math.clamp($dockstatus, 0, 100)>>
				<<if $dockstatus gte 100>>
					The other workers respect you.
				<<elseif $dockstatus gte 80>>
					The other workers accept you.
				<<elseif $dockstatus gte 30>>
					The other workers tolerate you.
				<<elseif $dockstatus gte 10>>
					The other workers view you with suspicion.
				<<else>>
					The other workers view you with contempt.
				<</if>>

	<</if>>

<</widget>>


code:
:: Widgets Stats [widget]

<<widget "trauma">>
	<<if $args[0] or $args[1]>>
		<<if $args[0] gte 0>>
			<<set _trauma_mod to 1>>
			<<if $rapetrait gte 1>>
				<<set _trauma_mod *= 0.7>>
			<</if>>
			<<if $bestialitytrait gte 1 and $enemytype is "beast">>
				<<set _trauma_mod *= 0.7>>
			<</if>>
			<<if $tentacletrait gte 1 and $enemytype is "tentacles">>
				<<set _trauma_mod *= 0.7>>
			<</if>>
			<<set $trauma += Math.trunc((($args[0] * 3) - (($args[0] * 1.5) * ($control / $controlmax))) * _trauma_mod)>>
			<<if $dev is 1>><<set $control -= $args[0]>><</if>>
		<<else>>
			<<set $trauma += Math.trunc(($args[0] * 3) + (($args[0] * 1.5) * ($control / $controlmax)))>>
		<</if>>
	<</if>>
	<<if $trauma gte 1>>
		<<set $sleeptrouble to 1>>
	<<else>>
		<<set $sleeptrouble to 0>>
	<</if>>

	<<if $trauma gte ($traumamax / 10) * 1>>
		<<set $nightmares to 1>>
	<<else>>
		<<set $nightmares to 0>>
	<</if>>

	<<if $trauma gte ($traumamax / 10) * 7>>
		<<set $anxiety to 2>>
	<<elseif $trauma gte ($traumamax / 10) * 2>>
		<<set $anxiety to 1>>
	<<else>>
		<<set $anxiety to 0>>
	<</if>>

	<<if $trauma gte ($traumamax / 10) * 8>>
		<<set $flashbacks to 1>>
	<<else>>
		<<set $flashbacks to 0>>
	<</if>>

	<<if $trauma gte ($traumamax / 10) * 6>>
		<<set $panicattacks to 2>>
	<<elseif $trauma gte ($traumamax / 10) * 4>>
		<<set $panicattacks to 1>>
	<<else>>
		<<set $panicattacks to 0>>
	<</if>>

	<<updateHallucinations>>

	<<if $trauma gte $traumamax>>
		<<set $dissociation to 2>>
	<<elseif $trauma gte ($traumamax / 10) * 9>>
		<<set $dissociation to 1>>
	<<else>>
		<<set $dissociation to 0>>
	<</if>>
<</widget>>

<<widget "combattrauma">>
	<<if $args[0]>>
		<<if $args[0] gte 0>>
			<<set _trauma_mod to 1>>
			<<if $rapetrait gte 1>>
				<<set _trauma_mod *= 0.7>>
			<</if>>
			<<if $bestialitytrait gte 1 and $enemytype is "beast">>
				<<set _trauma_mod *= 0.7>>
			<</if>>
			<<if $tentacletrait gte 1 and $enemytype is "tentacles">>
				<<set _trauma_mod *= 0.7>>
			<</if>>
			<<set $trauma += Math.trunc((($args[0] * 1) - (($args[0] * 0.5) * ($control / $controlmax))) * _trauma_mod)>>
			<<if $dev is 1>><<set $control -= $args[0]>><</if>>
		<<else>>
			<<set $trauma += Math.trunc(($args[0] * 1) + (($args[0] * 0.5) * ($control / $controlmax)))>>
		<</if>>
	<</if>>
<</widget>>

<<widget "straighttrauma">>
	<<if $args[0]>>
		<<set $trauma += ($args[0] * 1)>>
	<</if>>
<</widget>>

<<widget "updateHallucinations">>
	<<if $trauma gte ($traumamax / 10) * 5 or $awareness gte 400 or $hallucinogen gt 0 or ($moonstate is "evening" and $hour gte 21 or $moonstate is "morning" and $hour lt 6)>>
		<<set $hallucinations to 2>>
	<<elseif $trauma gte ($traumamax / 10) * 3 or $awareness gte 300>>
		<<set $hallucinations to 1>>
	<<else>>
		<<set $hallucinations to 0>>
	<</if>>
<</widget>>

<<widget "control">>
	<<if $args[0]>>
		<<set $control += ($args[0] * 10)>>
		<<if $args[0] gte 1>>
			<<set $controlstart += ($args[0] * 10)>>
		<</if>>
		<<if $control gte ($controlmax / 5) * 2>>
			<<set $controlled to 1>>
		<<else>>
			<<set $controlled to 0>>
		<</if>>
	<</if>>
<</widget>>

<<widget "combatcontrol">>
	<<if $args[0]>>
		<<set $control += ($args[0] * 10)>>
		<<if $control gte $controlstart>>
			<<set $control to $controlstart>>
		<</if>>
		<<if $control gte ($controlmax / 5) * 2>>
			<<set $controlled to 1>>
		<<else>>
			<<set $controlled to 0>>
		<</if>>
	<</if>>
<</widget>>

<<widget "corruption">>
<<if $args[0]>>
	<<set $corruption_slime += $args[0]>>
<</if>>
<</widget>>

<<widget "semenvolume">>
	<<if isNaN($args[0])>>
		<<run throw new Error("The semenvolume widget was passed a non-numeric argument (or none at all)!")>>
	<<elseif $player.penisExist>>
		<<set $_volume_increase to $args[0] * 3>>
		<<if $cow gte 6>>
			<<set $_volume_increase *= 2>>
		<</if>>
		<<set $semen_volume += $_volume_increase>>
		<<set $semen_volume to Math.clamp($semen_volume, 0, $semen_max)>>
	<</if>>
<</widget>>

<<widget "milkvolume">>
	<<if isNaN($args[0])>>
		<<run throw new Error("The milkvolume widget was passed a non-numeric argument (or none at all)!")>>
	<<else>>
		<<if $args[0] gt 0>>
			<<if $cow gte 6>>
				<<set $lactation_pressure += 2>>
			<<else>>
				<<set $lactation_pressure += 1>>
			<</if>>
		<</if>>
		<<if $lactating is 1 and $args[0] isnot 0>>
			<<set $_volume_increase to ($args[0] * 2)>>
			<<if $cow gte 6>>
				<<set $_volume_increase *= 2>>
			<</if>>
			<<set $milk_volume += $_volume_increase>>
			<<set $milk_volume = Math.clamp($milk_volume, 24, $milk_max)>>
		<</if>>
	<</if>>
<</widget>>

<<widget "stress">>
<<if $drunk gte 480>>
	<<set _stress_mod to 10>>
<<elseif $drunk gte 360>>
	<<set _stress_mod to 15>>
<<elseif $drunk gte 240>>
	<<set _stress_mod to 20>>
<<elseif $drunk gte 120>>
	<<set _stress_mod to 25>>
<<elseif $drunk gte 1>>
	<<set _stress_mod to 30>>
<<else>>
	<<set _stress_mod to 40>>
<</if>>
<<if $body_temperature is "cold">>
	<<set _stress_mod *= 3.0>>
<<elseif $body_temperature is "chilly">>
	<<set _stress_mod *= 1.5>>
<</if>>
<<if $args[0]>>
	<<if $args[0] gt 0>>
		<<set $stress += ($args[0] * _stress_mod)>>
	<<else>>
		<<set $stress += ($args[0] * 80)>>
	<</if>>
<</if>>
<</widget>>

<<widget "arousal">>
	<<if $args[0] gte 0 or $args[0] lt 0>>
		<<set _orgasmTraitMod to 1>>
		<<set _chokeTraitMod to 1>>
		<<if $orgasmtrait gte 1 and $args[0] gte 1>>
			<<set _orgasmTraitMod to 0.6>>
		<</if>>
		<<if $choketrait gte 1>>

			<<set _chokeTraitMod += ($oxygenmax - $oxygen) / 1200>>
		<</if>>
		<<set $arousal to Math.clamp($arousal + ($args[0] * _orgasmTraitMod * _chokeTraitMod), 0, $arousalmax)>>
		<<if $args[1] is "maso">>
			<<set $arousalmasochism += $args[0] * _orgasmTraitMod * _chokeTraitMod>>
		<<elseif $args[0] gte 0>>
			<<if $args[1] is true>>
				<<if $trackedArousal.length gt 4>>
					<<run $trackedArousal.deleteAt(0)>>

					<<set $trackedArousal[$trackedArousal.length - 1] += $arousal * $arousal / ($arousalmax * 0.8)>>
				<</if>>
				<<run $trackedArousal.push(0)>>
			<</if>>
			<<set $trackedArousal[$trackedArousal.length - 1] += $args[0]>>
			<<if $args[0] gt 0>>
				<<set $timeSinceArousal to 0>>
			<</if>>
		<</if>>
	<<else>>
		<<if $arousalError is undefined>>
			<<set $arousalError to [$args[0]]>>
		<<elseif $arousalError.length gte 50>>
			<<set $arousalError to [$args[0]]>>
		<<else>>
			<<set $arousalError.push($args[0])>>
		<</if>>
	<</if>>
<</widget>>

<<widget "breastarousal">>
	<<if $args[0] gte 0 or $args[0] lt 0>>
		<<set $arousal += ($args[0] * $breastsensitivity)>>
		<<if $args[0] gte 0>>
			<<set $trackedArousal[$trackedArousal.length - 1] += $args[0] * $breastsensitivity>>
		<</if>>
	<<else>>
		<<if $arousalError is undefined>>
			<<set $arousalError to [$args[0]]>>
		<<elseif $arousalError.length gte 50>>
			<<set $arousalError to [$args[0]]>>
		<<else>>
			<<set $arousalError.push($args[0])>>
		<</if>>
	<</if>>
<</widget>>

<<widget "genitalarousal">>
	<<if $args[0] gte 0 or $args[0] lt 0>>
		<<set $arousal += ($args[0] * $genitalsensitivity)>>
		<<if $args[0] gte 0>>
			<<set $trackedArousal[$trackedArousal.length - 1] += $args[0] * $genitalsensitivity>>
		<</if>>
	<<else>>
		<<if $arousalError is undefined>>
			<<set $arousalError to [$args[0]]>>
		<<elseif $arousalError.length gte 50>>
			<<set $arousalError to [$args[0]]>>
		<<else>>
			<<set $arousalError.push($args[0])>>
		<</if>>
	<</if>>
<</widget>>

<<widget "tiredness">>
<<set _tiredness_mod to 1>>
<<if $body_temperature is "hot">>
	<<set _tiredness_mod += 2>>
<<elseif $body_temperature is "warm">>
	<<set _tiredness_mod += 0.5>>
<</if>>
<<if $args[0]>>
	<<if $args[1] is "pass">>
		<<set $tiredness += ($args[0] * _tiredness_mod)>>
	<<else>>
		<<if $args[0] gt 0>>
			<<set $tiredness += ($args[0] * 15 * _tiredness_mod)>>
		<<else>>
			<<set $tiredness += ($args[0] * 20 * _tiredness_mod)>>
		<</if>>
	<</if>>
<</if>>
<</widget>>

<<widget "pain">>
	<<set _pain to $args[0] * 4>>

	<<if _pain gte 0>>
		<<set _pain *= 1 - ($sciencetrait / 10)>>
	<</if>>

	<<if $masochism gte 100>>
		<<set _pain *= 1 - $masochism / 1200>>
		<<set _arousal to $args[0] * $masochism / 6>>
		<<if _arousal gte 0>>
			<<arousal _arousal "maso">>
		<</if>>
	<</if>>
	<<set $pain += _pain>>
<</widget>>

<<widget "masopain">>
	<<if $args[0]>>
		<<set $pain += (($args[0] * (1 - ($masochism / 1200))) * 4)>>
		<<set _arousal to (($args[0] * (0 + ($masochism / 18))) * 4)>>
		<<arousal _arousal>>
	<</if>>
<</widget>>

<<widget "detention">>
	<<if $args[0] and $statFreeze isnot true>>
		<<if $args[0] gt 0>>
			<<set $detention += ($args[0] * 10)>>
		<</if>>
		<<set $delinquency += ($args[0] * 4)>>
	<</if>>
<</widget>>

<<widget "delinquency">>
	<<if $args[0] and $statFreeze isnot true>>
		<<set $delinquency += ($args[0] * 4)>>
	<</if>>
<</widget>>

<<widget "status">>
	<<if $args[0] and $statFreeze isnot true>>
		<<if $args[0] gt 0>>
			<<set $cool += ($args[0] * 1)>>
			<<if $worn.face.type.includes("cool")>>
				<<set $cool += ($args[0] * 1)>>
			<</if>>
			<<if $worn.head.type.includes("cool")>>
				<<set $cool += ($args[0] * 1)>>
			<</if>>
			<<if $worn.upper.type.includes("cool")>>
				<<set $cool += ($args[0] * 1)>>
			<</if>>
		<<elseif $args[0] lt 0>>
			<<set $cool *= (1 - ($args[0] / -100))>>
			<<set $cool -= 1>>
		<</if>>
	<</if>>
<</widget>>

<<widget "spray">>
	<<if $args[0]>>
		<<if $args[0] gte 0>>
			<<set $spray += $args[0]>>
			<<set $spray to Math.clamp($spray, 0, $spraymax)>>
		<<else>>
			<<if $infinitespray is 1>>
			<<else>>
				<<if $prof.spray gte random(1, 5000)>>
					<<set $effectsmessage to 1>>
					<<set $prof_spray_message to 1>>
				<<else>>
					<<set $spray += $args[0]>>
					<<set $spray to Math.clamp($spray, 0, $spraymax)>>
					<<prof spray `(($args[0] * -1) * 5)`>>
				<</if>>
			<</if>>
		<</if>>
	<</if>>
<</widget>>

<<widget "awareness">>
	<<if $args[0] and $statFreeze isnot true>>
		<<set $awareness += ($args[0])>>
		<<for _active_clothes range Object.keys($worn)>>
			<<if $worn[_active_clothes].type.includes("dark")>>
				<<set $awareness += ($args[0])>>
			<</if>>
		<</for>>
	<</if>>
<</widget>>

<<widget "purity">>
	<<if $args[0] and $statFreeze isnot true>>
		<<set $purity += ($args[0])>>
		<<for _active_clothes range Object.keys($worn)>>
			<<if $worn[_active_clothes].type.includes("holy")>>
				<<set $purity += ($args[0])>>
			<</if>>
		<</for>>
	<</if>>
<</widget>>

<<widget "suspicion">>
	<<if $args[0] and $statFreeze isnot true>>
		<<set $suspicion += ($args[0])>>
	<</if>>
<</widget>>

<<widget "asylumstatus">>
	<<if $args[0] and $statFreeze isnot true>>
		<<set $asylumstatus += ($args[0] * 1)>>
	<</if>>
<</widget>>

<<widget "humiliation10">>
	<<set $stress += 40>>
	<<trauma 1>>
<</widget>>

<<widget "wolfpacktrust">>
	<<set $wolfpacktrust += 1>>
	The pack trusts you a little more.
<</widget>>

<<widget "wolfpackfear">>
	<<set $wolfpackfear += 1>>
	The pack fears you a little more.
<</widget>>

<<widget "gferocity">>
	<<set $wolfpackferocity += 1>>
	| + Ferocity
<</widget>>

<<widget "gharmony">>
	<<set $wolfpackharmony += 1>>
	| + Harmony
<</widget>>

<<widget "lferocity">>
	<<set $wolfpackferocity -= 1>>
	| - Ferocity
<</widget>>

<<widget "lharmony">>
	<<set $wolfpackharmony -= 1>>
	| - Harmony
<</widget>>

<<widget "sub">>
	<<if $args[0] and $statFreeze isnot true>>
		<<set $submissive += ($args[0] * 5)>>
	<</if>>
<</widget>>

<<widget "def">>
	<<if $args[0] and $statFreeze isnot true>>
		<<set $submissive -= ($args[0] * 5)>>
	<</if>>
<</widget>>

<<widget "incgpenisinsecurity">>
	<<set _n to 10>>
	<<if $args[0] and typeof($args[0]) is "number">> <<set _n to $args[0]>> <</if>>
	<<switch $penissize>>
		<<case 4>>
			<<insecurity "penis_big" _n>><<ginsecurity "penis_big">>
		<<case 1>>
			<<insecurity "penis_small" _n>><<ginsecurity "penis_small">>
		<<case 0 -1 -2>>
			<<insecurity "penis_tiny" _n>><<ginsecurity "penis_tiny">>
	<</switch>>
<</widget>>

<<widget "incggpenisinsecurity">>
	<<incgpenisinsecurity 20>>
<</widget>>

<<widget "insecurity_gain">>
	<<set _acceptance to V["acceptance_" + $args[0]]>>
	<<set _insecurity to V["insecurity_" + $args[0]]>>
	<<set _stat_gain to ($args[1] * 10)>>

	<<set _insecurity_possible = {
		"penis_tiny": $player.penisExist and $penissize lte 0,
		"penis_small": $player.penisExist and $penissize is 1,
		"penis_big": $player.penisExist and $penissize gte 4,
		"breasts_tiny": $gender isnot "m",
		"breasts_small": true,
		"breasts_big": true
	}[$args[0]]>>

	<<if _acceptance lt 1000 and _insecurity_possible>>
		<<set _insecurity += _stat_gain>>
		<<set _insecurity = Math.clamp(_insecurity, 0, 1000)>>
		<<if _insecurity gte 1000>>
			<<stress 3>><<control -3>>
		<<elseif _insecurity gte 800>>
			<<stress 3>><<control -2>>
		<<elseif _insecurity gte 600>>
			<<stress 2>><<control -2>>
		<<elseif _insecurity gte 400>>
			<<stress 2>><<control -1>>
		<<elseif _insecurity gte 200>>
			<<stress 1>><<control -1>>
		<<else>>
			<<stress 1>>
		<</if>>
		<<set V["insecurity_" + $args[0]] to _insecurity>>
	<</if>>
<</widget>>

<<widget "insecurity">>
	/*
		args[0]: insecurity type
		args[1]: amount to increase by
	*/
	<<if $args[0] and $args[1] and $statFreeze isnot true>>
		<<if ["penis_tiny", "penis_small", "penis_big", "breasts_tiny", "breasts_small", "breasts_big"].includes($args[0])>>
			<<insecurity_gain $args[0] $args[1]>>
		<<else>>
			INVALID INSECURITY TYPE SPECIFIED: <<print "insecurity_"+$args[0]>>
		<</if>>
	<</if>>
<</widget>>

<<widget "acceptance">>
	/*
		args[0]: insecurity type
		args[1]: amount to increase by
	*/
	<<if $args[0] and $args[1] and $statFreeze isnot true>>
		/* note: this does not check if a player is capable of gaining acceptance, so dont use this widget without checking.  */
		<<if ["penis_tiny", "penis_small", "penis_big", "breasts_tiny", "breasts_small", "breasts_big"].includes($args[0])>>
			<<set V["acceptance_"+$args[0]] += ($args[1] * 6)>>
			<<set V["acceptance_"+$args[0]] = Math.clamp(V["acceptance_"+$args[0]], 0, 1000)>>
		<<else>>
			INVALID ACCEPTANCE TYPE SPECIFIED: <<print "acceptance_"+$args[0]>>
		<</if>>
	<</if>>
<</widget>>

<<widget "willpower">>
	<<if $args[0] and $statFreeze isnot true>>
		<<set $willpower += ($args[0] * 2)>>
	<</if>>
	<<set $willpower = Math.clamp($willpower, 0, $willpowermax)>>
<</widget>>

<<widget "hope">>
<<if $args[0] and $statFreeze isnot true>>
<<set $orphan_hope += ($args[0] * 2)>>
<</if>>
<</widget>>

<<widget "reb">>
<<if $args[0] and $statFreeze isnot true>>
<<set $orphan_reb += ($args[0] * 2)>>
<</if>>
<</widget>>

<<widget "grace">>/*Optional second variable is the rank of the NPC giving the order. Grace changes won't apply if the player's rank equals or exceeds the NPC's.*/
<<if $args[0] and $statFreeze isnot true>>
	<<if $args[1] is "monk">>
		<<if $temple_rank is "initiate">>
			<<set $grace += $args[0]>>
			<<set $grace = Math.clamp($grace, -100, 100)>>
		<<else>>
		<</if>>
	<<elseif $args[1] is "priest">>
		<<if $temple_rank is "initiate" or $temple_rank is "monk">>
			<<set $grace += $args[0]>>
			<<set $grace = Math.clamp($grace, -100, 100)>>
		<<else>>
		<</if>>
	<<elseif $args[1] is "bishop">>
		<<if $temple_rank is "initiate" or $temple_rank is "monk" or $temple_rank is "priest">>
			<<set $grace += $args[0]>>
			<<set $grace = Math.clamp($grace, -100, 100)>>
		<<else>>
		<</if>>
	<<else>>
		<<set $grace += $args[0]>>
		<<set $grace = Math.clamp($grace, -100, 100)>>
	<</if>>
<</if>>
<</widget>>

<<widget "livestock_obey">>
	<<if $args[0] and $statFreeze isnot true>>
		<<set $livestock_obey += $args[0]>>
		<<set $livestock_obey = Math.clamp($livestock_obey, 0, 100)>>
	<</if>>
<</widget>>

<<widget "shame">>
<<if $args[0] and $statFreeze isnot true>>
	<<set $shame += $args[0]>>
	<<set $shame = Math.clamp($shame, 0, 100)>>
<</if>>
<</widget>>

<<widget "farm_yield">>
<<if $farm_yield is undefined>>
	<<set $farm_yield to 0>>
<</if>>
<<if $args[0] and $statFreeze isnot true>>
	<<set $farm_yield += $args[0]>>
<</if>>
<</widget>>

<<widget "oralskill">>
<<if $args[0] and $statFreeze isnot true>>
	<<set $oralskill += $args[0]>>
<</if>>
<</widget>>

<<widget "vaginalskill">>
<<if $args[0] and $statFreeze isnot true>>
	<<set $vaginalskill += $args[0]>>
<</if>>
<</widget>>

<<widget "penileskill">>
<<if $args[0] and $statFreeze isnot true>>
	<<set $penileskill += $args[0]>>
<</if>>
<</widget>>

<<widget "handskill">>
<<if $args[0] and $statFreeze isnot true>>
	<<set $handskill += $args[0]>>
<</if>>
<</widget>>

<<widget "analskill">>
<<if $args[0] and $statFreeze isnot true>>
	<<set $analskill += $args[0]>>
<</if>>
<</widget>>

<<widget "feetskill">>
<<if $args[0] and $statFreeze isnot true>>
	<<set $feetskill += $args[0]>>
<</if>>
<</widget>>

<<widget "bottomskill">>
<<if $args[0] and $statFreeze isnot true>>
	<<set $bottomskill += $args[0]>>
<</if>>
<</widget>>

<<widget "thighskill">>
<<if $args[0] and $statFreeze isnot true>>
	<<set $thighskill += $args[0]>>
<</if>>
<</widget>>

<<widget "chestskill">>
<<if $args[0] and $statFreeze isnot true>>
	<<set $chestskill += $args[0]>>
<</if>>
<</widget>>

<<widget "beauty">>
<<if $args[0]>>
	<<set $beauty += $args[0]>>
<</if>>
<</widget>>

<<widget "seductionskill">>
<<if $args[0]>>
	<<set $seductionskill += $args[0]>>
<</if>>
<</widget>>

<<widget "skulduggery">>
<<if $args[0]>>
	<<set $skulduggery += $args[0]>>
<</if>>
<</widget>>

<<widget "prof">>
<<if $args[0] and $args[1]>>
	<<set $prof[$args[0]] += ($args[1] * 5)>>
	<<set $prof[$args[0]] to Math.clamp($prof[$args[0]], 0, 1000)>>
<</if>>
<</widget>>

<<widget "locker_suspicion">>
<<if $args[0]>>
	<<set $locker_suspicion += $args[0]>>
<</if>>
<</widget>>

<<widget "alcohol">>
<<if $args[0] and $statFreeze isnot true>>
	<<if $backgroundTraits.includes("plantlover")>>
		<<set _drunk_mod to 1.5>>
	<<else>>
		<<set _drunk_mod to 1>>
	<</if>>
	<<set $drunk += Math.floor($args[0] * _drunk_mod)>>
	<<set $drunk to Math.clamp($drunk, 0, 1000)>>
<</if>>
<</widget>>

<<widget "drugs">>
<<if $args[0] and $statFreeze isnot true>>
	<<if $backgroundTraits.includes("plantlover")>>
		<<set _drugged_mod to 1.5>>
	<<else>>
		<<set _drugged_mod to 1>>
	<</if>>
	<<set $drugged += Math.floor($args[0] * _drugged_mod)>>
	<<set $drugged to Math.clamp($drugged, 0, 1000)>>
<</if>>
<</widget>>

repo_name: Area/degrees

license: mit


code:
:: Statistics [widget]
<<widget "statistics">>

Statistics

__Virginities__

<<if $player.vaginaExist>>
	Vaginal virginity: <<print ($player.virginity.vaginal is true ? "Present" : "Taken by " + ($player.virginity.vaginal is false ? "unknown" : $player.virginity.vaginal))>>

<</if>>
<<if $player.penisExist>>
	Penile virginity: <<print ($player.virginity.penile is true ? "Present" : "Taken by " + ($player.virginity.penile is false ? "unknown" : $player.virginity.penile))>>

<</if>>

Anal virginity: <<print ($player.virginity.anal is true ? "Present" : "Taken by " + ($player.virginity.anal is false ? "unknown" : $player.virginity.anal))>>

Oral virginity: <<print ($player.virginity.oral is true ? "Present" : "Taken by " + ($player.virginity.oral is false ? "unknown" : $player.virginity.oral))>>

Handholding virginity: <<print ($player.virginity.handholding is true ? "Present" : "Taken by " + ($player.virginity.handholding is false ? "unknown" : $player.virginity.handholding))>>

First kiss: <<print ($player.virginity.kiss is true ? "Present" : "Taken by " + ($player.virginity.kiss is false ? "unknown" : $player.virginity.kiss))>>

__Virginities taken__

<<set _total to 0>>
<<for _slot, _list range $virginTaken>>
	<<set _total += _list.length>>
<</for>>
Total: _total

Vaginal: $virginTaken.vaginal.length<<print ($virginTaken.vaginal.length gte 1 ? ", including: " + $virginTaken.vaginal.join(', ') : "")>>

Penile: $virginTaken.penile.length<<print ($virginTaken.penile.length gte 1 ? ", including: " + $virginTaken.penile.join(', ') : "")>>

Anal: $virginTaken.anal.length<<print ($virginTaken.anal.length gte 1 ? ", including: " + $virginTaken.anal.join(', ') : "")>>

Oral: $virginTaken.oral.length<<print ($virginTaken.oral.length gte 1 ? ", including: " + $virginTaken.oral.join(', ') : "")>>

First hands held: $virginTaken.handholding.length<<print ($virginTaken.handholding.length gte 1 ? ", including: " + $virginTaken.handholding.join(', ') : "")>>

First kisses: $virginTaken.kiss.length<<print ($virginTaken.kiss.length gte 1 ? ", including: " + $virginTaken.kiss.join(', ') : "")>>

__Jobs__

Danced: $dancestat

Drinks served: $drinksservedstat

Tables served: $tablesservedstat

Whored yourself: $prostitutionstat

<<if $gamemode isnot "soft">>
Forcibly whored out: $forcedprostitutionstat

<</if>>
Hours worked on the docks: $dockhours

Buns sold at the cafe: $bunstat

Most "cream" produced: <<print parseFloat($creamstat.toFixed(1))>> mL

Smugglers intercepted: $smuggler_stolen_stat

Produce sold: $produce_sold

<<if $farmersProduce>>
	Produce sold in bulk: $farmersProduce.totalSold

<</if>>
Fertiliser Used: $fertiliser.used

Hours worked on a farm: <<print Math.trunc($farm_shift / 60)>>

Cattle milked: $cattle_milked

Clients serviced as a masseur: $masseur_stat

Wild plants picked: $wild_plant_stat

Aphrodisiacs sold: $stat_aphrodisiacs_sold

__Sex__

Number of orgasms you've experienced: $orgasmstat

<<if $asphyxiaLvl gte 2>>
	Orgasms while being choked: $chokeorgasm

<</if>>
Penetrated others: $penilestat

Ejaculated in others: $penileejacstat

Vaginally penetrated: $vaginalstat

Ejaculated in vaginally: $vaginalejacstat

Anally penetrated: $analstat

Ejaculated in anally: $analejacstat

Orally penetrated: $oralstat

Ejaculated in orally: $oralejacstat

Handjobs given: $handstat

Handjob ejaculations: $handejacstat

Footjobs given: $feetstat

Footjob ejaculations: $feetejacstat

Thighjobs given: $thighstat

Thighjob ejaculations: $thighejacstat

Chestjobs given: $cheststat

Chestjob ejaculations: $chestejacstat

Buttjobs given: $bottomstat

Buttjob ejaculations: $bottomejacstat

Hair ejaculated on: $hairejacstat

Tummy ejaculated on: $tummyejacstat

Neck ejaculated on: $neckejacstat

Pussy ejaculated on: $vaginalentranceejacstat

Face ejaculated on: $faceejacstat

Total times you've been ejaculated on or in: $ejacstat

Gloryholes serviced: $gloryholestat

Masturbated: $masturbationstat

Masturbated to orgasm: $masturbationorgasmstat

Minutes spent masturbating: $masturbationtimestat

Breast milk drank: $milk_drank_stat mL

Breast milk produced: $milk_produced_stat mL

Nectar drank: $nectar_drank_stat mL

<<if $player.penisExist>>
	Semen produced: <<print Math.floor($semen_produced_stat)>> mL

<</if>>
<<if $player.vaginaExist>>
	Lewd fluid produced: <<print Math.floor($lube_produced_stat)>> mL

<</if>>
Fluid forcibly milked: $fluid_forced_stat mL

<<if $knot_stat isnot undefined>>
	Knotted: $knot_stat

<</if>>

<<if $gamemode isnot "soft">>
	__Violence__

	Molested: $moleststat

	Raped: $rapestat

	<<if $bestialitydisable is "f">>
		Raped by animals: $beastrapestat

	<<else>>
		Raped by monster people: $beastrapestat

	<</if>>
	<<if $tentacledisable is "f">>
		Raped by tentacle monsters: $tentaclerapestat

	<</if>>
	<<if $voredisable is "f">>
		Swallowed: $swallowedstat

	<</if>>
	<<if $parasitedisable is "f">>
		Parasites hosted: $parasitestat

	<</if>>
	Been hit: $hitstat

	Hit others: $attackstat

	Pepper spray used: $spraystat

	<<if $NPCName[$NPCNameList.indexOf("Eden")].init>>
		Practise shots fired with Eden: $stat_shoot

	<</if>>
	Machines disabled: $machine_stat

	Lurkers captured: $stat_lurkers_captured

<</if>>

__Dates__

<<if $dateCount.Total lte 0>>
	You haven't gone on any dates!

<<else>>
	Total Dates: $dateCount.Total

	<<if $dateCount.Robin gte 1>>
		Dates with Robin: $dateCount.Robin

	<</if>>
	<<if $dateCount.Whitney gte 1>>
		Dates with Whitney: $dateCount.Whitney

	<</if>>
	<<if $dateCount.Kylar gte 1>>
		Dates with Kylar: $dateCount.Kylar

	<</if>>
	<<if $dateCount.Eden gte 1>>
		Dates with Eden: $dateCount.Eden

	<</if>>
	<<if $dateCount.Avery gte 1>>
		Dates with Avery: $dateCount.Avery

	<</if>>
	<<if $dateCount.BlackWolfHunts gte 1>>
		Hunts with the Black Wolf: $dateCount.BlackWolfHunts

	<</if>>
	<<if $dateCount.GreatHawkHunts gte 1>>
		Hunts with the Great Hawk: $dateCount.GreatHawkHunts

	<</if>>
	<<if $dateCount.Alex gte 1>>
		Dates with Alex: $dateCount.Alex

	<</if>>
	<<if $dateCount.Sydney gte 1>>
		Dates with Sydney: $dateCount.Sydney

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

/*ToDo: Pregnancy, remove check to properly enable*/
<<if $pregnancyTesting>>
	__Pregnancy__

	<<if $player.vaginaExist>>
		Times given birth: <<print $sexStats.vagina.pregnancy.totalBirthEvents>>

		Total number of children: <<print $pregnancyStats.playerChildren>>

		Total number of human children: <<print $pregnancyStats.humanChildren>>

		Total number of wolf children: <<print $pregnancyStats.wolfChildren>>

		After Morning pills taken: <<print $pregnancyStats.afterMorningPills>>

	<</if>>
	<<if $player.vaginaExist or $pregnancyStats.pregnancyTestsTaken gt 0>>
		Pregnancy tests taken: <<print $pregnancyStats.pregnancyTestsTaken>>
	<</if>>

	Anal Pregnancy Births: <<print $sexStats.anus.pregnancy.givenBirth>>

<</if>>

__Miscellaneous__

<<if $gamemode isnot "soft">>
	Rescued: $rescued

<</if>>
Clothing stripped: $clothesstripstat

Clothing ruined: $clothesruinstat

Passed out: $passoutstat

/*ToDo: Pregnancy, remove the duplicate stat*/
Anal Pregnancy Births: <<print $sexStats.anus.pregnancy.givenBirth>>

Crime History: $crimehistory

Distinctions won: $distinction_stat

Hours slept: $sleepStat

Games of blackjack played: $blackjack_played

Games of blackjack won: $blackjack_won

Highest blackjack streak: $blackjack_streak_high

Underwear stolen: $stat_panties_stolen

Sentenced with community service: $stat_police.community

Sentenced with the pillory:	$stat_police.pillory

Days in prison: $stat_police.prison

Hypnotised: $hypnotised

__Save Game Details__
<<if $saveDetails isnot undefined>>

	Normal saves count: <<print $saveDetails.slot.count>>

	Exported saves count: <<print $saveDetails.exported.count>>

	Auto saves count: <<print $saveDetails.auto.count>>

<</if>>
<<if $saveVersions isnot undefined>>
	Versions Played On:

	<<for _i to 0; _i lt $saveVersions.length; _i++>>
		<<if _i gt 0>>
			<<if V.saveVersions[_i].split(".")[2] is V.saveVersions[_i - 1].split(".")[2]>>
				--
			<<else>>

			<</if>>
		<</if>>
		$saveVersions[_i]
	<</for>>

<</if>>
<<if $saveVersion>>
	Save loaded from version: $saveVersion
<</if>>
<</widget>>

<<widget "extraStatisticsWarning">>

<<if $skipStatisticsConfirmation is undefined>><<set $skipStatisticsConfirmation to false>><</if>>

Extra Statistics

	Are you sure you want to see these? They may contain spoilers!

	<<link Yes>>
		<<overlayReplace "extraStatistics">>
	<</link>>
	   <<checkbox "$skipStatisticsConfirmation" false true autocheck>> Don't Show Again

<</widget>>

<<widget "extraStatistics">>

Extra Statistics

	__State__

	Pain: <<print Math.trunc($pain)>>

	Arousal: <<print Math.trunc($arousal)>>

	Fatigue: <<print Math.trunc($tiredness)>>

	Stress: <<print Math.trunc($stress)>>

	Trauma: <<print Math.trunc($trauma)>>

	Control: <<print Math.trunc($control)>>

	Allure: <<print Math.trunc($allure)>>

	Alcohol: <<print Math.trunc($drunk)>>

	Drugs: <<print Math.trunc($drugged)>>

	Hallucinogens: <<print Math.trunc($hallucinogen)>>

	__Characteristics__

	Purity: <<print Math.trunc($purity)>>

	Beauty: <<print Math.trunc($beauty)>>

	Physique: <<print Math.trunc($physique)>>

	Willpower: <<print Math.trunc($willpower)>>

	Awareness: <<print Math.trunc($awareness)>>

	Promiscuity: <<print Math.trunc($promiscuity)>>

	Exhibitionism: <<print Math.trunc($exhibitionism)>>

	Deviancy: <<print Math.trunc($deviancy)>>

	Corruption: <<print Math.trunc($corruption_slime)>>

	<<if $temple_rank is "initiate" or $temple_rank is "monk" or $temple_rank is "priest">>
		Grace: <<print Math.trunc($grace)>>

	<</if>>
	Submissiveness: <<print Math.trunc($submissive)>>

	Masochism: <<print Math.trunc($masochism)>>

	Sadism: <<print Math.trunc($sadism)>>

	Crossdresser progression:
	<<if $crossdressingTrait isnot undefined>>
		<<print Math.trunc($crossdressingTrait)>> %
	<<else>>
		0
	<</if>>

	Lactating: <<print ($lactating is 1 ? "True" : "False")>>

	<<if $lactating is 1>>
		Milk amount: <<print Math.trunc($milk_amount)>>

		Milk volume: <<print Math.trunc($milk_volume)>>

	<</if>>
	<<if $player.penisExist>>
		Semen amount: <<print Math.trunc($semen_amount)>>

		Semen volume: <<print Math.trunc($semen_volume)>>

	<</if>>

	__Clothes__

	<<if $worn.upper.name isnot "naked">>
		Upper wetness: <<print Math.trunc($upperwet)>>

		Upper integrity: <<print Math.trunc($worn.upper.integrity)>>

	<</if>>
	<<if $worn.lower.name isnot "naked">>
		Lower wetness: <<print Math.trunc($lowerwet)>>

		Lower integrity: <<print Math.trunc($worn.lower.integrity)>>

	<</if>>
	<<if $worn.under_upper.name isnot "naked">>
		Under Upper wetness: <<print Math.trunc($underupperwet)>>

		Under Upper integrity: <<print Math.trunc($worn.under_upper.integrity)>>

	<</if>>
	<<if $worn.under_lower.name isnot "naked">>
		Under Lower wetness: <<print Math.trunc($underlowerwet)>>

		Under Lower integrity: <<print Math.trunc($worn.under_lower.integrity)>>

	<</if>>
	<<if $worn.genitals.name isnot "naked">>
		<<print setup.clothes.genitals[clothesIndex('genitals',$worn.genitals)].name_cap>> integrity: <<print Math.trunc($worn.genitals.integrity)>>

	<</if>>

	__Social__

	School status: <<print Math.trunc($cool)>>

	Delinquency: <<print Math.trunc($delinquency)>>

	Detention: <<print Math.trunc($detention)>>

	Crime: <<print Math.trunc($crime)>>

	Orphanage hope: <<print Math.trunc($orphan_hope)>>

	Orphanage rebelliousness: <<print Math.trunc($orphan_reb)>>

	<<if $dockwork is 2>>
		Docks status: <<print Math.trunc($dockstatus)>>

	<</if>>
	Sex fame: <<print Math.trunc($famesex)>>

	Prostitution fame: <<print Math.trunc($fameprostitution)>>

	Rape fame: <<print Math.trunc($famerape)>>

	Bestiality fame: <<print Math.trunc($famebestiality)>>

	Exhibitionism fame: <<print Math.trunc($fameexhibitionism)>>

	Combat fame: <<print Math.trunc($famescrap)>>

	Kindness fame: <<print Math.trunc($famegood)>>

	Business fame: <<print Math.trunc($famebusiness)>>

	Socialite fame: <<print Math.trunc($famesocial)>>

	Model fame: <<print Math.trunc($famemodel)>>

	__Transformations__

	Wolfiness: <<print Math.trunc($wolfbuild)>> (30+ for full transformation)

	Wolf manifestation: <<print Math.trunc($wolfgirl)>>

	Cattiness: <<print Math.trunc($catbuild)>> (50+ for full transformation)

	Cat manifestation: <<print Math.trunc($cat)>>

	<<if $hallucinations gte 2 or $bestialitydisable is "t">>Harpyness<<else>>Birdieness<</if>>: <<print Math.trunc($birdbuild)>> (30+ for full transformation)

	<<if $hallucinations gte 2 or $bestialitydisable is "t">>Harpy<<else>>Bird<</if>> manifestation: <<print Math.trunc($harpy)>>

	Bovinity: <<print Math.trunc($cowbuild)>> (30+ for full transformation)

	Cow manifestation: <<print Math.trunc($cow)>>

	Bunnyness: <<print Math.trunc($bunny)>>

	Bunny manifestation: <<print Math.trunc($bunnybuild)>> (30+ for full transformation)

	Angelicness: <<print Math.trunc($angelbuild)>> (50+ for full transformation)

	Angel manifestation: <<print Math.trunc($angel)>>

	Demonicness: <<print Math.trunc($demonbuild)>> (30+ for full transformation)

	Demonic manifestation: <<print Math.trunc($demon)>>

	Fallen manifestation:
	<<if $fallenangel is undefined>>
		0
	<<else>>
		<<print Math.trunc($fallenangel)>>
	<</if>>

<</widget>>


code:
:: Widgets Tending [widget]
<<widget "plots_init">>/*First variable: location. Second variable: number of plots. Third variable: ground type (earth, water). Fourth variable: plot quality, fifth variable: plot size*/
<<set $plots[$args[0]] to []>>
<<for _i to 0; _i lt $args[1]; _i++>>
	<<set $plots[$args[0]][_i] to clone(setup.plot_base)>>
	<<set $plots[$args[0]][_i].bed to $args[2]>>
	<<set $plots[$args[0]][_i].quality to $args[3]>>
	<<set $plots[$args[0]][_i].size to $args[4]>>
<</for>>

<</widget>>

<<widget "add_plot">>/*Adds a plot to an existing location. Arguments are as in the plots_init widget, but the second variable and beyond are shifted down one.*/
	<<set _i to $plots[$args[0]].length>>
	<<set $plots[$args[0]].push(clone(setup.plot_base))>>
	<<set $plots[$args[0]][_i].bed to $args[1]>>
	<<set $plots[$args[0]][_i].quality to $args[2]>>
	<<set $plots[$args[0]][_i].size to $args[3]>>
<</widget>>

<<widget "clear_plot">>/*Returns a plot to its default state. First argument: location. Second argument: index of plot to be reset.*/
	<<if $plots[$args[0]][$args[1]].baseQuality isnot undefined and $backgroundTraits.includes("greenthumb") is false>>
		<<if $plots[$args[0]][$args[1]].fertiliserDecay gt 0>>
			<<set $plots[$args[0]][$args[1]].fertiliserDecay-->>
		<</if>>
		<<if $plots[$args[0]][$args[1]].fertiliserDecay is 0 and $plots[$args[0]][$args[1]].quality > $plots[$args[0]][$args[1]].baseQuality>>
			<<set $plots[$args[0]][$args[1]].quality-->>
			<<set $plotDecay to 2>>
			<<if $plots[$args[0]][$args[1]].quality > $plots[$args[0]][$args[1]].baseQuality>>
				<<set $plots[$args[0]][$args[1]].fertiliserDecay to 2>>
				<<if $plots[$args[0]][$args[1]].size isnot "large">>
					<<set $plots[$args[0]][$args[1]].fertiliserDecay++>>
				<</if>>
				<<set $plotDecay to 1>>
			<</if>>
		<</if>>
	<</if>>

	<<set $plots[$args[0]][$args[1]].water to 0>>
	<<set $plots[$args[0]][$args[1]].days to 0>>
	<<set $plots[$args[0]][$args[1]].plant to "none">>
	<<set $plots[$args[0]][$args[1]].till to 0>>
	<<set $plots[$args[0]][$args[1]].stage to 0>>
<</widget>>

<<widget "display_quality">>
<<silently>>
<<switch $plots[$args[0]][$args[1]].bed>>
	<<case "water">><<set _bedType to "water">>
	<<case "earth">><<set _bedType to "soil">>
	<<default>><<set _bedType to clone($plots[$args[0]][$args[1]].bed)>>
<</switch>>
<<if $plots[$args[0]][$args[1]].quality is 1>>
	<<set $_result to `<span class="blue">poor `+_bedType+`</span>`>>
<<elseif $plots[$args[0]][$args[1]].quality is 2>>
	<<set $_result to `<span class="lblue">decent `+_bedType+`</span>`>>
<<elseif $plots[$args[0]][$args[1]].quality is 3>>
	<<set $_result to `<span class="teal">good `+_bedType+`</span>`>>
<<elseif $plots[$args[0]][$args[1]].quality gt 3>>
	<<set $_result to `<span class="green">excellent `+_bedType+`</span>`>>
<</if>>
<</silently>><<print $_result>>
<</widget>>

<<widget "display_plot">>/*Argument is the plot location you want to display.*/
<<set _water_needed to 0>>
There are <<number $plots[$args[0]].length>> tillable
<<if $plots[$args[0]][0].size is "small">>
	beds
<<elseif $plots[$args[0]][0].size is "medium">>
	plots
<<else>>
	fields
<</if>>
here. <<if $fertiliser.current gt 0 or $fertiliser.used gt 0>>You have <<number $fertiliser.current>> fertiliser.<</if>> Tilling time is reduced by tending skill.

<<for _i to 0; _i lt $plots[$args[0]].length; _i++>>
<<set _tending_temp to _i>>
<<capture _tending_temp>>
<<wordify_i _i cap>> plot (<<display_quality $args[0] _tending_temp>>):
	<<if $plots[$args[0]][_i].stage gte 5>>
		The <<print setup.plants[$plots[$args[0]][_i].name].plural>> are flowering, and ready for picking.

		<<if $plots[$args[0]][_tending_temp].size is "small">>
			<<link [[Pick (0:05)|$passage]]>><<pass 5>><<set $tending_harvest to 1>><<set $tending_harvest_name to clone($plots[$args[0]][_tending_temp].name)>><<set $tending_harvest_size to "small">><<set $tending_harvest_quality to clone($plots[$args[0]][_tending_temp].quality)>><<clear_plot $args[0] _tending_temp>><</link>>

		<<elseif $plots[$args[0]][_tending_temp].size is "medium">>
			<<link [[Pick (0:15)|$passage]]>><<pass 15>><<set $tending_harvest to 1>><<set $tending_harvest_name to clone($plots[$args[0]][_tending_temp].name)>><<set $tending_harvest_size to "medium">><<set $tending_harvest_quality to clone($plots[$args[0]][_tending_temp].quality)>><<clear_plot $args[0] _tending_temp>><</link>>

		<<else>>
			<<link [[Harvest (1:00)|$passage]]>><<pass 60>><<set $tending_harvest to 1>><<set $tending_harvest_name to clone($plots[$args[0]][_tending_temp].name)>><<set $tending_harvest_size to "large">><<set $tending_harvest_quality to clone($plots[$args[0]][_tending_temp].quality)>><<clear_plot $args[0] _tending_temp>><</link>>

		<</if>>
	<<elseif $plots[$args[0]][_i].stage is 4>>
		The <<print setup.plants[$plots[$args[0]][_i].name].plural>> are budding.
	<<elseif $plots[$args[0]][_i].stage is 3>>
		The <<print setup.plants[$plots[$args[0]][_i].name].plural>> have grown into seedlings.
	<<elseif $plots[$args[0]][_i].stage is 2>>
		Thin <<print setup.plants[$plots[$args[0]][_i].name].plural>> sprout from the soil.
	<<elseif $plots[$args[0]][_i].stage is 1>>
		You planted <<print setup.plants[$plots[$args[0]][_i].name].name.replace(/_/g," ")>> seeds here.
	<<else>>
		<<if $plots[$args[0]][_i].till gte 1>>
			The soil is ready for planting.
			<<if $plants_known.length is 0>>
				Search wild areas for seeds to plant.
			<</if>>
			<<for _e to 0; _e lt $plants_known.length; _e++>>
			<<capture _e>>

			<<switch $args[0]>>
				<<case "farm">>
					<<if $farm.irrigation>>
						<<set _irrigation to $farm.irrigation>>
					<<else>>
						<<set _irrigation to 0>>
					<</if>>
				<<default>>
					<<set _irrigation to 0>>
			<</switch>>
			<<if setup.plants[$plants_known[_e]].season.includes($season) or ($args[0] is "garden" and $alex_greenhouse gte 3)>>
				<<if setup.plants[$plants_known[_e]].bed is $plots[$args[0]][_i].bed>>
					<<if $plots[$args[0]][_i].size is "small">>
						<<link `"Plant " + setup.plants[$plants_known[_e]].plural + " (0:30)"` $passage>><<pass 30>><<set $plots[$args[0]][_tending_temp].name to $plants_known[_e]>><<set $plots[$args[0]][_tending_temp].stage to 1>><<set $plot_planted to 1>><<if $weather is "rain" or _i lt _irrigation>><<set $plots[$args[0]][_tending_temp].water to 1>><</if>><</link>> (<<print setup.plants[$plants_known[_e]].days>> days)
					<<elseif $plots[$args[0]][_i].size is "medium">>
						<<link `"Plant " + setup.plants[$plants_known[_e]].plural + " (1:30)"` $passage>><<pass 90>><<set $plots[$args[0]][_tending_temp].name to $plants_known[_e]>><<set $plots[$args[0]][_tending_temp].stage to 1>><<set $plot_planted to 1>><<if $weather is "rain" or _i lt _irrigation>><<set $plots[$args[0]][_tending_temp].water to 1>><</if>><</link>> (<<print setup.plants[$plants_known[_e]].days>> days)
					<<else>>
						<<link `"Plant " + setup.plants[$plants_known[_e]].plural + " (3:00)"` $passage>><<pass 3 hours>><<set $plots[$args[0]][_tending_temp].name to $plants_known[_e]>><<set $plots[$args[0]][_tending_temp].stage to 1>><<set $plot_planted to 1>><<if $weather is "rain" or _i lt _irrigation>><<set $plots[$args[0]][_tending_temp].water to 1>><</if>><</link>> (<<print setup.plants[$plants_known[_e]].days>> days)
					<</if>>
				<<else>>
					<<print setup.plants[$plants_known[_e]].plural.toLocaleUpperFirst()>> only grow in <<print setup.plants[$plants_known[_e]].bed>>.
				<</if>>
			<<else>>
				<<tending_season_notice>>
			<</if>>
			<</capture>>
			<</for>>

		<<else>>
			The soil is ready for tilling.

			<<if currentSkillValue('tending') gte 1500>>
				<<set _baseTime to 3>>
				<<set _baseTiredsness to 1>>
			<<elseif currentSkillValue('tending') gte 1200>>
				<<set _baseTime to 4>>
				<<set _baseTiredsness to 1>>
			<<elseif currentSkillValue('tending') gte 1000>>
				<<set _baseTime to 5>>
				<<set _baseTiredsness to 1>>
			<<elseif currentSkillValue('tending') gte 800>>
				<<set _baseTime to 10>>
				<<set _baseTiredsness to 2>>
			<<elseif currentSkillValue('tending') gte 600>>
				<<set _baseTime to 15>>
				<<set _baseTiredsness to 3>>
			<<elseif currentSkillValue('tending') gte 400>>
				<<set _baseTime to 20>>
				<<set _baseTiredsness to 4>>
			<<elseif currentSkillValue('tending') gte 200>>
				<<set _baseTime to 25>>
				<<set _baseTiredsness to 5>>
			<<else>>
				<<set _baseTime to 30>>
				<<set _baseTiredsness to 6>>
			<</if>>
			<<if $plots[$args[0]][_i].size is "medium">>
				<<set _baseTime *= 3>>
				<<set _baseTiredsness *= 2>>
			<<elseif $plots[$args[0]][_i].size is "large">>
				<<set _baseTime *= 12>>
				<<set _baseTiredsness *= 6>>
			<</if>>
			<<if _baseTime % 60 is 0>>
				<<set _baseHours to _baseTime / 60>>
			<</if>>
			<<set _displayedMinutes to _baseTime % 60>>
			<<set _displayedHours to (_baseTime - _displayedMinutes) / 60>>
			<<if _displayedMinutes lt 10>>
				<<set _displayedMinutes to "0" + _displayedMinutes>>
			<</if>>
			<<capture _baseTiredsness _baseHours _baseTime>>
				<<link [["Till (" + _displayedHours + ":" + _displayedMinutes + ")"|$passage]]>>
					<<set $plot_tilled to 1>>
					<<tiredness _baseTiredsness>><<physique _baseTiredsness>>
					<<if _baseHours>>
						<<pass _baseHours hours>>
					<<else>>
						<<pass _baseTime>>
					<</if>>
					<<if $location is "farm">>
						<<farm_count _baseTime>>
					<</if>>
					<<set $plots[$args[0]][_tending_temp].till to 1>>
				<</link>><<gtiredness>>
			<</capture>>

			<<if $fertiliser.current gte 1 and $plots[$args[0]][_i].quality lt 4 and $tending gte 400>>
				<<set _baseTimeFert to Math.floor(_baseTime * 1.5)>>
				<<if _baseTimeFert % 60 is 0>>
					<<set _baseHoursFert to _baseTimeFert / 60>>
				<</if>>
				<<set _displayedMinutesFert to _baseTimeFert % 60>>
				<<set _displayedHoursFert to (_baseTimeFert - _displayedMinutesFert) / 60>>
				<<if _displayedMinutesFert lt 10>>
					<<set _displayedMinutesFert to "0" + _displayedMinutesFert>>
				<</if>>
				<<capture _baseTimeFert _baseHoursFert _baseTiredsness>>
					<<link [["Till and apply fertiliser (" + _displayedHoursFert + ":" + _displayedMinutesFert + ")"|$passage]]>>
						<<set $plot_tilled_fertiliser to 1>>
						<<tiredness `Math.floor(_baseTiredsness * 1.5)`>>
						<<physique `Math.floor(_baseTiredsness * 1.5)`>>
						<<if _baseHoursFert>>
							<<pass _baseHoursFert hours>>
						<<else>>
							<<pass _baseTimeFert>>
						<</if>>
						<<if $location is "farm">>
							<<farm_count _baseTimeFert>>
						<</if>>
						<<set $plots[$args[0]][_tending_temp].till to 1>>
						<<set $fertiliser.current-->><<set $fertiliser.used++>>
						<<set $plots[$args[0]][_tending_temp].quality++>>
						<<if $backgroundTraits.includes("greenthumb") is false>>
							<<if $plots[$args[0]][_tending_temp].baseQuality is undefined>>
								<<set $plots[$args[0]][_tending_temp].baseQuality to clone($plots[$args[0]][_tending_temp].quality - 1)>>
							<</if>>
							<<set $plots[$args[0]][_tending_temp].fertiliserDecay to 2>>
							<<if $plots[$args[0]][_tending_temp].size isnot "large">>
								<<set $plots[$args[0]][_tending_temp].fertiliserDecay++>>
							<</if>>
						<</if>>
					<</link>><<gtiredness>>
				<</capture>>

			<</if>>
		<</if>>
	<</if>>
	<<if $plots[$args[0]][_i].stage gte 1>>
		<<if $plots[$args[0]][_i].bed is "water">>

		<<elseif $plots[$args[0]][_i].water is 1>>
			The <<if $plots[$args[0]][_i].bed is "large">>field<<else>>plot<</if>> is watered.

		<<elseif $plots[$args[0]][_i].stage isnot 5 and $plots[$args[0]][_i].water isnot 1>>
			The <<if $plots[$args[0]][_i].bed is "large">>field<<else>>plot<</if>> is dry.

			<<set _water_needed += 1>>
			<<if $plots[$args[0]][_i].size is "small">>
				<<link [[Water (0:05)|$passage]]>><<tending 1>><<pass 5>><<set $plots[$args[0]][_tending_temp].water to 1>><<set $plot_watered to 1>><<tiredness 1>><<physique 1>><<event_trigger>><</link>><<gtiredness>><<gtending>>

			<<elseif $plots[$args[0]][_i].size is "medium">>
				<<link [[Water (0:15)|$passage]]>><<tending 2>><<pass 15>><<set $plots[$args[0]][_tending_temp].water to 1>><<set $plot_watered to 1>><<tiredness 2>><<physique 2>><<event_trigger>><</link>><<gtiredness>><<gtending>>

			<<else>>
				<<link [[Water (1:00)|$passage]]>><<tending 6>><<pass 60>><<set $plots[$args[0]][_tending_temp].water to 1>><<set $plot_watered to 1>><<tiredness 6>><<physique 6>><<event_trigger>><</link>><<gtiredness>><<gtending>>

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

<</for>>
<<if _water_needed gte 1>>
	<<if $plots[$args[0]][0].size is "small">>
		<<link [[Water all dry beds (0:05 per bed)|$passage]]>>
			<<for _i to 0; _i lt $plots[$args[0]].length; _i++>><<capture _i>>
				<<if $plots[$args[0]][_i].stage gte 1 and $plots[$args[0]][_i].stage lt 5 and $plots[$args[0]][_i].bed isnot "water" and $plots[$args[0]][_i].water is 0>>
					<<set $plots[$args[0]][_i].water to 1>><<pass 5>><<tending 1>><<event_trigger>>
				<</if>>
			<</capture>>
			<</for>>
			<<set $plots_watered to 1>>
			<<tiredness _water_needed>><<physique _water_needed>>
		<</link>><<gtiredness>><<gtending>>

	<<elseif $plots[$args[0]][0].size is "medium">>
		<<link [[Water all dry plots (0:15 per plot)|$passage]]>>
			<<for _i to 0; _i lt $plots[$args[0]].length; _i++>><<capture _i>>
				<<if $plots[$args[0]][_i].stage gte 1 and $plots[$args[0]][_i].stage lt 5 and $plots[$args[0]][_i].bed isnot "water" and $plots[$args[0]][_i].water is 0>>
					<<set $plots[$args[0]][_i].water to 1>><<pass 15>><<tending 2>><<event_trigger>>
				<</if>>
			<</capture>>
			<</for>>
			<<set $plots_watered to 1>>
			<<set _water_needed_calculation to (_water_needed * 6)>>
			<<tiredness _water_needed_calculation>><<physique _water_needed_calculation>>
		<</link>><<gtiredness>><<gtending>>

	<<else>>
		<<link [[Water all dry fields (1:00 per field)|$passage]]>>
			<<for _i to 0; _i lt $plots[$args[0]].length; _i++>><<capture _i>>
				<<if $plots[$args[0]][_i].stage gte 1 and $plots[$args[0]][_i].stage lt 5 and $plots[$args[0]][_i].bed isnot "water" and $plots[$args[0]][_i].water is 0>>
					<<set $plots[$args[0]][_i].water to 1>><<pass 60>><<tending 6>><<event_trigger>>
				<</if>>
			<</capture>>
			<</for>>
			<<set $plots_watered to 1>>
			<<set _water_needed_calculation to (_water_needed * 6)>>
			<<tiredness _water_needed_calculation>><<physique _water_needed_calculation>>
		<</link>><<ggtiredness>><<gtending>>

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

<<widget "plot_effects">>
<<if $plot_watered is 1>><<unset $plot_watered>>
	You water the plot. You get a good workout.

<<elseif $plots_watered is 1>><<unset $plots_watered>>
	You water the plots. You get a good workout.

<</if>>
<<if $tending_harvest is 1>>
	<<tending_harvest $tending_harvest_name $tending_harvest_size $tending_harvest_quality>>
	<<unset $tending_harvest>><<unset $tending_harvest_name>><<unset $tending_harvest_size>><<unset $tending_harvest_quality>>

<</if>>
<<if $plot_tilled is 1>>
	You get to work removing weeds and tilling the soil. It's hard going, but when you're done the soil is ready for planting. You get a good workout.
	<<unset $plot_tilled>>

<</if>>
<<if $plot_tilled_fertiliser is 1>>
	You get to work removing weeds and tilling the soil while mixing in some fertiliser. It's hard going, but when you're done the soil is ready for planting. You get a good workout.
	<<unset $plot_tilled_fertiliser>>
<</if>>
<<if $plot_planted is 1>>
	You plant the seeds in the cool earth.
	<<unset $plot_planted>>

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

<<widget "tending_day">>
<<set _plotKeys to Object.keys($plots)>>
<<for _s to 0; _s lt _plotKeys.length; _s++>>
	<<set _plot to _plotKeys[_s]>>
	<<switch _plot>>
		<<case "farm">>
			<<if $farm.irrigation>>
				<<set _irrigation to $farm.irrigation>>
			<<else>>
				<<set _irrigation to 0>>
			<</if>>
		<<default>>
			<<set _irrigation to 0>>
	<</switch>>
	<<for _t to 0; _t lt $plots[_plot].length; _t++>>
		<<capture _t>>
		<<if $plots[_plot][_t].stage gte 1 and ($plots[_plot][_t].water is 1 or $plots[_plot][_t].bed is "water")>>
			<<set $plots[_plot][_t].days += 1>>
		<</if>>
		<<switch $plots[_plot][_t].stage>>
		<<case 4>>
			<<if $plots[_plot][_t].days gte setup.plants[$plots[_plot][_t].name].days and ($plots[_plot][_t].water is 1 or $plots[_plot][_t].bed is "water")>>
				<<set $plots[_plot][_t].stage to 5>>
			<</if>>
		<<case 3>>
			<<if $plots[_plot][_t].days gte (setup.plants[$plots[_plot][_t].name].days / 5) * 4 and ($plots[_plot][_t].water is 1 or $plots[_plot][_t].bed is "water")>>
				<<set $plots[_plot][_t].stage to 4>>
			<</if>>
		<<case 2>>
			<<if $plots[_plot][_t].days gte (setup.plants[$plots[_plot][_t].name].days / 5) * 3 and ($plots[_plot][_t].water is 1 or $plots[_plot][_t].bed is "water")>>
				<<set $plots[_plot][_t].stage to 3>>
			<</if>>
		<<case 1>>
			<<if $plots[_plot][_t].days gte (setup.plants[$plots[_plot][_t].name].days / 5) * 2 and ($plots[_plot][_t].water is 1 or $plots[_plot][_t].bed is "water")>>
				<<set $plots[_plot][_t].stage to 2>>
			<</if>>
		<</switch>>
		<<if $weather is "rain">>
			<<set $plots[_plot][_t].water to 1>>
		<<elseif _irrigation gt 0>>
			<<set $plots[_plot][_t].water to 1>>
			<<set _irrigation-->>
		<<else>>
			<<set $plots[_plot][_t].water to 0>>
		<</if>>
		<</capture>>
	<</for>>
<</for>>
<</widget>>

<<widget "tending_harvest">>
<<if $plants[$args[0]] is undefined>>
	<<set $plants[$args[0]] to {}>>
	<<set $plants[$args[0]].amount to 0>>
<</if>>
<<if $args[1] is "small">>
	<<set _tending_amount to random(10, (currentSkillValue('tending') / 20) + 10)>>
<<elseif $args[1] is "medium">>
	<<set _tending_amount to random(10, (currentSkillValue('tending') / 10) + 20)>>
<<else>>
	<<set _tending_amount to random(10, (currentSkillValue('tending') / 2) + 50)>>
<</if>>
<<set _tending_amount *= clone(setup.plants[$args[0]].multiplier)>>
<<if $args[2] gte 4>>
	<<set _tending_amount *= 1.6>>
<<elseif $args[2] is 3>>
	<<set _tending_amount *= 1.4>>
<<elseif $args[2] is 2>>
	<<set _tending_amount *= 1.2>>
<</if>>
<<if !$backgroundTraits.includes("greenthumb") and $tending is 1000 and ($fertiliser.used gte 40 or ($fertiliser.used gte 25 and $farm_stage gte 6)) and $plants_known.length gte 16>>
	<<run $backgroundTraits.pushUnique("greenthumb")>>
	Spending a large amount of time in the dirt has given you a green thumb.

<</if>>
<<if $backgroundTraits.includes("greenthumb")>>
	<<set _tending_amount *= 1.2>>
<</if>>
<<set _tending_amount to Math.trunc(_tending_amount)>>
<<set $plants[$args[0]].amount += _tending_amount>>
<<set $plants[$args[0]].plural to clone(setup.plants[$args[0]].plural)>>
<<set $plants[$args[0]].name to clone(setup.plants[$args[0]].name)>>
You harvest <<number _tending_amount>> <<print setup.plants[$args[0]].plural>>.
<<if $plotDecay>>
	The fertiliser effect has decayed<<if $plotDecay is 2>> completely<</if>>.
	<<unset $plotDecay>>
<</if>>
<</widget>>

<<widget "tending_pick">>
<<if $plants[$args[0]] is undefined>>
	<<set $plants[$args[0]] to {}>>
	<<set $plants[$args[0]].amount to 0>>
<</if>>
<<set $plants[$args[0]].plural to clone(setup.plants[$args[0]].plural)>>
<<set $plants[$args[0]].name to clone(setup.plants[$args[0]].name)>>

<<if $args[2] gte 1>>
	<<set _tending_amount to random($args[1], $args[2])>>
<<else>>
	<<set _tending_amount to random(1, 5)>>
<</if>>

<<if !setup.plants[$args[0]].special.includes("large")>>
	<<set _tending_amount *= (1 + (currentSkillValue('tending') / 1000))>>
<</if>>
<<if $backgroundTraits.includes("greenthumb")>>
	<<set _tending_amount *= 1.2>>
<</if>>
<<set _tending_amount to Math.trunc(_tending_amount)>>
<<set $plants[$args[0]].amount += _tending_amount>>
<<set $wild_plant_stat += _tending_amount>>
You pick
<<if _tending_amount is 1>>
	a <<print setup.plants[$args[0]].name.replace(/_/g," ")>>.
<<else>>
	<<number _tending_amount>> <<print setup.plants[$args[0]].plural>>.
<</if>>
<</widget>>

<<widget "tending_give">>
<<if $args[0]>>
	<<if $plants[$args[0]] is undefined>>
		<<set $plants[$args[0]] to {}>>
		<<set $plants[$args[0]].amount to 0>>
	<</if>>
	<<set $plants[$args[0]].plural to clone(setup.plants[$args[0]].plural)>>
	<<set $plants[$args[0]].name to clone(setup.plants[$args[0]].name)>>
	<<if $args[1]>>
		<<set $plants[$args[0]].amount += $args[1]>>
	<<else>>
		<<set $plants[$args[0]].amount += 1>>
	<</if>>
<</if>>
<</widget>>

<<widget "tending_season_notice">>

<<print setup.plants[$plants_known[_e]].plural[0].toUpperCase() + setup.plants[$plants_known[_e]].plural.substring(1)>> can only be planted in
<<set _season_notice to clone(setup.plants[$plants_known[_e]])>>
<<for _x to 0; _x lt setup.plants[$plants_known[_e]].season.length; _x++>>
	<<if _season_notice.season.includes("spring")>>
		spring<<if setup.plants[$plants_known[_e]].season.length is _x + 1>>.<<else>>,<</if>>
		<<set _season_notice.season.delete("spring")>>
		<<set _season_noted to true>>
		<<continue>>
	<<elseif _season_notice.season.includes("summer")>>
		<<if setup.plants[$plants_known[_e]].season.length is _x + 1 and _season_noted>>and <</if>>summer<<if setup.plants[$plants_known[_e]].season.length is _x + 1>>.<<else>>,<</if>>
		<<set _season_notice.season.delete("summer")>>
		<<set _season_noted to true>>
		<<continue>>
	<<elseif _season_notice.season.includes("autumn")>>
		<<if setup.plants[$plants_known[_e]].season.length is _x + 1 and _season_noted>>and <</if>>autumn<<if setup.plants[$plants_known[_e]].season.length is _x + 1>>.<<else>>,<</if>>
		<<set _season_notice.season.delete("autumn")>>
		<<set _season_noted to true>>
		<<continue>>
	<<elseif _season_notice.season.includes("winter")>>
		<<if setup.plants[$plants_known[_e]].season.length is _x + 1 and _season_noted>>and <</if>>winter<<if setup.plants[$plants_known[_e]].season.length is _x + 1>>.<<else>>,<</if>>
		<<set _season_notice.season.delete("winter")>>
		<<set _season_noted to true>>
		<<continue>>
	<</if>>
<</for>>

<<unset _season_noted>>
<</widget>>