code:
:: Widgets Journal [widget]
<<widget "journal">>

Journal

<<if $season is "winter">>

<<else>>

<</if>>

<<if $rentday isnot undefined>>
	<<if $renttime lte 0>>
		Bailey is looking for you, and wants <<printmoney $rentmoney>>.

	<<else>>
		Bailey wants <<printmoney $rentmoney>> on <<rentday>>.

	<</if>>
<<elseif $rentmoney isnot undefined>>
	Bailey wants <<printmoney $rentmoney>>.

<</if>>

<<if $psych is 1>>
	You have an appointment with Doctor Harper on Friday.

<</if>>

<<if $eden_asylum_window is 1 and $location is "asylum">>
	<<if $hour lt 22>>
		Eden will be watching the asylum at <<ampm 20 00>> tonight.
	<<else>>
		Eden is watching the asylum, waiting for you to mark your room.
	<</if>>
<</if>>

<<if $edendistract gte 1 and $location is "asylum">>
	<<if $hour lt 21>>
		Eden will create a distraction at <<ampm 21 00>> tonight.
	<</if>>
<</if>>

<<if $brothelshowdata.type isnot "none" and $brothelshowdata.intro>>
	<<if $weekday is 6 and not $brothelshowdata.done>>
		You're expected to perform at the brothel today.

	<<else>>
		You're expected to perform at the brothel on Friday.

	<</if>>
<<elseif $brothelshowdata.intro>>
	You can star in shows at the brothel.

<</if>>

<<if $dockwork gte 2>>
	You can work at the docks starting from <<ampm 7 00>> - <<ampm 8 00>> on any day except school days.

<</if>>

<<if $pubtask2 is 1>>
	Return the black box to Landry at the pub.

<<elseif $pubtask is "forest">>
	Landry wants you to retrieve a black box from the forest.

<<elseif $pubtask is "moor">>
	Landry wants you to retrieve a black box from the moor.

<</if>>

<<if $police_hack is 1>>
	Landry might be able to help you with the locked police computer.

<<elseif $pub_hack_job is 1>>
	Landry wants you to find a young hacker living at the Domus street orphanage.

<<elseif $pub_hack_job is 2>>
	Convince the hacker to work with you.

<<elseif $pub_hack_job is 3>>
	<<if not $hacker_tasks.includes("bailey")>>
		The hacker wants you to implant a device on Bailey's computer while Bailey is logged in.

	<</if>>
	<<if not $hacker_tasks.includes("leighton")>>
		The hacker wants you to steal memory cards from a strongbox under Leighton's desk.

	<</if>>
	<<if $hacker_tasks.length gte 2>>
		You need to talk to Landry about the hacker.

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

<<if $community_service gte 1>>
	<<if $community_service_done is 1>>
		You've performed your community service today.
	<<elseif ["asylum","prison"].includes($location)>>
		Your sentence of community service has been put on hold due to your <<if $location is "prison">>incarceration<<else>>treatment<</if>>.
	<<elseif $hour gte 21>>
		It's too late in the day to perform your community service.
	<<elseif $hour lt 6>>
		The police station is expecting you later for your daily community service.
	<<else>>
		The police station is expecting you for your daily community service.
	<</if>>
	<<if $community_service is 1>>
		You have one day of community service remaining.
	<<else>>
		You have $community_service days of community service remaining.
	<</if>>

<</if>>

<<if $robindebtevent gte 1 and $docksrobinintro isnot 1>>
	Robin is missing. They were taken to the docks on Mer Street.

<</if>>

<<if $averydate is 1 and $hour lte 21 and $averydatedone isnot 1>>
	You have a date scheduled with Avery. They'll wait for you on Domus Street between <<ampm 20 00>> and <<ampm 21 00>>.

<</if>>

<<if $valentines is 1>>
	Valentine's day is held on February 14th.
	<<if $valentines_eden is 1 and !$valentines_eden_bought>>
		You can buy something for Eden to celebrate.
	<<elseif $valentines_eden_bought is 1>>
		You can prepare a bath for Eden on Valentine's day at <<ampm 17 00>>.
	<</if>>

<</if>>

<<if $halloween is 1>>
	Halloween is held on October 31st.
	<<if $halloween_whitney is 1 and $NPCName[$NPCNameList.indexOf("Whitney")].state isnot "dungeon">>
		Whitney will be trick-or-treating on Domus Street from <<ampm 19 00>>.
	<</if>>
	<<if $halloween_robin is 1 and $robinmissing isnot 1>>
		Robin wants to go trick-or-treating between <<ampm 16 00>> and <<ampm 19 00>>.
	<</if>>
	<<if $halloween_kylar is 1 and $NPCName[$NPCNameList.indexOf("Kylar")].state isnot "prison">>
		Kylar has asked you to meet in the park after <<ampm 21 00>>.
	<</if>>
	<<if $halloween_eden is 1>>
		You can buy sweets for Eden to celebrate Halloween.
	<</if>>

<</if>>

<<if $christmas is 1>>
	<<if $monthday is 25>>
		<<if $hour lte 20>>
			The orphans are celebrating Christmas.

		<</if>>
	<<else>>
		The orphans will celebrate Christmas on the 25th as best they can.

	<</if>>
	<<if $christmas_gift is undefined>>
		You can buy them gifts at the shopping centre.

	<<elseif $christmas_gift is "clothes_unwrapped">>
		You can wrap their gifts in your room at the orphanage.

	<</if>>
	<<if $christmas_gift_robin is undefined and $NPCName[$NPCNameList.indexOf("Robin")].init is 1>>
		You can buy Robin a gift at the shopping centre<<if $forest_shop_intro is 1>> or forest shop<</if>>.

	<<elseif $christmas_gift_robin and $christmas_gift_robin_wrapped isnot 1 and $NPCName[$NPCNameList.indexOf("Robin")].init is 1>>
		You can wrap Robin's gift in your room.

	<</if>>
	<<if !$christmas_wrap>>
		The shopping centre should sell wrapping paper.

	<</if>>
	<<if $syndromeeden gte 1>>
		<<if $monthday is 25>>
			<<if $hour lte 20>>
				You can celebrate Christmas with Eden today.

			<</if>>
		<<else>>
			Christmas is coming. You can celebrate it with Eden.

		<</if>>
	<</if>>
	<<if $christmas_gift_eden is undefined and $syndromeeden gte 1>>
		You can buy Eden a gift at the shopping centre.

	<</if>>
	<<if $edenmeal is 1>>
		Eden's invited you for a Christmas dinner at <<ampm 18 00>>.

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

<<if $temple_rank is "prospective">>
	Jordan has offered you a place at the temple, but you must first pass the trial of purity.

<<elseif $temple_rank is "initiate">>
	You are an initiate at the temple.
	<<if $temple_chastity_timer lte 0>>
		You have a chastity exam due.
	<<elseif $temple_chastity_timer is 1>>
		You have a chastity exam due tomorrow.
	<<else>>
		You have a chastity exam due in $temple_chastity_timer days.
	<</if>>
	You will receive an allowance when passing the exam.

<</if>>

<<if $chef_state is 4>>
	Sam wants you to visit an address on Nightingale Street.

<<elseif $chef_state is 7 and $chef_rework lte 0>>
	The renovations at the Ocean Breeze have finished.

<<elseif $chef_state is 7 and $chef_rework lte 30>>
	The Ocean Breeze is closed for renovations. They will be done in $chef_rework days.

<<elseif $chef_state is 7>>
	The Ocean Breeze will close for renovations in <<print ($chef_rework - 30)>> days.

<<elseif $chef_state is 8>>
	Sam wants you to attend the Ocean Breeze's grand reopening on any evening between <<ampm 18 00>> and <<ampm 21 00>>.

<</if>>

<<if $smuggler_known is 1 and $smuggler_timer gte 0>>
	Smugglers are bringing something valuable into town
	<<if $smuggler_timer is 0>>
		tonight, before midnight.
	<<elseif $smuggler_timer is 1>>
		tomorrow, before midnight.
	<<else>>
		in $smuggler_timer days.
	<</if>>
	<<if $smuggler_location is "forest">>
		They're bringing it through the forest.
	<<elseif $smuggler_location is "sewer">>
		They're bringing it through the old sewers.
	<<elseif $smuggler_location is "beach">>
		They plan to land at that rock near the beach.
	<<elseif $smuggler_location is "bus">>
		They're sneaking it in on a bus.
	<</if>>

<</if>>

<<if $mason_pond is 1>>
	Mason mentioned a stream under Domus Street, which could be used to make a spring. You'd need Bailey's permission first.

<<elseif $mason_pond is 2>>
	Bailey wants £6000 to build a spring in the orphanage garden.

<<elseif $mason_pond is 3>>
	A spring is being built in the orphanage garden.

<<elseif $mason_pond is 4>>
	The spring in the orphanage garden should be finished.

<</if>>

<<if $brothel_machine_repair is 1>>
	Ask Briar about the backstage sex machine.

<<elseif $brothel_machine_repair is 2>>
	The brothel sex machine needs refuelling. It uses an expensive pink gel. Briar suggested looking in the landfill. It would be deep inside, near the compactor.

<<elseif $brothel_machine_repair is 3>>
	You have the pink gel Briar wants for the sex machine.

<</if>>

<<if $harpy gte 6 and $birdFly isnot 1>>
	Your wings are strong, but you don't know how to use them. The Great Hawk could teach you.

<</if>>

<<if $farm_state gte 5 and $estate_fence is undefined>>
	Remy is encroaching on Alex's farm, operating from the estate on the moor.

<<elseif $estate_fence is "quest" and $skulduggery lt 800>>
	Find someone who can help you break into the Remy estate. Someone with underworld connections, or who knows the moor.

<<elseif $estate_fence is "bird">>
	Search the Remy estate fence for an entrance made by the Great Hawk.

<<elseif $estate_fence is "landry">>
	Search the Remy estate fence for an entrance made by Landry's specialist.

<</if>>

<<if $farm>>
	<<if $farm.tower gte 1 and !$farm.tower_guard>>
		The watchtower at the farm isn't staffed. You can find suitable candidates in the pub on Harvest Street.

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

<<if $farm_stage gte 7>>
	Remy will attack the farm
	<<if $farm_attack_timer is 0>>
		tonight.
	<<elseif $farm_attack_timer is 1>>
		tomorrow.
	<<else>>
		in $farm_attack_timer days.
	<</if>>
	They'll arrive between <<ampm 21 00>> and midnight.

<</if>>

<<if $photo>>
	<<if $photo.silly is "accepted">>
		A business owner on the High Street is expecting you during the day.

	<<elseif $photo.silly is "done">>
		You can collect your pay for the High Street job from Niki.

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

<<if $scienceproject is "ongoing">>

	<<if $scienceprojectdays is 0>>
		The science fair is being held at the town hall on Cliff street today from <<ampm 9 00>> until <<ampm 18 00>>.

	<<else>>
		The science fair will be held at the town hall on Cliff Street in $scienceprojectdays days.

	<</if>>
	You have the following ongoing science projects. You'll choose one to present at the fair.

	<<if $sciencelichenknown is 1>>
		-Local lichen

		<<if $sciencelichenpark is 1>>
			<<if $sciencelichenparkready is 1>>
				--You've incorporated the lichen living in the park to your project. +25% success chance.

			<<else>>
				--You've examined lichen in the park. You need to write it up at home or the library.

			<</if>>
		<<else>>
			--Examine white lichen in the park.

		<</if>>
		<<if $sciencelichentemple is 1>>
			<<if $sciencelichentempleready is 1>>
				--You've incorporated the lichen living on the temple to your project. +25% success chance.

			<<else>>
				--You've examined lichen living on the temple. You need to add it to your project at home or the library.

			<</if>>
		<<else>>
			--Examine pink lichen on the temple.

		<</if>>
		<<if $sciencelichendrain is 1>>
			<<if $sciencelichendrainready is 1>>
				--You've incorporated the lichen living in the storm drain to your project. +25% success chance.

			<<else>>
				--You've examined lichen living in the storm drain. You need to add it to your project at home or the library.

			<</if>>
		<<else>>
			--Examine violet lichen in the storm drain, where it exits into the sea.

		<</if>>
		<<if $sciencelichenlake is 1>>
			<<if $sciencelichenlakeready is 1>>
				--You've incorporated the lichen living on the lake ruin to your project. +25% success chance

			<<else>>
				--You've examined lichen living on the lake ruin. You need to add it to your project at home or the library.

			<</if>>
		<<else>>
			--Examine purple lichen on the lake ruin.

		<</if>>
		As it is, this project has a <<print ($sciencelichenparkready * 25 + $sciencelichenlakeready * 25 + $sciencelichendrainready * 25 + $sciencelichentempleready * 25)>>% chance of winning the fair. Winning with this project will greatly reduce trauma and endear you to your teachers.

	<<else>>
		???????????? - Explore to discover.

	<</if>>
	<<if $scienceshroomknown is 1>>
		-Local mushrooms

		-- $scienceshroomheart/5 heartshrooms found.

		-- $scienceshroomheartready/5 heartshrooms added to project.
		<<if $scienceshroomheart gte $scienceshroomheartready>>
			Add mushrooms to your project at home or the library.
		<</if>>
		<<if $scienceshroomheartready gte 1>>
			+<<print ($scienceshroomheartready * 10)>>% success chance.
		<</if>>

		-- $scienceshroomwolf/5 wolfshrooms found.

		-- $scienceshroomwolfready/5 wolfshrooms added to project.
		<<if $scienceshroomwolf gte $scienceshroomwolfready>>
			Add mushrooms to your project at home or the library.
		<</if>>
		<<if $scienceshroomwolfready gte 1>>
			+<<print ($scienceshroomwolfready * 10)>>% success chance.
		<</if>>

		As it is, this project has a <<print ($scienceshroomwolfready * 10 + $scienceshroomheartready * 10)>>% chance of winning the fair. Winning with this project will greatly reduce trauma and make you more popular among your peers.

	<<else>>
		???????????? - Explore the forest to discover.

	<</if>>
	<<if $sciencephallusknown is 1>>
		-Local phalli - Look for participants on the beach during good weather.

		-- $sciencephallus/10 phalli measured.

		-- $sciencephallusready/10 phalli added to project.
		<<if $sciencephallus gte $sciencephallusready>>
			Add phalli to your project at home or the library.
		<</if>>
		<<if $sciencephallusready gte 1>>
			+<<print ($sciencephallusready * 10)>>% success chance.
		<</if>>

		As it is, this project has a <<print ($sciencephallusready * 10)>>% chance of winning the fair. Winning with this project will greatly reduce trauma and make you more famous.

	<<else>>
		???????????? - Become more promiscuous to discover.

	<</if>>

<</if>>

<<if $mathsproject is "ongoing">>
	<<set $mathschance = Math.clamp($mathschance, 0, 100)>>

	<<if $mathsprojectdays is 0>>
		The maths competition is being held at the town hall on Cliff street today from <<ampm 9 00>> until <<ampm 18 00>>.

	<<else>>
		The maths competition will be held at the town hall on Cliff Street in $mathsprojectdays <<if $mathsprojectdays is 1>>day<<else>>days<</if>>. Your solution must be ready before then. You can work on your project at the orphanage or the school library.

	<</if>>
	<<if $mathschance is 0>>
		You haven't begun work on a solution. You have a $mathschance% chance of winning the competition.
	<<elseif $mathschance lte 10>>
		You've barely begun work on a solution. You have a $mathschance% chance of winning the competition.
	<<elseif $mathschance lte 30>>
		Your solution isn't much, but it's something. You have a $mathschance% chance of winning the competition.
	<<elseif $mathschance lte 50>>
		Your solution has some substance, but there's a long way to go. You have a $mathschance% chance of winning the competition.
	<<elseif $mathschance lte 80>>
		Your solution is shaping up, but there's room for improvement. You have a $mathschance% chance of winning the competition.
	<<elseif $mathschance lte 99>>
		Your solution isn't right, but it's good. You can't imagine anyone else has gone as far as this. You have a $mathschance% chance of winning the competition.
	<<else>>
		Your solution is perfect. You have a $mathschance% chance of winning the competition.
	<</if>>

	You have $mathsinfo insights.

	<<if $stimdealerknown is 1>>
		You have $mathsstim stimulants.

		You can buy stimulants from dealers on Oxford Street.

	<</if>>

<</if>>

<<if $studyBooks isnot undefined and $studyBooks.rented isnot "none">>
	<<if $book_rent_timer is 0>>
		You have a library book due.
	<<elseif $book_rent_timer lt 0>>
		You have a library book overdue.
	<<else>>
		You have a library book due in $book_rent_timer day<<if $book_rent_timer gt 1>>s<</if>>.
	<</if>>
<</if>>

<<if $farm>>

	<<farm_upgrades_current>>
<</if>>

<<if $location is "prison">>
	You have <<number $prison.teeth>> shark's teeth.

	<<if $prison_wren_intro isnot 1>>
		You can find Wren in the yard on Fridays after lunch.

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

<<if $museumAntiqueJournalHints.length gte 1>>
	<<museumAntiqueText>>

Winter has mentioned some items missing from the museum

	<<set _hintslist to clone($museumAntiqueJournalHints).reverse()>>

	<<for _hint range _hintslist>>

			<<print _museumAntiqueText[_hint].journal>>

	<</for>>

<</if>>

<<if $plants_known.length gt 0>>

Seeds

	<<set _plant_keys to Object.keys(setup.plants)>>
	<<for _i to 0; _i lt _plant_keys.length; _i++>>
		<<if setup.plants[_plant_keys[_i]].type is "flower" or setup.plants[_plant_keys[_i]].type is "vegetable">>
			<<if $plants_known.includes( setup.plants[_plant_keys[_i]].name)>>
				<<print setup.plants[_plant_keys[_i]].plural[0].toUpperCase() + setup.plants[_plant_keys[_i]].plural.substring(1)>> |
			<<else>>
				??? |
			<</if>>
		<</if>>
	<</for>>
<</if>>
<</widget>>


code:
:: Location Widgets [widget]

<<widget "init_locations">>
	/*
		parent: the location this location is in. values are inherited from here
		area: marker for locations that represent large areas with many locations inside. you don't usually want to set the pc
		      location to them. use a more specialized location instead.
		bus: marker for sub-areas within the town
		outside: if the location is outside or indoors
		tanning: factor applied to tanning. only used for outside locations
		location: locations that should show up in C.location, don't set this on e.g. indoor variants or single rooms. you can get
		          those with C.sublocation if you need them
	*/
	<<script>>
		setup.addlocation = function(location) {
			setup.locations[location] = { name: location, parent: "world" };
			return {
				data: setup.locations[location],
				parent: function(parent) {
					this.data.parent = parent;
					return this;
				},
				area: function() {
					this.data.area = true;
					return this;
				},
				bus: function() {
					this.data.bus = true;
					return this;
				},
				outside: function() {
					this.data.outside = true;
					return this;
				},
				inside: function() {
					this.data.outside = false;
					return this;
				},
				tanning: function(tanning) {
					this.data.tanning = tanning;
					return this;
				},
				descr: function(descr) {
					this.data.descr = descr;
					return this;
				},
				location: function(name = undefined) {
					this.data.location = true;
					this.data.location_name = name; /* override for weird inheritance, e.g. drains */
					return this;
				},
				build: function() {
					if (this.data.descr === undefined) {
						this.data.descr = this.data.name.replace(/_/, " ").replace(/(^|\s)\S/g, function(t) { return t.toUpperCase() });
					}

					let parent = this.data.name;
					while (parent !== undefined) {
						if (this.data.area_name === undefined && setup.locations[parent].area) {
							this.data.area_name = setup.locations[parent].name;
						}
						if (this.data.location_name === undefined && setup.locations[parent].location) {
							this.data.location_name = setup.locations[parent].name;
						}
						if (this.data.bus_name === undefined && setup.locations[parent].bus) {
							this.data.bus_name = setup.locations[parent].name;
						}
						if (this.data.outside === undefined && setup.locations[parent].outside !== undefined) {
							this.data.outside = setup.locations[parent].outside;
						}
						if (this.data.tanning === undefined && setup.locations[parent].tanning !== undefined) {
							this.data.tanning = setup.locations[parent].tanning;
						}
						parent = setup.locations[parent].parent;
					}
					if (!this.data.outside) {
						this.data.tanning = 0;
					}
				}
			 };
		};
		setup.locations = {
			world: {
				parent: undefined,
				area: true,
				location: true,
				bus: false,
				outside: true,
				tanning: 1.0
			}
		};

		setup.addlocation("town"                      ).parent("world").area().location().tanning(0.5).build();

		setup.addlocation( "alley"                    ).parent("town").location().build();
		setup.addlocation( "beach"                    ).parent("town").location().tanning(1.1).build();
		setup.addlocation(  "changingroom"            ).parent("beach").inside().build();
		setup.addlocation(  "seabeach"                ).parent("beach").bus().tanning(1.0).build();
		setup.addlocation( "drain"                    ).parent("town").location().inside().build();
		setup.addlocation(  "sewers"                  ).parent("drain").location().build();
		setup.addlocation( "underground"              ).parent("town").location().inside().build(); /* both underground brothel and various caves */
		setup.addlocation( "promenade"                ).parent("town").location().build();

		setup.addlocation( "residential"              ).parent("town").bus().build();
		setup.addlocation(  "domus"                   ).parent("residential").bus().build();
		setup.addlocation(   "home"                   ).parent("domus").location().inside().build();
		setup.addlocation(    "backyard"              ).parent("home").outside().build();
		setup.addlocation(    "garden"                ).parent("home").outside().build();
		setup.addlocation(  "barb"                    ).parent("residential").bus().build();
		setup.addlocation(   "dance_studio"           ).parent("barb").location().inside().build();
		setup.addlocation(   "police_station"         ).parent("barb").location().inside().build();
		setup.addlocation(  "danube"                  ).parent("residential").bus().build();
		setup.addlocation(   "spa"                    ).parent("danube").location().inside().build();
		setup.addlocation(  "wolf"                    ).parent("residential").bus().build();
		setup.addlocation(   "temple"                 ).parent("danube").location().inside().build();
		setup.addlocation(  "residential_alley"       ).parent("residential").location("allay").build();
		setup.addlocation(  "residential_drain"       ).parent("residential").location("drain").inside().build();

		setup.addlocation( "commercial"               ).parent("town").bus().location().build();
		setup.addlocation(  "connudatus"              ).parent("town").bus().build();
		setup.addlocation(   "strip_club"             ).parent("connudatus").location().inside().build();
		setup.addlocation(  "cliff"                   ).parent("town").bus().build();
		setup.addlocation(   "cafe"                   ).parent("cliff").location().inside().build();
		setup.addlocation(    "cafe_outside"          ).parent("cafe").outside().build(); /* outside seating */
		setup.addlocation(  "high"                    ).parent("town").bus().build();
		setup.addlocation(   "shopping_centre"        ).parent("high").location().inside().build();
		setup.addlocation(    "shopping_centre_roof"  ).parent("shopping_centre").location().inside().build();
		setup.addlocation(  "starfish"                ).parent("town").bus().build();
		setup.addlocation(   "arcade"                 ).parent("starfish").location().inside().build();
		setup.addlocation(  "nightingale"             ).parent("town").bus().build();
		setup.addlocation(   "hospital"               ).parent("nightingale").location().inside().build();
		setup.addlocation(  "park"                    ).parent("town").location().tanning(0.75).build();
		setup.addlocation(   "parkmens"               ).parent("park").inside().bus().descr("Men's Room").build();
		setup.addlocation(   "parkwomens"             ).parent("park").inside().bus().descr("Women's Room").build();
		setup.addlocation(   "chocolate_stand"        ).parent("park").inside().build();
		setup.addlocation(   "parkcafe"               ).parent("park").inside().build();
		setup.addlocation(   "parktree"               ).parent("park").inside().descr("Park").build();
		setup.addlocation(  "oxford"                  ).parent("town").bus().build();
		setup.addlocation(   "school"                 ).parent("oxford").location().inside().build();
		setup.addlocation(    "schoolgrounds"         ).parent("school").outside().build();
		setup.addlocation(    "pool"                  ).parent("school").location().build();
		setup.addlocation(   "museum"                 ).parent("oxford").location().inside().build();
		setup.addlocation(  "commercial_alley"        ).parent("commercial").location("allay").build();
		setup.addlocation(  "commercial_drain"        ).parent("commercial").location("drain").inside().build();

		setup.addlocation( "industrial"               ).parent("town").bus().location().build();
		setup.addlocation(  "mer"                     ).parent("industrial").bus().build();
		setup.addlocation(   "docks"                  ).parent("mer").location().outside().build();
		setup.addlocation(    "docks_building"        ).parent("docks").inside().build();
		setup.addlocation(  "elk"                     ).parent("industrial").bus().build();
		setup.addlocation(   "compound"               ).parent("elk").location().build();
		setup.addlocation(    "compound_building"     ).parent("compound").location().inside().build();
		setup.addlocation(   "landfill"               ).parent("elk").location().build();
		setup.addlocation(   "night_monster_lair"     ).parent("elk").location().inside().build();
		setup.addlocation(  "harvest"                 ).parent("industrial").bus().build();
		setup.addlocation(   "brothel"                ).parent("harvest").location().inside().build();
		setup.addlocation(   "pub"                    ).parent("harvest").location().inside().build();
		setup.addlocation(  "industrial_alley"        ).parent("industrial").location("allay").build();
		setup.addlocation(  "industrial_drain"        ).parent("industrial").location("drain").inside().build();

		setup.addlocation("forest"                    ).parent("world").area().location().tanning(0.1).build();
		setup.addlocation( "wolf_cave"                ).parent("forest").location().inside().build();
		setup.addlocation(  "wolf_cave_yard"          ).parent("wolf_cave").outside().tanning(0.5).build();
		setup.addlocation( "asylum"                   ).parent("forest").location().inside().build();
		setup.addlocation(  "asylum_yard"             ).parent("asylum").outside().tanning(0.5).build();
		setup.addlocation( "cabin"                    ).parent("forest").location().inside().build();
		setup.addlocation( "lake"                     ).parent("forest").location().tanning(1.0).build();
		setup.addlocation(  "lake_ruin"               ).parent("lake").location().inside().build();
		setup.addlocation( "farmroad3"                ).parent("forest").bus().tanning(1.0).build();

		setup.addlocation("plains"                    ).parent("world").area().build();
		setup.addlocation( "farm"                     ).parent("plains").location().build(); /* underground farm */
		setup.addlocation(  "estate"                  ).parent("farm").location().build();
		setup.addlocation( "alex_farm"                ).parent("plains").location().build();
		setup.addlocation(  "alex_cottage"            ).parent("alex_farm").location().inside().build();
		setup.addlocation(  "alex_stables"            ).parent("alex_farm").inside().build();
		setup.addlocation( "riding_school"            ).parent("plains").location().build();
		setup.addlocation( "moor"                     ).parent("plains").location().build();
		setup.addlocation( "castle"                   ).parent("moor").location().build();
		setup.addlocation(  "tower"                   ).parent("castle").location().build();

		setup.addlocation("sea"                       ).parent("world").area().location().bus().build();
		setup.addlocation( "searocks"                 ).parent("sea").bus().build();
		setup.addlocation( "seadocks"                 ).parent("sea").bus().build();
		setup.addlocation( "seacliffs"                ).parent("sea").bus().build();
		setup.addlocation( "seapirates"               ).parent("sea").inside().build();
		setup.addlocation( "coastpath"                ).parent("sea").build();
		setup.addlocation( "prison"               	  ).parent("sea").location().inside().build();

		setup.addlocation("tentworld"                 ).parent("world").area().location().tanning(0).inside().build(); /* TODO: remove inside() when consuming code has been adapted */

	<</script>>
<</widget>>

<!-- This shall replace all "set $location/$outside/$bus" when this system is fully implemented -->

<<widget "location">>
	<<set _location to $args[0]>>
	<<if ndef setup.locations[_location]>>
		<<set $locationerror to _location>>
	<<else>>
		<<set $sublocation to _location>>

		<<set $area to C.area>>
		<<set $location to C.location>>
		<<if def C.bus>>
			<<set $bus to C.bus>>
		<</if>>
		<<set $outside to C.outside>>
	<</if>>
<</widget>>

<!-- Do NOT use these computes until all "set $location"s have been eliminated! -->

<<compute "area">>
	setup.locations[$sublocation].area_name
<</compute>>

<<compute "location">>
	setup.locations[$sublocation].location_name
<</compute>>

<<compute "sublocation">>
	setup.locations[$sublocation].name
<</compute>>

<<compute "bus">>
	setup.locations[$sublocation].bus_name
<</compute>>

<<compute "outside">>
	setup.locations[$sublocation].outside
<</compute>>

<<compute "tanning">>
	setup.locations[$sublocation].tanning
<</compute>>

<<compute "location_pretty_name">>
	setup.locations[$sublocation].descr
<</compute>>

repo_name: Area/degrees

license: mit


code:
:: Widgets Mirror [widget]
<<widget "calchairlengthstage">>
<<if $hairlength gte 1000>>
	<<set $hairlengthstage to "feet">>
<<elseif $hairlength gte 800>>
	<<set $hairlengthstage to "thighs">>
<<elseif $hairlength gte 600>>
	<<set $hairlengthstage to "navel">>
<<elseif $hairlength gte 400>>
	<<set $hairlengthstage to "chest">>
<<elseif $hairlength gte 200>>
	<<set $hairlengthstage to "shoulder">>
<<else>>
	<<set $hairlengthstage to "short">>
<</if>>

<<if $fringelength gte 1000>>
	<<set $fringelengthstage to "feet">>
<<elseif $fringelength gte 800>>
	<<set $fringelengthstage to "thighs">>
<<elseif $fringelength gte 600>>
	<<set $fringelengthstage to "navel">>
<<elseif $fringelength gte 400>>
	<<set $fringelengthstage to "chest">>
<<elseif $fringelength gte 200>>
	<<set $fringelengthstage to "shoulder">>
<<else>>
	<<set $fringelengthstage to "short">>
<</if>>
<</widget>>

<<widget "mirror">>

	<<switch $mirrorMenu>>
	<<case "appearance">>
		<<mirrorAppearance>>
	<<case "skin">>
		<<mirrorSkin>>
	<<case "hair">>
		<<mirrorHair>>
	<<case "makeup">>
		<<mirrorMakeup>>
	<<case "transformation">>
		<<mirrorTransformation>>
	<<case "debug">>
		<<mirrorDebug>>
	<<default>>
		<<mirrorMenu>>
	<</switch>>

<<calchairlengthstage>>

<</widget>>

<<widget "mirrorwet">>
<<if $args[0] or $args[1]>>

	<<set _temp to $args[0]>>
	<<set _temp2 to $args[1]>>
	Your $args[2]
	<<if $args [2] is "thighs" or $args [2] is "feet">>
		are
	<<else>>
		is
	<</if>>
	<<if _temp gt 0>>
		<<if _temp gte 5>>
			drenched in semen
		<<elseif _temp is 4>>
			soaked in semen
		<<elseif _temp is 3>>
			slick with semen
		<<elseif _temp is 2>>
			wet with semen
		<<elseif _temp is 1>>
			moist with semen
		<</if>>
		<<if _temp2 gt 0>>
			and
		<</if>>
	<</if>>
	<<if _temp2 gt 0>>
		<<if _temp2 gte 5>>
			drenched in slime
		<<elseif _temp2 is 4>>
			soaked in slime
		<<elseif _temp2 is 3>>
			slick with slime
		<<elseif _temp2 is 2>>
			wet with slime
		<<elseif _temp2 is 1>>
			moist with slime
		<</if>>
	<</if>>
<</if>>

<</widget>>

<<widget "mirrorMenu">>
You look into the mirror.
<<if $fallenangel gte 2>>
	A pathetic excuse of a person
<<elseif $hallucinogen gte 200>>
	The mirror melts away into an inky black puddle, floating before you. Shards of glass graze past your skin and dissolve into the air.

	You stare into the void, and the void
<<elseif $hallucinogen gte 100>>
	The surface folds over itself at an angle you can't quite understand, and something unrecognisable
<<elseif $hallucinogen gt 0>>
	The surface ripples at your presence, and a vaguely familiar <<girl>>
<<elseif $trauma gte $traumamax>>
	A <<girl>> with glazed eyes
<<elseif $pain gte 100>>
	A crying <<girl>>
<<elseif $pain gte 40>>
	A tearful <<girl>>
<<elseif $pain gte 1>>
	A frowning <<girl>>
<<else>>
	A cheerful <<girl>>
<</if>>
stares back.
<<if $wraith and $wraith.state is "haunt" and $hallucinations gte 1 and random(1, 100) is 1>>
	A pale figure stands behind.
<</if>>

<<link "Examine how you are seen by others">><<replace #mirror>><<mirrorAppearance>><</replace>><<numberify "#passages > .passage">><<set $mirrorMenu to "appearance">><</link>>

<<if !$simpleMirror>>
	__Skin__

	<<link "Examine your skin">><<replace #mirror>><<mirrorSkin>><</replace>><<numberify "#passages > .passage">><<set $mirrorMenu to "skin">><</link>>

<</if>>
__Hair__

<<link "Change your hair style">><<replace #mirror>><<mirrorHair>><</replace>><<numberify "#passages > .passage">><<set $mirrorMenu to "hair">><</link>>

__Makeup__

<<link "Apply makeup">><<replace #mirror>><<mirrorMakeup>><</replace>><<numberify "#passages > .passage">><<set $mirrorMenu to "makeup">><</link>>

<<if !$simpleMirror>>
	<<if $specialTransform is 1 or $physicalTransform is 1>>
		__Transformation__

		<<link "Examine your inner self">><<replace #mirror>><<mirrorTransformation>><</replace>><<numberify "#passages > .passage">><<set $mirrorMenu to "transformation">><</link>>
	<<else>>
		Obtain otherworldly powers to examine further.
	<</if>>
<</if>>

<<if $debug is 1>>
	<<link "Debug">><<replace #mirror>><<mirrorDebug>><</replace>><<set $mirrorMenu to "debug">><</link>>
<</if>>
<</widget>>

<<widget "mirrorAppearance">>
<<link "Back">><<replace #mirror>><<mirrorMenu>><</replace>><<numberify "#passages > .passage">><<unset $mirrorMenu>><</link>>

<<settextcolorfromgender $player.gender_appearance>>
You look like a <<if $sexStats.vagina.pregnancy.bellySize gte 9>>pregnant <</if>><<girl>>.

The following factors are contributing:

<<for _x range $player.gender_appearance_factors>>
	<<if _x.femininity is 0>>
		<<continue>>
	<</if>>
	<<settextcolorfromfemininity _x.femininity>>

		_x.factor
		<<if $debug is 1>>
			_x.femininity
		<<else>>
			<<print "+".repeat(
				Math.trunc(Math.clamp(
					Math.abs(_x.femininity) / 100, 0, 10
				))
			)>>
		<</if>>

<</for>>
<<if $debug is 1>>
	<<settextcolorfromfemininity $player.femininity>>
	Total femininity: $player.femininity

<</if>>

Attractiveness measures your ability to use your looks to your advantage.

Attractiveness rating:
<<if $attractiveness gte 5000>>
	S
<<elseif $attractiveness gte 4000>>
	A
<<elseif $attractiveness gte 3000>>
	B
<<elseif $attractiveness gte 2000>>
	C
<<elseif $attractiveness gte 1000>>
	D
<<else>>
	F
<</if>>

	<<if $beauty gte ($beautymax / 7)>>
		Cute

	<</if>>
	<<if $beauty gte ($beautymax / 7) * 2>>
		Pretty

	<</if>>
	<<if $beauty gte ($beautymax / 7) * 3>>
		Charming

	<</if>>
	<<if $beauty gte ($beautymax / 7) * 4>>
		Beautiful

	<</if>>
	<<if $beauty gte ($beautymax / 7) * 5>>
		Ravishing

	<</if>>
	<<if $beauty gte ($beautymax / 7) * 6>>
		Divine

	<</if>>
	Hair length

	<<if $worn.upper.type.includes("naked")>>
		Topless

	<<elseif $worn.upper.reveal gte 500>>
		Revealing top

	<</if>>
	<<if $worn.lower.type.includes("naked")>>
		Bottomless

	<<elseif $worn.lower.reveal gte 500>>
		Revealing bottoms

	<</if>>
	<<if $worn.under_lower.type.includes("naked")>>
		Pantiless

	<<elseif $worn.under_lower.reveal gte 500>>
		Sexy underwear

	<</if>>
	<<if $wolfgirl gte 6>>
		Wolfy

	<</if>>
	<<if $cat gte 6>>
		Catlike

	<</if>>
	<<if $cow gte 6>>
		Bovine

	<</if>>
	<<if $harpy gte 6>>
		Harpy

	<</if>>
	<<if $angel gte 6>>
		Angel

	<</if>>
	<<if $fallenangel gte 2>>
		Fallen angel

	<</if>>
	<<if $demon gte 6>>
		Demon

	<</if>>
	<<if $bunny gte 6>>
		Bunny

	<</if>>
	<<if $makeup.lipstick != 0 or $makeup.eyeshadow != 0 or $makeup.mascara != 0>>
		Attractive makeup

	<</if>>
	<<if $worn.head.reveal gte 50>>
		Attractive headwear

	<</if>>
	<<if $worn.face.reveal gte 50>>
		Attractive face accessory

	<</if>>
	<<if $worn.neck.reveal gte 50>>
		Attractive collar

	<</if>>
	<<if $worn.legs.reveal gte 50>>
		Attractive legwear

	<</if>>
	<<if $worn.feet.reveal gte 50>>
		Attractive shoes

	<</if>>

Allure is the dark side of attractiveness, and measures how much people will want to molest you.

Allure:
<<if $allure gte 6000 * $alluremod>>
	You look like you need to be ravaged.
<<elseif $allure gte 4000 * $alluremod>>
	You look perverted.
<<elseif $allure gte 3000 * $alluremod>>
	You look lewd.
<<elseif $allure gte 2000 * $alluremod>>
	You stand out.
<<elseif $allure gte 1500 * $alluremod>>
	You attract attention.
<<elseif $allure gte 1000 * $alluremod>>
	You attract glances.
<<else>>
	You look unremarkable.
<</if>>

Increasing your allure:

	<<if $beauty gte ($beautymax / 7)>>
		Cute

	<</if>>
	<<if $beauty gte ($beautymax / 7) * 2>>
		Pretty

	<</if>>
	<<if $beauty gte ($beautymax / 7) * 3>>
		Charming

	<</if>>
	<<if $beauty gte ($beautymax / 7) * 4>>
		Beautiful

	<</if>>
	<<if $beauty gte ($beautymax / 7) * 5>>
		Ravishing

	<</if>>
	<<if $beauty gte ($beautymax / 7) * 6>>
		Divine

	<</if>>
	Hair length

	<<if $worn.upper.type.includes("naked")>>
		Topless

	<<elseif $worn.upper.reveal gte 500>>
		Revealing top

	<</if>>
	<<if $worn.lower.type.includes("naked")>>
		Bottomless

	<<elseif $worn.lower.reveal gte 500>>
		Revealing bottoms

	<</if>>
	<<if $worn.under_lower.type.includes("naked")>>
		Pantiless

	<<elseif $worn.under_lower.reveal gte 500>>
		Sexy underwear

	<</if>>
	<<if $wolfgirl gte 6>>
		Wolfy

	<</if>>
	<<if $cat gte 6>>
		Catlike

	<</if>>
	<<if $cow gte 6>>
		Bovine

	<</if>>
	<<if $angel gte 6>>
		Angel

	<</if>>
	<<if $fallenangel gte 2>>
		Fallen angel

	<</if>>
	<<if $demon gte 6>>
		Demon

	<</if>>
	<<if $bunny gte 6>>
		Bunny

	<</if>>
	<<if $bunny gte 6>>
		Enticing tail

	<</if>>
	<<if $makeup.lipstick != 0 or $makeup.eyeshadow != 0 or $makeup.mascara != 0>>
		Alluring makeup

	<</if>>
	<<if $worn.head.reveal gte 50>>
		Alluring headwear

	<</if>>
	<<if $worn.face.reveal gte 50>>
		Alluring face accessory

	<</if>>
	<<if $worn.neck.reveal gte 50>>
		Alluring collar

	<</if>>
	<<if $worn.legs.reveal gte 50>>
		Alluring legwear

	<</if>>
	<<if $worn.feet.reveal gte 50>>
		Alluring shoes

	<</if>>
	<<if $daystate is "night">>
		Night

	<</if>>
	<<if $exposed gte 1>>
		Exposed

	<</if>>
	<<if $semencount + $goocount gte 1>>
		Smell of cum

	<</if>>
	<<if $semencount + $goocount gte 10>>
		Covered in cum

	<</if>>
	<<if $semencount + $goocount gte 30>>
		Drenched in cum

	<</if>>
	<<if $moonstate is "evening" and $hour gte 21 or $moonstate is "morning" and $hour lt 6>>
		Full moon

	<</if>>

<<if $famesex gte 1000>>
	Notorious slut

<<elseif $famesex gte 600>>
	Famous slut

<<elseif $famesex gte 400>>
	Recognised slut

<<elseif $famesex gte 200>>
	Known slut

<<elseif $famesex gte 100>>
	Low-key slut

<<elseif $famesex gte 30>>
	Obscure slut

<</if>>

<<if $fameprostitution gte 1000>>
	Notorious whore

<<elseif $fameprostitution gte 600>>
	Famous whore

<<elseif $fameprostitution gte 400>>
	Recognised whore

<<elseif $fameprostitution gte 200>>
	Known whore

<<elseif $fameprostitution gte 100>>
	Low-key whore

<<elseif $fameprostitution gte 30>>
	Obscure whore

<</if>>

<<if $famerape gte 1000>>
	Notorious fucktoy

<<elseif $famerape gte 600>>
	Famous fucktoy

<<elseif $famerape gte 400>>
	Recognised fucktoy

<<elseif $famerape gte 200>>
	Known fucktoy

<<elseif $famerape gte 100>>
	Low-key fucktoy

<<elseif $famerape gte 30>>
	Obscure fucktoy

<</if>>

<<if $bestialitydisable is "f">>
	<<if $famebestiality gte 1000>>
		Notorious bitch

	<<elseif $famebestiality gte 600>>
		Famous bitch

	<<elseif $famebestiality gte 400>>
		Recognised bitch

	<<elseif $famebestiality gte 200>>
		Known bitch

	<<elseif $famebestiality gte 100>>
		Low-key bitch

	<<elseif $famebestiality gte 30>>
		Obscure bitch

	<</if>>
<<else>>
	<<if $famebestiality gte 1000>>
		Notorious monster fucker

	<<elseif $famebestiality gte 600>>
		Famous monster fucker

	<<elseif $famebestiality gte 400>>
		Recognised monster fucker

	<<elseif $famebestiality gte 200>>
		Known monster fucker

	<<elseif $famebestiality gte 100>>
		Low-key monster fucker

	<<elseif $famebestiality gte 30>>
		Obscure monster fucker

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

<<if $fameexhibitionism gte 1000>>
	Notorious flaunter

<<elseif $fameexhibitionism gte 600>>
	Famous flaunter

<<elseif $fameexhibitionism gte 400>>
	Recognised flaunter

<<elseif $fameexhibitionism gte 200>>
	Known flaunter

<<elseif $fameexhibitionism gte 100>>
	Low-key flaunter

<<elseif $fameexhibitionism gte 30>>
	Obscure flaunter

<</if>>
<<if $famepregnancy gte 1000>>
	Notorious broodmother

<<elseif $famepregnancy gte 600>>
	Famous broodmother
<<elseif $famepregnancy gte 400>>
	Recognised breeder

<<elseif $famepregnancy gte 200>>
	Known breeder

<<elseif $famepregnancy gte 100>>
	Low-key mother

<<elseif $famepregnancy gte 50>>
	Obscure mother

<</if>>

Decreasing your allure:

<<if $famescrap gte 1000>>
	Notorious scrapper

<<elseif $famescrap gte 600>>
	Famous scrapper

<<elseif $famescrap gte 400>>
	Recognised scrapper

<<elseif $famescrap gte 200>>
	Known scrapper

<<elseif $famescrap gte 100>>
	Low-key scrapper

<<elseif $famescrap gte 30>>
	Obscure scrapper

<</if>>
<<if $famegood gte 1000>>
	Notorious do-gooder

<<elseif $famegood gte 600>>
	Famous do-gooder

<<elseif $famegood gte 400>>
	Recognised do-gooder

<<elseif $famegood gte 200>>
	Known do-gooder

<<elseif $famegood gte 100>>
	Low-key do-gooder

<<elseif $famegood gte 30>>
	Obscure do-gooder

<</if>>
<<if $famebusiness gte 1000>>
	Notorious entrepreneur

<<elseif $famebusiness gte 600>>
	Famous entrepreneur

<<elseif $famebusiness gte 400>>
	Recognised entrepreneur

<<elseif $famebusiness gte 200>>
	Known entrepreneur

<<elseif $famebusiness gte 100>>
	Low-key entrepreneur

<<elseif $famebusiness gte 30>>
	Obscure entrepreneur

<</if>>
<<if $famesocial gte 1000>>
	Notorious schmoozer

<<elseif $famesocial gte 600>>
	Famous socialite

<<elseif $famesocial gte 400>>
	Recognised socialite

<<elseif $famesocial gte 200>>
	Known socialite

<<elseif $famesocial gte 100>>
	Low-key socialite

<<elseif $famesocial gte 30>>
	Obscure socialite

<</if>>
<<if $moorLuck gt 5>>
	????

<<elseif $moorLuck gt 0>>
	????

<</if>>

__Behaviour__

<<if $player.gender_posture is "n">>
	You turn around to get a look at yourself. You look like a <<girl>>. Maybe if you
	carried yourself differently you could change that.
<<elseif $player.gender_posture is "f">>
	You strike a few girly poses and put on your best feminine voice.

	Others will be more likely to think that you're a girl.
<<elseif $player.gender_posture is "m">>
	You flex your muscles and add some gruff to your voice.

	Others will be more likely to think that you're a boy.
<</if>>

<<linkradiogroup "$player.gender_posture" `{
	"Act naturally": "n",
	"Take a feminine posture": "f",
	"Take a masculine posture": "m",
}`>>
<</widget>>

<<widget "mirrorSkin">>
You are looking at your skin.

<<link "Back">><<replace #mirror>><<mirrorMenu>><</replace>><<numberify "#passages > .passage">><<unset $mirrorMenu>><</link>>

<<if $goocount + $semencount gt 0>>
	__Goo and Semen__
	<<mirrorwet $player.bodyliquid.neck.semen $player.bodyliquid.neck.goo "neck">>
	<<mirrorwet $player.bodyliquid.rightarm.semen $player.bodyliquid.rightarm.goo "right arm">>
	<<mirrorwet $player.bodyliquid.leftarm.semen $player.bodyliquid.leftarm.goo "left arm">>
	<<mirrorwet $player.bodyliquid.thigh.semen $player.bodyliquid.thigh.goo "thighs">>
	<<mirrorwet $player.bodyliquid.bottom.semen $player.bodyliquid.bottom.goo "bottom">>
	<<mirrorwet $player.bodyliquid.tummy.semen $player.bodyliquid.tummy.goo "tummy">>
	<<mirrorwet $player.bodyliquid.chest.semen $player.bodyliquid.chest.goo "chest">>
	<<mirrorwet $player.bodyliquid.face.semen $player.bodyliquid.face.goo "face">>
	<<mirrorwet $player.bodyliquid.hair.semen $player.bodyliquid.hair.goo "hair">>
	<<mirrorwet $player.bodyliquid.feet.semen $player.bodyliquid.feet.goo "feet">>
	<<mirrorwet $player.bodyliquid.vaginaoutside.semen $player.bodyliquid.vaginaoutside.goo "labia">>
	<<mirrorwet $player.bodyliquid.vagina.semen $player.bodyliquid.vagina.goo "vagina">>
	<<mirrorwet $player.bodyliquid.penis.semen $player.bodyliquid.penis.goo "penis">>
	<<mirrorwet $player.bodyliquid.anus.semen $player.bodyliquid.anus.goo "anus">>
	<<mirrorwet $player.bodyliquid.mouth.semen $player.bodyliquid.mouth.goo "mouth">>
<<else>>
	Your skin feels clean.
<</if>>

__Body Writing__

<<if $bodyWritingSelected is null>>
	<<unset $bodyWritingSelected>>
<</if>>
<<if $bodyWritingSelected isnot undefined>>
	You write
	<<if $skin[$bodyPartSelected].special is $loveInterest.primary or $skin[$bodyPartSelected].special is $loveInterest.secondary>>
		"<<print $bodyWritingSelected>>"
	<<elseif $skin[$bodyPartSelected].special isnot "none">>
		"<<print $bodyWritingSelected>>"
	<<elseif $skin[$bodyPartSelected].lewd is 1>>
		"<<print $bodyWritingSelected>>"
	<<else>>
		"<<print $bodyWritingSelected>>"
	<</if>>
	on your <<bodypart $bodyPartSelected>>.
	<<unset $bodyWritingSelected>>
	<<unset $bodyPartSelected>>

<</if>>
<<bodywriting>>

<<set _bodyWritingOptions to {
	General: {
	"Cute boy":"cute_boy",
	"Cute girl":"cute_girl",
	"Orphan":"orphan"
	}
}>>

<<if $beauty gte ($beautymax / 7) * 3>>
   <<set _bodyWritingOptions.General["Handsome"] to "handsome">>
   <<set _bodyWritingOptions.General["Pretty"] to "pretty">>
<</if>>
<<if $beauty gte ($beautymax / 7) * 4>>
   <<set _bodyWritingOptions.General["Stud"] to "stud">>
   <<set _bodyWritingOptions.General["Beauty"] to "beauty">>
<</if>>
<<if $beauty gte ($beautymax / 7) * 5>>
   <<set _bodyWritingOptions.General["Beautiful"] to "beautiful">>
<</if>>

<<if $trauma gte (($traumamax / 5) * 2)>>
   <<set _bodyWritingOptions.General["Daddy issues"] to "daddy_issues">>
   <<set _bodyWritingOptions.General["Mommy issues"] to "mommy_issues">>
   <<set _bodyWritingOptions.General["Trashy"] to "trashy">>
<</if>>
<<if $trauma gte (($traumamax / 5) * 3)>>
   <<set _bodyWritingOptions.General["Worthless"] to "worthless">>
   <<set _bodyWritingOptions.General["Oh no"] to "oh_no">>
   <<set _bodyWritingOptions.General["Dumb bitch"] to "dumb_bitch">>
<</if>>

<<if $promiscuity gte 15>>
   <<set _bodyWritingOptions.General["Hot"] to "hot">>
<</if>>
<<if $promiscuity gte 35>>
   <<set _bodyWritingOptions.Promiscuity = {}>>
	<<set _bodyWritingOptions.Promiscuity["Slut"] to "slut">>
	<<set _bodyWritingOptions.Promiscuity["Promiscuous"] to "promiscuous">>
	<<set _bodyWritingOptions.Promiscuity["Wanton"] to "wanton">>
	<<set _bodyWritingOptions.Promiscuity["D.T.F."] to "dtf">>
<</if>>

<<if $promiscuity gte 55>>
   <<set _bodyWritingOptions.Promiscuity["Insatiable slut"] to "insatiable_slut">>
   <<set _bodyWritingOptions.Promiscuity["Free Sex"] to "free_sex">>
   <<set _bodyWritingOptions.Promiscuity["Town bicycle"] to "town_bicycle">>
   <<set _bodyWritingOptions.Promiscuity["Size queen"] to "size_queen">>
   <<if $orgasmtrait gte 1>>
		<<set _bodyWritingOptions.Promiscuity["Sex addict"] to "sex_addict">>
		<<set _bodyWritingOptions.Promiscuity["Make me cum"] to "make_me_cum">>
   <</if>>
<</if>>

<<if $promiscuity gte 75>>
   <<set _bodyWritingOptions.Promiscuity["Fuck Me"] to "fuck_me">>
   <<set _bodyWritingOptions.Promiscuity["Cocksucker"] to "cocksucker">>
   <<set _bodyWritingOptions.Promiscuity["Cum dump"] to "cum_dump">>
   <<set _bodyWritingOptions.Promiscuity["Public Slut"] to "public_slut">>
   <<if $analstat gte 100>>
	  <<set _bodyWritingOptions.Promiscuity["Buttslut"] to "buttslut">>
	  <<set _bodyWritingOptions.Promiscuity["Anal whore"] to "anal_whore">>
   <</if>>
<</if>>

<<if $promiscuity gte 35>>
	<<set _bodyWritingOptions.Prostitution = {}>>
	<<if $trauma gte (($traumamax / 5) * 2)>>
		<<set _bodyWritingOptions.Prostitution["It's not rape if you pay me"] to "its_not_rape_if_you_pay_me">>
	<</if>>
	<<set _bodyWritingOptions.Prostitution["£5 whore"] to "five_pound_whore">>
	<<set _bodyWritingOptions.Prostitution["£10 a pop"] to "ten_pound_a_pop">>
	<<set _bodyWritingOptions.Prostitution["Slut for hire"] to "slut_for_hire">>
<</if>>
<<if $promiscuity gte 55>>
	<<set _bodyWritingOptions.Prostitution["£25 per fuck"] to "twenty_five_pound_per_fuck">>
	<<set _bodyWritingOptions.Prostitution["£100"] to "one_hundred_pound">>
	<<set _bodyWritingOptions.Prostitution["Body for sale"] to "body_for_sale">>
	<<if $trauma gte (($traumamax / 5) * 3)>>
		<<set _bodyWritingOptions.Prostitution["Stupid whore"] to "stupid_whore">>
	<<else>>
		<<set _bodyWritingOptions.Prostitution["Whore"] to "whore">>
	<</if>>
	<<set _bodyWritingOptions.Prostitution["Prostitute"] to "prostitute">>
<</if>>
<<if $exhibitionism gte 35>>
	<<set _bodyWritingOptions.Exhibitionism to {}>>
	<<set _bodyWritingOptions.Exhibitionism["Pervert"] to "pervert">>
	<<set _bodyWritingOptions.Exhibitionism["Attention whore"] to "attention_whore">>
	<<set _bodyWritingOptions.Exhibitionism["Flaunter"] to "flaunter">>
	<<set _bodyWritingOptions.Exhibitionism["Object"] to "object">>
	<<set _bodyWritingOptions.Exhibitionism["Strip me"] to "strip_me">>
	<<set _bodyWritingOptions.Exhibitionism["Ask to see me naked"] to "ask_to_see_me_naked">>
<</if>>
<<if $deviancy gte 55>>
	<<set _bodyWritingOptions.Deviancy to {}>>
	<<set _bodyWritingOptions.Deviancy["Doggy slut"] to "doggy_slut">>
	<<set _bodyWritingOptions.Deviancy["Animal"] to "animal">>
	<<set _bodyWritingOptions.Deviancy["Beast fucker"] to "beast_fucker">>
	<<set _bodyWritingOptions.Deviancy["Breedable"] to "breedable">>
	<<set _bodyWritingOptions.Deviancy["Deviant"] to "deviant">>
<</if>>
<<if $masochism_level gte 1>>
	<<set _bodyWritingOptions.Masochism to {}>>
	<<set _bodyWritingOptions.Masochism["Hit me"] to "hit_me">>
	<<set _bodyWritingOptions.Masochism["Hurt me"] to "hurt_me">>
	<<set _bodyWritingOptions.Masochism["Treat me bad"] to "treat_me_bad">>
	<<set _bodyWritingOptions.Masochism["Make me squeal"] to "make_me_squeal">>
<</if>>
<<if $submissive gte 1200>>
	<<set _bodyWritingOptions.Submission to {}>>
	<<set _bodyWritingOptions.Submission["Submissive"] to "submissive">>
	<<set _bodyWritingOptions.Submission["Pet"] to "pet">>

   	<<if $deviancy gte 35>>
	  <<set _bodyWritingOptions.Submission["Public pet"] to "public_pet">>
  	<</if>>

	<<if $promiscuity gte 55>>
		<<set _bodyWritingOptions.Submission["Free use"] to "free_use">>
		<<set _bodyWritingOptions.Submission["Use Me"] to "use_me">>
	<</if>>

	<<if $submissive gte 1500>>
		<<set _bodyWritingOptions.Submission["Slave"] to "slave">>
		<<set _bodyWritingOptions.Submission["Enslave Me"] to "enslave_me">>
		<<set _bodyWritingOptions.Submission["Cum rag"] to "cum_rag">>
		<<if $promiscuity gte 75>>
			<<set _bodyWritingOptions.Submission["Fuckdoll"] to "fuckdoll">>
			<<set _bodyWritingOptions.Submission["Fucktoy"] to "fucktoy">>
			<<if $player.penisExist>>
				<<set _bodyWritingOptions.Submission["Walking dildo"] to "walking_dildo">>
			<</if>>
		<</if>>
	<</if>>
<</if>>
/*ToDo: Pregnancy, remove $pregnancyTesting to properly enable*/
<<if $player.vaginaExist and $promiscuity gte 75 and $pregnancyTesting>>
	<<set _bodyWritingOptions.Pregnancy to {}>>
	<<set _bodyWritingOptions.Pregnancy["Brood mother"] to "brood_mother">>
	<<set _bodyWritingOptions.Pregnancy["Inseminate me"] to "inseminate_me">>
	<<set _bodyWritingOptions.Pregnancy["Impregnate me"] to "impregnate_me">>
	<<set _bodyWritingOptions.Pregnancy["Pregnancy slut"] to "pregnancy_slut">>
	<<set _bodyWritingOptions.Pregnancy["Breeding ground"] to "breeding_ground">>
<</if>>

	<<set _bodyWritingOptions["Love Interests"] to {}>>
	<<if $robinromance is 1>>
		<<set _bodyWritingOptions["Love Interests"]["Robin's Protector"] to "robins_protector">>
		<<set _bodyWritingOptions["Love Interests"]["Robin & I"] to "robin_and_i">>
		<<set _bodyWritingOptions["Love Interests"]["The Orphan Lover"] to "the_orphan_lover">>
		<<if ($player.gender is "m" or $player.gender is "h" or $player.gender_appearance is "m" or $backgroundTraits.includes("crossdresser"))>>
			<<set _bodyWritingOptions["Love Interests"]["Robin's Boyfriend"] to "robins_boyfriend">>
		<</if>>
		<<if ($player.gender is "f" or $player.gender is "h" or $player.gender_appearance is "f" or $backgroundTraits.includes("crossdresser"))>>
			<<set _bodyWritingOptions["Love Interests"]["Robin's Girlfriend"] to "robins_girlfriend">>
		<</if>>
	<</if>>
	<<if $whitneyromance is 1>>
		<<set _bodyWritingOptions["Love Interests"]["Whitney's Pet"] to "whitneys_pet">>
		<<set _bodyWritingOptions["Love Interests"]["Property of Whitney"] to "property_of_whitney">>
		<<set _bodyWritingOptions["Love Interests"]["Whitney's Toy"] to "whitneys_toy">>
		<<if ($player.gender is "m" or $player.gender is "h" or $player.gender_appearance is "m" or $backgroundTraits.includes("crossdresser"))>>
			<<set _bodyWritingOptions["Love Interests"]["Whitney's Boyslut"] to "whitneys_boyslut">>
		<</if>>
		<<if ($player.gender is "f" or $player.gender is "h" or $player.gender_appearance is "f" or $backgroundTraits.includes("crossdresser"))>>
			<<set _bodyWritingOptions["Love Interests"]["Whitney's Slut"] to "whitneys_slut">>
		<</if>>
	<</if>>
	<<if $kylarenglish gte 1 and $NPCName[$NPCNameList.indexOf("Kylar")].state isnot "prison">>
		<<set _bodyWritingOptions["Love Interests"]["Kylar's Obsession"] to "kylars_obsession">>
		<<set _bodyWritingOptions["Love Interests"]["Love Kylar Forever"] to "love_kylar_forever">>
		<<set _bodyWritingOptions["Love Interests"]["Reserved for Kylar"] to "reserved_for_kylar">>
		<<set _bodyWritingOptions["Love Interests"]["Just Kylar"] to "just_kylar">>
	<</if>>
	<<if $syndromeeden is 1>>
		<<set _bodyWritingOptions["Love Interests"]["Eden's Companion"] to "edens_companion">>
		<<set _bodyWritingOptions["Love Interests"]["Hunter and Prey"] to "hunter_and_prey">>
		<<set _bodyWritingOptions["Love Interests"]["It's Lonely in the Woods"] to "its_lonely_in_the_woods">>
		<<set _bodyWritingOptions["Love Interests"]["Something is Hunting you"] to "something_is_hunting_you">>
	<</if>>
	<<if $dateCount.Avery gte 3 and $NPCName[$NPCNameList.indexOf("Avery")].state isnot "dismissed">>
		<<set _bodyWritingOptions["Love Interests"]["Avery's Trophy"] to "averys_trophy">>
		<<set _bodyWritingOptions["Love Interests"]["Endearing"] to "endearing">>
		<<if ($player.gender is "m" or $player.gender is "h" or $player.gender_appearance is "m" or $backgroundTraits.includes("crossdresser"))>>
			<<set _bodyWritingOptions["Love Interests"]["Uptown Boy"] to "uptown_boy">>
		<</if>>
		<<if ($player.gender is "f" or $player.gender is "h" or $player.gender_appearance is "f" or $backgroundTraits.includes("crossdresser"))>>
			<<set _bodyWritingOptions["Love Interests"]["Uptown Girl"] to "uptown_girl">>
		<</if>>
		<<set _bodyWritingOptions["Love Interests"]["Avery's Monopoly"] to "averys_monopoly">>
	<</if>>
	<<if $farm_stage gte 7 and $alex_countdown is undefined>>
		<<set _bodyWritingOptions["Love Interests"]["Alex's Partner"] to "alexs_partner">>
		<<set _bodyWritingOptions["Love Interests"]["Sunrise to Sunset"] to "sunrise_to_sunset">>
		<<set _bodyWritingOptions["Love Interests"]["Hay Baler"] to "hay_baler">>
		<<if ($player.gender is "m" or $player.gender is "h" or $player.gender_appearance is "m" or $backgroundTraits.includes("crossdresser"))>>
			<<set _bodyWritingOptions["Love Interests"]["Cowboy"] to "cowboy">>
		<</if>>
		<<if ($player.gender is "f" or $player.gender is "h" or $player.gender_appearance is "f" or $backgroundTraits.includes("crossdresser"))>>
			<<set _bodyWritingOptions["Love Interests"]["Cowgirl"] to "cowgirl">>
		<</if>>
	<</if>>
	<<if $sydneyromance is 1>>
		<<set _bodyWritingOptions["Love Interests"]["Sydney's Savior"] to "sydneys_savior">>
		<<set _bodyWritingOptions["Love Interests"]["Bound to Sydney"] to "bound_to_sydney">>
		<<set _bodyWritingOptions["Love Interests"]["Sydney Makes Me :)"] to "sydney_makes_me_smile">>
		<<if $NPCName[$NPCNameList.indexOf("Sydney")].purity gt 1>>
			<<set _bodyWritingOptions["Love Interests"]["Purest Love"] to "purest_love">>
		<<else>>
			<<set _bodyWritingOptions["Love Interests"]["Lusty Sinners"] to "lusty_sinners">>
		<</if>>
	<</if>>
	<<if $syndromewolves is 1 and $deviancy gte 35>>
		<<set _bodyWritingOptions["Love Interests"]["Black Wolf's Bitch"] to "black_wolfs_bitch">>
		<<set _bodyWritingOptions["Love Interests"]["All for my Alpha"] to "all_for_my_alpha">>
		<<if $wolfpackleader is 1>>
			<<set _bodyWritingOptions["Love Interests"]["Leader of the Pack"] to "leader_of_the_pack">>
		<</if>>
		<<set _bodyWritingOptions["Love Interests"]["Runs With Wolves"] to "runs_with_wolves">>
	<</if>>
	<<if $syndromebird is 1>>
		<<set _bodyWritingOptions["Love Interests"]["Great Hawk's Spouse"] to "great_hawks_spouse">>
		<<set _bodyWritingOptions["Love Interests"]["Soaring With Love"] to "soaring_with_love">>
		<<set _bodyWritingOptions["Love Interests"]["Terror's Mate"] to "terrors_mate">>
		<<set _bodyWritingOptions["Love Interests"]["Free Bird"] to "free_bird">>
	<</if>>

/*Needs to be last*/

<<set _keys to Object.keys(_bodyWritingOptions)>>
<<if $bodywritingSet is undefined>>
	<<set $bodywritingSet to "General">>
<</if>>
<<for _i to 0; _i lt _keys.length; _i++>>
	<<capture _i>>

		<<link _keys[_i]>>
			<<removeclass `'#link-'+$bodywritingSet.replace(/ /g,'-')` "selected">>
			<<set $bodywritingSet to clone(_keys[_i])>>
			<<addclass `'#link-'+$bodywritingSet.replace(/ /g,'-')` "selected">>
			<<replace "#bodywritingMenu">><<bodywritingMenu>><</replace>>
		<</link>> |

	<</capture>>
<</for>>

	<<bodywritingMenu>>

<</widget>>

<<widget "bodywritingMenu">>
<<if Object.keys(_bodyWritingOptions[$bodywritingSet]).length gt 0>>
	<<set _bodyPartOptions to {}>>
	<<set _bodyPartOptionsSkip to ["back", "left_bottom", "right_bottom"]>>
	<<for _label, _value range $skin>>
		<<if _bodyPartOptionsSkip.includes(_label)>>
			<<continue>>
		<<elseif Object.keys(_value).length is 0>>
			<<silently>><<bodypart _label>><</silently>>
			<<set _bodyPartOptions[_text_output.toUpperFirst()] to _label>>
		<</if>>
	<</for>>
	<<if Object.keys(_bodyPartOptions).length gt 0>>
		Write
		<<listbox "_bodyWritingSelected">>
			<<optionsfrom _bodyWritingOptions[$bodywritingSet]>>
		<</listbox>>
		on your
		<<listbox "_bodyPartSelected">>
			<<optionsfrom _bodyPartOptions>>
		<</listbox>>

		<<link [[Confirm|$passage]]>>
			<<set $mirrorMenu to "skin">>
			<<set $bodyWritingSelected to Object.keys(_bodyWritingOptions[$bodywritingSet])[Object.values(_bodyWritingOptions[$bodywritingSet]).indexOf(_bodyWritingSelected)]>>
			<<set $bodyPartSelected to _bodyPartSelected>>
			<<add_bodywriting _bodyPartSelected _bodyWritingSelected "pen">>
		<</link>>
	<<else>>
		You're not sure where else you can write an advertisement.
	<</if>>
<</if>>
<</widget>>

<<widget "mirrorHair">>
<<link "Back">><<replace #mirror>><<mirrorMenu>><</replace>><<numberify "#passages > .passage">><<unset $mirrorMenu>><</link>>

__Hair__

Natural (changes both sides and fringe)

Your sides are in the "$hairtype" style, and positioned <<if $hairposition is "front">>in front of<<else>>behind<</if>> your body.

<<set _hairTypeByName to {"Braid left": "braid left", "Braid right": "braid right", "Flat ponytail": "flat ponytail", "Loose": "loose", "Messy": "messy", "Pigtails": "pigtails", "Ponytail": "ponytail", "Short": "short", "Side tail left": "side tail left", "Side tail right": "side tail right", "Straight": "straight", "Swept left": "swept left", "Twin braids": "twin braids", "Twintails": "twintails", "Curl": "curl", "Defined curl": "defined curl", "Neat": "neat"}>>
<<set _fringeTypeByName to {"Thin flaps": "thin flaps", "Wide flaps": "wide flaps", "Hime": "hime", "Loose": "loose", "Messy": "messy", "Overgrown": "overgrown", "Ringlets": "ringlets", "Split": "split", "Straight": "straight", "Swept left": "swept left", "Back": "back", "Parted": "parted", "Flat": "flat", "Quiff": "quiff", "Straight curl": "straight curl", "Ringlet curl": "ringlet curl", "Curtain": "curtain"}>>

<<linkradiogroup "$hairtype" _hairTypeByName>>

<<linkradiogroup "$hairposition" `{
	"Position in front of body": "front",
	"Position behind body": "back",
}`>>

Your fringe is in the "$fringetype" style.

/*<<if $fringetype is "default">>
 *	Changing your fringe from natural will set your sides to messy.
 *<</if>>
*/

<<linkradiogroup "$fringetype" _fringeTypeByName>>

<</widget>>

<<widget "mirrorMakeupPart">>
<<set _itemType = $args[0]>>
<<set _singular = $args[1]>>
<<set _plural = $args[2]>>
<<set _cssClass = $args[3]>>

<<set _items = $makeup.owned[_itemType].filter(x => x.count > 0)>>
<<if $makeup.owned[_itemType].length == 0>>
	You don't own any _plural.
<<elseif _items.length == 0>>
	You ran out of _plural.

<</if>>
<<if _items.length != 0 or $makeup[_itemType] != 0>>
	Apply _singular:

	<<if $makeup[_itemType] != 0>>
		<<capture _itemType>>

		<<link "Remove">>
		<<set $makeup[_itemType] = 0>>
		<<run Engine.show()>>
		<</link>>
		<<print " | ">>
		<</capture>>
	<</if>>
	<<for _i, _item range _items>>
		<<capture _item, _itemType>>

			<<if $makeup[_itemType] == _item.colour>>
				_item.colour
			<<else>>
				<<link _item.colour>>
					<<set $makeup[_itemType] = _item.colour>>
					<<set _item.count -= 1>>
					<<run Engine.show()>>
				<</link>>
			<</if>>

			<<print "×"+_item.count+" | ">>
		<</capture>>
	<</for>>

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

<<widget "mirrorMakeup">>
<<link "Back">><<replace #mirror>><<mirrorMenu>><</replace>><<numberify "#passages > .passage">><<unset $mirrorMenu>><</link>>

__Makeup__

<<set _makeupNames to ["lipstick","eyeshadow","mascara","browscolour","eyelenses"]>>
<<set _makeupData to ["lipstick","eyeshadow","mascara","hairdye","eyelenses"]>>
<<if $mirror_eyebrow_dye is true>>

	<<unset $mirror_eyebrow_dye>>
	You open up the box with $browsDyeOption dye and prepare the mixture.

	Using a small brush you carefully apply the dye to your eyebrows.

	You wait several minutes for the dye to set and hope you didn't mess up anything.

	<<set $makeup.owned.hairdye.find(x => x.colour == $browsDyeOption).count -= 1>>
	<<pass 10>><<set $makeup.browscolour = $browsDyeOption>><<unset $browsDyeOption>>
<</if>>

<<link [[Remove all|$passage]]>>
	<<set $makeup.lipstick to 0>>
	<<set $makeup.eyeshadow to 0>>
	<<set $makeup.mascara to 0>>
	<<set $makeup.eyelenses to 0>>
<</link>> |
<<link [["Randomise"|$passage]]>>
	<<for $_i to 0; $_i lt _makeupNames.length; $_i++>>
		<<if _makeupNames[$_i] is "eyelenses">>
			<<set _rng to random(0, $makeup.owned[_makeupData[$_i]].length)>>
			<<if _rng is $makeup.owned[_makeupData[$_i]].length>>
				<<set $makeup[_makeupNames[$_i]] to 0>>
			<<else>>
				<<set $makeup[_makeupNames[$_i]] to $makeup.owned[_makeupData[$_i]][_rng]>>
			<</if>>
		<<else>>
			<<set _rngset to []>>
			<<for $_label, $_value range $makeup.owned[_makeupData[$_i]]>>
				<<if $_value.count gt 0>>
					<<run _rngset.push($_label)>>
				<</if>>
			<</for>>
			<<run _rngset.push($makeup.owned[_makeupData[$_i]].length)>>
			<<set _rng to _rngset[random(0, _rngset.length - 1)]>>
			<<if _rng is $makeup.owned[_makeupData[$_i]].length and _makeupNames[$_i] is "browscolour">>
				/*Do Nothing*/
			<<elseif _rng is $makeup.owned[_makeupData[$_i]].length>>
				<<set $makeup[_makeupNames[$_i]] to 0>>
			<<elseif $makeup.owned[_makeupData[$_i]][_rng].count gt 0 and $makeup[_makeupNames[$_i]] isnot $makeup.owned[_makeupData[$_i]][_rng].colour>>
				<<set $makeup[_makeupNames[$_i]] to $makeup.owned[_makeupData[$_i]][_rng].colour>>
				<<set $makeup.owned[_makeupData[$_i]][_rng].count-->>
			<</if>>
		<</if>>
	<</for>>
<</link>>

<<if $makeup.presets is undefined>>
	<<set $makeup.presets to {}>>
<</if>>
<<if Object.keys($makeup.presets).length gt 0>>
	Presets:
	<<for _label, _value range $makeup.presets>>
		<<capture _label>>
			<<link _label>>
				<<replace "#makeupPresets">>
					<<makeupPresets _label>>
				<</replace>>
			<</link>> |
		<</capture>>
	<</for>>

<</if>>

<<mirrorMakeupPart "lipstick" "lipstick" "lipsticks" "lipstick">>

<<mirrorMakeupPart "eyeshadow" "eyeshadow" "eyeshadows" "eyeshadow">>

<<mirrorMakeupPart "mascara" "mascara" "mascaras" "mascara">>

<<if !$simpleMirror>>
	/* CONTACT LENSES */
	<<if $makeup.owned.eyelenses.length == 0>>
		You don't own any contact lenses.

	<<else>>
		Wear contact lenses:

		<<if $makeup.eyelenses != 0>>

			<<link "None">>
			<<set $makeup.eyelenses = 0>>
			<<run Engine.show()>>
			<</link>>
			<<print " | ">>
		<</if>>
		<<for _i, _colour range $makeup.owned.eyelenses>>
			<<capture _colour>>

			<<link _colour>>
			<<set $makeup.eyelenses = _colour>>
			<<run Engine.show()>>
			<</link>>

			<<print " | ">>
			<</capture>>
		<</for>>

	<</if>>

	/* DYEING EYEBROWS */
	<<browsDyeReset>>
	Dye your eyebrows:

	<<set _dyes = $makeup.owned.hairdye.filter(x => x.count > 0)>>
	<<if _dyes.length == 0>>
		You have no dyes.
	<<else>>
		<<set _browsDyeOptions to {"Don't dye":"noChange"}>>
		<<for _i to 0; _i lt _dyes.length; _i++>>
			<<if $makeup.browscolour is _dyes[_i].colour or $naturalhaircolour is _dyes[_i].colour>>
				<<continue>>
			<</if>>
			<<set _displayName = _dyes[_i].colour.charAt(0).toUpperCase() + _dyes[_i].colour.slice(1) + " ×" + _dyes[_i].count + "">>
			<<set _browsDyeOptions[_displayName] to _dyes[_i].colour>>
		<</for>>
		<<listbox "$browsDyeOption" autoselect>>
			<<optionsfrom _browsDyeOptions>>
		<</listbox>>
		<<browsColourPreview>>
	<</if>>
	<<if $makeup.browscolour != 0>>

		You can visit a hairdresser to restore your natural brows colour.
	<</if>>

<</if>>

/* CONCEALER */
<<if $player.freckles == true>>
	<<if $makeup.concealer == 0>>

		<<link "Apply concealer to hide freckles">>
		<<set $makeup.concealer = 1>>
		<<run Engine.show()>>
		<</link>>

	<<else>>

		<<link "Remove concealer">>
		<<set $makeup.concealer = 0>>
		<<run Engine.show()>>
		<</link>>

	<</if>>

<</if>>

__New Makeup Preset__ - Saves the makeup you current have on

<<textbox "_newPresetName" "">>
<<link [[Save preset|$passage]]>>
	<<set _newPresetName to _newPresetName.replace(/[^a-zA-Z 0-9]+/g,"")>>
	<<set $makeup.presets[_newPresetName] to {
		lipstick:clone($makeup.lipstick),
		eyeshadow:clone($makeup.eyeshadow),
		mascara:clone($makeup.mascara),
		browscolour:clone($makeup.browscolour),
		eyelenses:clone($makeup.eyelenses),
	}>>
<</link>>

<</widget>>

<<widget "makeupPresets">>
<<set _presetChosen to $makeup.presets[$args[0]]>>
Preset: <<print $args[0]>>

<<for $_label, $_value range _presetChosen>>
	<<switch $_label>>
		<<case "browscolour">>
			Eyebrows dye: <<makeupPresetsItem "hairdye" $_value>>
		<<case "lipstick">>
			Lipstick: <<makeupPresetsItem $_label $_value>>
		<<case "eyeshadow">>
			Eye Shadow: <<makeupPresetsItem $_label $_value>>
		<<case "mascara">>
			Mascera: <<makeupPresetsItem $_label $_value>>
		<<case "eyelenses">>
			Contact Lens: <<makeupPresetsItem $_label $_value>>
	<</switch>>

<</for>>

<<link [[Apply preset makeup|$passage]]>>
	<<for $_i to 0; $_i lt _makeupNames.length; $_i++>>
		<<if _makeupNames[$_i] is "eyelenses">>
			<<if _presetChosen[_makeupNames[$_i]] is 0>>
				<<set $makeup[_makeupNames[$_i]] to 0>>
			<<elseif $makeup.owned[_makeupNames[$_i]].includes(_presetChosen[_makeupNames[$_i]])>>
				<<set $makeup[_makeupNames[$_i]] to _presetChosen[_makeupNames[$_i]]>>
			<</if>>
		<<elseif _presetChosen[_makeupNames[$_i]] is 0 and _makeupNames[$_i] is "hairdye">>
			/*Do Nothing*/
		<<elseif _presetChosen[_makeupNames[$_i]] is 0>>
			<<set $makeup[_makeupNames[$_i]] to 0>>
		<<else>>
			<<for $_label, $_value range $makeup.owned[_makeupData[$_i]]>>
				<<if $_value.colour is _presetChosen[_makeupNames[$_i]] and $_value.colour isnot $makeup[_makeupNames[$_i]] and $_value.count gt 0>>
					<<set $makeup[_makeupNames[$_i]] to clone($_value.colour)>>
					<<set $_value.count-->>
					<<break>>
				<</if>>
			<</for>>
		<</if>>
	<</for>>
<</link>> |
<<link [[Delete preset|$passage]]>>
	<<run delete $makeup.presets[$args[0]]>>
<</link>>
<</widget>>

<<widget "makeupPresetsItem">>
<<if $args[0] isnot undefined and $args[1] isnot undefined>>
	<<if $args[1] is 0 and $args[0] is "hairdye">>
		Unable to remove.
	<<elseif $args[1] is 0>>
		Remove.
	<<else>>
		<<if $args[0] is "eyelenses">>
			<<if $makeup.owned.eyelenses.includes($args[1])>>
				<<print $args[1]>> (Owned).
			<<else>>
				<<print $args[1]>> (Not Owned).
			<</if>>
		<<else>>
			<<for $_i to 0; $_i lt $makeup.owned[$args[0]].length; $_i++>>
				<<if $makeup.owned[$args[0]][$_i].colour is $args[1]>>
					<<if $makeup.owned[$args[0]][$_i].count gt 0>>
						<<print $args[1]>> (<<print $makeup.owned[$args[0]][$_i].count>>).
					<<else>>
						<<print $args[1]>> (0).
					<</if>>
					<<break>>
				<</if>>
			<</for>>
		<</if>>
	<</if>>
<</if>>
<</widget>>

<<widget "browsColourPreview">>

<<if $browsDyeOption isnot "noChange">>

<<link [[Dye eyebrows (0:15)|$passage]]>><<set $mirror_eyebrow_dye to true>><<pass 15>><</link>>
<</if>>

<</widget>>

<<widget "mirrorTransformation">>
<<link "Back">><<replace #mirror>><<mirrorMenu>><</replace>><<numberify "#passages > .passage">><<unset $mirrorMenu>><</link>>

Hiding parts of your Inner Self will slowly increase your Trauma over time (excludes pubes and pits).
If your Trauma gets too high, you will be unable to hide.

<<if $angel gt 1>>
	__Angel__

	<<if $transformationParts.angel.halo isnot "disabled">>
		Angel Halo:
		<<listbox "$transformationParts.angel.halo" autoselect>>
			<<option "Hide" "hidden">>
			<<option "Default" "default">>
		<</listbox>>

	<</if>>
	<<if $transformationParts.angel.wings isnot "disabled">>
		Angel Wings:
		<<listbox "$transformationParts.angel.wings" autoselect>>
			<<option "Hide" "hidden">>
			<<option "Default" "default">>
		<</listbox>>

	<</if>>

<</if>>
<<if $fallenangel gt 1>>
	__Fallen Angel__

	<<if $transformationParts.fallenAngel.halo isnot "disabled">>
		Fallen Angel Halo:
		<<listbox "$transformationParts.fallenAngel.halo" autoselect>>
			<<option "Hide" "hidden">>
			<<option "Default" "default">>
		<</listbox>>

	<</if>>
	<<if $transformationParts.fallenAngel.wings isnot "disabled">>
		Fallen Angel Wings:
		<<listbox "$transformationParts.fallenAngel.wings" autoselect>>
			<<option "Hide" "hidden">>
			<<option "Default" "default">>
		<</listbox>>

	<</if>>

<</if>>
<<if $demon gt 1>>
	__Demon__

	<<if $transformationParts.demon.horns isnot "disabled">>
		Demon Horns:
		<<listbox "$transformationParts.demon.horns" autoselect>>
			<<option "Hide" "hidden">>
			<<option "Default" "default">>
			<<option "Classic" "classic">>
		<</listbox>>

	<</if>>
	<<if $transformationParts.demon.wings isnot "disabled">>
		Demon Wings:
		<<listbox "$transformationParts.demon.wings" autoselect>>
			<<option "Hide" "hidden">>
			<<option "Default" "default">>
		<</listbox>>

	<</if>>
	<<if $transformationParts.demon.tail isnot "disabled">>
		Demon Tail:
		<<listbox "$transformationParts.demon.tail" autoselect>>
			<<option "Hide" "hidden">>
			<<option "Default" "default">>
			<<option "Classic" "classic">>
		<</listbox>>

	<</if>>

<</if>>
<<if $cat gt 1>>
	__Cat__

	<<if $transformationParts.cat.ears isnot "disabled">>
		Cat Ears:
		<<listbox "$transformationParts.cat.ears" autoselect>>
			<<option "Hide" "hidden">>
			<<option "Default" "default">>
		<</listbox>>

	<</if>>
	<<if $transformationParts.cat.tail isnot "disabled">>
		Cat Tail:
		<<listbox "$transformationParts.cat.tail" autoselect>>
			<<option "Hide" "hidden">>
			<<option "Default" "default">>
		<</listbox>>

	<</if>>

<</if>>
<<if $bunny gt 1>>
	__Bunny__

	<<if $transformationParts.bunny.ears isnot "disabled">>
		Bunny Ears:
		<<listbox "$transformationParts.bunny.ears" autoselect>>
			<<option "Hide" "hidden">>
			<<option "Default" "default">>
		<</listbox>>

	<</if>>

<</if>>
<<if $cow gt 1>>
	__Cow__

	<<if $transformationParts.cow.horns isnot "disabled">>
		Cow Horns:
		<<listbox "$transformationParts.cow.horns" autoselect>>
			<<option "Hide" "hidden">>
			<<option "Default" "default">>
		<</listbox>>

	<</if>>
	<<if $transformationParts.cow.ears isnot "disabled">>
		Cow Ears:
		<<listbox "$transformationParts.cow.ears" autoselect>>
			<<option "Hide" "hidden">>
			<<option "Default" "default">>
		<</listbox>>

	<</if>>
	<<if $transformationParts.cow.tail isnot "disabled">>
		Cow Tail:
		<<listbox "$transformationParts.cow.tail" autoselect>>
			<<option "Hide" "hidden">>
			<<option "Default" "default">>
		<</listbox>>

	<</if>>

<</if>>
<<if $wolfgirl gt 1>>
	__Wolf__

	<<if $transformationParts.wolf.ears isnot "disabled">>
		Wolf Ears:
		<<listbox "$transformationParts.wolf.ears" autoselect>>
			<<option "Hide" "hidden">>
			<<option "Default" "default">>
			<<option "Feral" "feral">>
		<</listbox>>

	<</if>>
	<<if $transformationParts.wolf.tail isnot "disabled">>
		Wolf Tail:
		<<listbox "$transformationParts.wolf.tail" autoselect>>
			<<option "Hide" "hidden">>
			<<option "Default" "default">>
			<<option "Feral" "feral">>
		<</listbox>>

	<</if>>

	<<if $transformationParts.wolf.cheeks isnot "disabled">>
		Wolf Cheeks:
		<<listbox "$transformationParts.wolf.cheeks" autoselect>>
			<<option "Hide" "hidden">>
			<<option "Feral" "feral">>
		<</listbox>>

	<</if>>
	<<if $transformationParts.wolf.pubes isnot "disabled" and $pbdisable is "f">>
		Wolf Pubes:
		<<listbox "$transformationParts.wolf.pubes" autoselect>>
			<<option "Hide" "hidden">>
			<<option "Default" "default">>
		<</listbox>>

	<</if>>

	<<if $transformationParts.wolf.pits isnot "disabled" and $pbdisable is "f">>
		Wolf Pits:
		<<listbox "$transformationParts.wolf.pits" autoselect>>
			<<option "Hide" "hidden">>
			<<option "Default" "default">>
		<</listbox>>

	<</if>>

<</if>>
<<if $harpy gt 1>>
	__Bird__

	<<if $transformationParts.bird.eyes isnot "disabled">>
		Bird eyes:
		<<listbox "$transformationParts.bird.eyes" autoselect>>
			<<option "Hide" "hidden">>
			<<option "Default" "default">>
		<</listbox>>

	<</if>>
	<<if $transformationParts.bird.malar isnot "disabled">>
		Bird Malar Stripes:
		<<listbox "$transformationParts.bird.malar" autoselect>>
			<<option "Hide" "hidden">>
			<<option "Default" "default">>
		<</listbox>>

	<</if>>
	<<if $transformationParts.bird.plumage isnot "disabled">>
		Bird Plumage:
		<<listbox "$transformationParts.bird.plumage" autoselect>>
			<<option "Hide" "hidden">>
			<<option "Default" "default">>
		<</listbox>>

	<</if>>
	<<if $transformationParts.bird.tail isnot "disabled">>
		Bird Tail:
		<<listbox "$transformationParts.bird.tail" autoselect>>
			<<option "Hide" "hidden">>
			<<option "Default" "default">>
		<</listbox>>

	<</if>>
	<<if $transformationParts.bird.wings isnot "disabled">>
		Bird Wings:
		<<listbox "$transformationParts.bird.wings" autoselect>>
			<<option "Hide" "hidden">>
			<<option "Default" "default">>
		<</listbox>>

	<</if>>
	<<if $transformationParts.bird.pubes isnot "disabled" and $pbdisable is "f">>
		Bird Pubes:
		<<listbox "$transformationParts.bird.pubes" autoselect>>
			<<option "Hide" "hidden">>
			<<option "Default" "default">>
		<</listbox>>

	<</if>>

<</if>>
<<link [[Confirm|$passage]]>>
	<<set $mirrorMenu to "transformation">>
<</link>>
<</widget>>

<<widget "mirrorDebug">>
<<link "Back">><<replace #mirror>><<mirrorMenu>><</replace>><<numberify "#passages > .passage">><<unset $mirrorMenu>><</link>>

<<link "<<<">><<set $hairlength -= 1000>><<clamp>><<replace "#statshairlength">><<print Math.trunc($hairlength)>><</replace>><</link>> |
<<link "<<">><<set $hairlength -= 100>><<clamp>><<replace "#statshairlength">><<print Math.trunc($hairlength)>><</replace>><</link>> |
<<link "<">><<set $hairlength -= 10>><<clamp>><<replace "#statshairlength">><<print Math.trunc($hairlength)>><</replace>><</link>> |
Hair length: <<print Math.trunc($hairlength)>>
 | <<link ">">><<set $hairlength += 10>><<clamp>><<replace "#statshairlength">><<print Math.trunc($hairlength)>><</replace>><</link>>
 | <<link ">>">><<set $hairlength += 100>><<clamp>><<replace "#statshairlength">><<print Math.trunc($hairlength)>><</replace>><</link>>
 | <<link ">>>">><<set $hairlength += 1000>><<clamp>><<replace "#statshairlength">><<print Math.trunc($hairlength)>><</replace>><</link>>

<<link "<<<">><<set $fringelength -= 1000>><<clamp>><<replace "#statsfringelength">><<print Math.trunc($fringelength)>><</replace>><</link>> |
<<link "<<">><<set $fringelength -= 100>><<clamp>><<replace "#statsfringelength">><<print Math.trunc($fringelength)>><</replace>><</link>> |
<<link "<">><<set $fringelength -= 10>><<clamp>><<replace "#statsfringelength">><<print Math.trunc($fringelength)>><</replace>><</link>> |
Fringe length: <<print Math.trunc($fringelength)>>
 | <<link ">">><<set $fringelength += 10>><<clamp>><<replace "#statsfringelength">><<print Math.trunc($fringelength)>><</replace>><</link>>
 | <<link ">>">><<set $fringelength += 100>><<clamp>><<replace "#statsfringelength">><<print Math.trunc($fringelength)>><</replace>><</link>>
 | <<link ">>>">><<set $fringelength += 1000>><<clamp>><<replace "#statsfringelength">><<print Math.trunc($fringelength)>><</replace>><</link>>

Hair Colour (<<= $haircolour>>):
<<link "Black">><<set $haircolour to "black">><<goto "Wardrobe">><</link>> |
<<link "Brown">><<set $haircolour to "brown">><<goto "Wardrobe">><</link>> |
<<link "Red">><<set $haircolour to "red">><<goto "Wardrobe">><</link>> |
<<link "Ginger">><<set $haircolour to "ginger">><<goto "Wardrobe">><</link>> |
<<link "Blond">><<set $haircolour to "blond">><<goto "Wardrobe">><</link>> |
<<link "Green">><<set $haircolour to "green">><<goto "Wardrobe">><</link>> |
<<link "Blue">><<set $haircolour to "blue">><<goto "Wardrobe">><</link>> |
<<link "Purple">><<set $haircolour to "purple">><<goto "Wardrobe">><</link>>

<<link "Skip day">><<pass 23 hours>><<effects>><<goto "Mirror">><</link>>

<</widget>>


code:
:: mobileStats [widget]
<<widget "mobileStats">>
<<if $sidebarStats is "All" or $pain gt 50>>
	<<mobileStatsColor "pain">>

		P

<</if>>
<<if $sidebarStats is "All" or $arousal gt $arousalmax / 2>>
	<<mobileStatsColor "arousal">>

		Ar

<</if>>
<<if $sidebarStats is "All" or $tiredness gt $tirednessmax / 2>>
	<<mobileStatsColor "fatigue">>

		F

<</if>>
<<if $sidebarStats is "All" or $stress gt $stressmax / 2>>
	<<mobileStatsColor "stress">>

		S

<</if>>
<<if $innocencestate is 1 and ($sidebarStats is "All" or $awareness gt -100)>>
	<<mobileStatsColor "innocence">>

		I

<<elseif $sidebarStats is "All" or $trauma gt $traumamax / 2>>
	<<mobileStatsColor "trauma">>

		T

<</if>>
<<if $sidebarStats is "All" or $control gt $controlmax / 2>>
	<<mobileStatsColor "control">>

		C

<</if>>
<<mobileStatsColor "allure">>

	Al

<<if $drunk gt 0>>
	<<mobileStatsColor "drunk">>

		Dk

<</if>>
<<if $drugged gt 0>>
	<<mobileStatsColor "drugged">>

		Dg

<</if>>
<<if $hallucinogen gt 0>>
	<<mobileStatsColor "hallucinogen">>

		H

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

<<widget "mobileStatsTime">>

	<<if $timestyle is "ampm">>
		<<if $hour gte 13>>
			<<print ($hour - 12)>>:<<print ($time - $hour * 60).toString().padStart(2, "0")>>pm
		<<else>>
			<<print ($hour is 0 ? "12" : $hour)>>:<<print ($time - $hour * 60).toString().padStart(2, "0")>><<if $hour is 12>>pm<<else>>am<</if>>
		<</if>>
	<<else>>
		<<if $hour lt 10>>0<</if>>$hour:<<print ($time - $hour * 60).toString().padStart(2, "0")>>
	<</if>>

<</widget>>

<<widget "mobileStatsColor">>
	<<switch $args[0]>>
	<<case "pain">>
		<<mobileStatsColorSet `($pain gte 100 and $willpowerpain is 0 ? $pain : Math.clamp($pain, 0, 99))` 100>>
	<<case "arousal">>
		<<mobileStatsColorSet `Math.clamp($arousal, 0, $arousalmax)` $arousalmax>>
	<<case "fatigue">>
		<<mobileStatsColorSet `Math.clamp($tiredness, 0, $tirednessmax)` $tirednessmax>>
	<<case "stress">>
		<<mobileStatsColorSet `Math.clamp($stress, 0, $stressmax)` $stressmax>>
	<<case "innocence">>
		<<mobileStatsColorSetIverted `Math.clamp($awareness, 0, -200)` -200>>
	<<case "trauma">>
		<<mobileStatsColorSet `Math.clamp($trauma, 0, $traumamax)` $traumamax>>
	<<case "control">>
		<<mobileStatsColorSetIverted `Math.clamp($control, 0, $controlmax)` $controlmax>>
	<<case "allure">>
		<<mobileStatsColorAllure>>
	<<case "drunk">>
		<<mobileStatsColorSet `Math.clamp($drunk, 50, 500)` 500>>
	<<case "drugged">>
		<<mobileStatsColorSet `Math.clamp($drugged, 50, 500)` 500>>
	<<case "hallucinogen">>
		<<mobileStatsColorSet `Math.clamp($hallucinogen, 50, 500)` 500>>
	<</switch>>
<</widget>>

<<widget "mobileStatsColorSet">>
	<<if $args[0] is 0>>
		<<set _mobileColor to "green">>
	<<else>>
		<<set _percent=Math.floor(($args[0]/$args[1])*10)>>
		<<switch _percent>>
		<<case 8 9>>
			<<set _mobileColor to "pink">>
		<<case 6 7>>
			<<set _mobileColor to "purple">>
		<<case 4 5>>
			<<set _mobileColor to "blue">>
		<<case 2 3>>
			<<set _mobileColor to "lblue">>
		<<case 0 1>>
			<<set _mobileColor to "teal">>
		<<default>>
			<<set _mobileColor to "red">>
		<</switch>>
	<</if>>
<</widget>>

<<widget "mobileStatsColorSetIverted">>
	<<if $args[0] is 0>>
		<<set _mobileColor to "red">>
	<<else>>
		<<set _percent=Math.floor(($args[0]/$args[1])*10)>>
		<<switch _percent>>
		<<case 8 9>>
			<<set _mobileColor to "teal">>
		<<case 6 7>>
			<<set _mobileColor to "lblue">>
		<<case 4 5>>
			<<set _mobileColor to "blue">>
		<<case 2 3>>
			<<set _mobileColor to "purple">>
		<<case 0 1>>
			<<set _mobileColor to "pink">>
		<<default>>
			<<set _mobileColor to "green">>
		<</switch>>
	<</if>>
<</widget>>

<<widget "mobileStatsColorAllure">>
	<<if $allure gte (6000 * $alluremod)>>
		<<set _mobileColor to "red">>
	<<else>>
		<<switch Math.floor($allure / $alluremod / 1000)>>
		<<case 3>>
			<<set _mobileColor to "purple">>
		<<case 2>>
			<<set _mobileColor to "blue">>
		<<case 1>>
			<<if $allure / $alluremod gte 1500>>
				<<set _mobileColor to "lblue">>
			<<else>>
				<<set _mobileColor to "teal">>
			<</if>>
		<<case 0>>
			<<set _mobileColor to "green">>
		<<default>>
			<<set _mobileColor to "pink">>
		<</switch>>
	<</if>>
<</widget>>


code:
:: Widgets Name List [widget]
<<widget "init_names">>
<<set $NPC_names_m to [
    "Oliver",
    "Noah",
    "George",
    "Arthur",
    "Freddie",
    "Leo",
    "Theo",
    "Oscar",
    "Charlie",
    "Harry",
    "Michael",
    "Christopher",
    "Matthew",
    "Joshua",
    "Jacob",
    "Nicholas",
    "Andrew",
    "Daniel",
    "Tyler",
    "Joseph",
    "James",
    "David",
    "Robert",
    "Jack",
    "Richard",
    "Paul",
    "Mark",
    "Thomas",
    "Adam",
    "Jason",
    "Connor",
    "Jake",
    "John",
    "Brian",
    "William",
    "Ben",
    "Kevin",
    "Eric",
    "Jeffrey",
    "Jamie",
    "Louis",
    "Ryan",
    "Mark",
    "Joe",
    "Stephen",
    "Ian",
    "Austin",
    "Kyle",
    "Zach",
    "Patrick"
    ]>>

<<set $NPC_names_f to [
    "Olivia",
    "Amelia",
    "Isla",
    "Ava",
    "Mia",
    "Grace",
    "Freya",
    "Lily",
    "Sophia",
    "Ivy",
    "Jessica",
    "Ashley",
    "Emily",
    "Sarah",
    "Samantha",
    "Amanda",
    "Brittany",
    "Elizabeth",
    "Taylor",
    "Megan",
    "Laura",
    "Gemma",
    "Emma",
    "Rebecca",
    "Claire",
    "Victoria",
    "Rachel",
    "Amy",
    "Jennifer",
    "Nicola",
    "Katie",
    "Lisa",
    "Julie",
    "Melissa",
    "Michelle",
    "Kim",
    "Angela",
    "Heather",
    "Stephanie",
    "Nicole",
    "Christina",
    "Susan",
    "Karen",
    "Jacqueline",
    "Deborah",
    "Tracey",
    "Jane",
    "Helen",
    "Diane",
    "Sharon"
    ]>>
<</widget>>