code:
:: Widgets Settings [widget]

<<widget "initsettings">>
<<set $player.gender to "f">>
<<set $player.sex to "f">>
<<set $player.gender_body to "a">>
<<set $player.ballsExist to false>>
<<set $player.freckles to false>>
<<set $devlevel to 12>>
<<set $bodysize to 2>>
<<set $breastsize to 0>>
<<set $breastsensitivity to 1>>
<<set $penissize to 1>>
<<set $genitalsensitivity to 1>>
<<set $eyeselect to "purple">>
<<set $hairselect to "red">>
<<set $hairlength to 200>>
<<set $awareselect to "innocent">>
<<set $background to "waif">>
<<if StartConfig.enableImages is true>>
	<<set $images to 1>>
	<<set $silhouettedisable to "f">>
<</if>>
<<set $numberify_enabled to 1>>
<<set $gamemode to "normal">>
<<set $whitechance to 90>>
<<set $blackchance to 10>>
<<set $bestialitydisable to "f">>
<<set $swarmdisable to "f">>
<<set $spiderdisable to "f">>
<<set $slugdisable to "f">>
<<set $waspdisable to "f">>
<<set $beedisable to "f">>
<<set $lurkerdisable to "f">>
<<set $horsedisable to "f">>
<<set $bodywritingLvl to 3>>
<<set $parasitedisable to "f">>
<<set $bestialitydisable to "f">>
<<set $slimedisable to "f">>
<<set $voredisable to "f">>
<<set $tentacledisable to "f">>
<<set $plantdisable to "t">>
<<set $analdisable to "f">>
<<set $analdoubledisable to "f">>
<<set $analingusdisablegiving to "f">>
<<set $analingusdisablereceiving to "f">>
<<set $vaginaldoubledisable to "f">>
<<set $transformdisable to "f">>
<<set $transformdisabledivine to "f">>
/*<<set $hirsutedisable to "t">>*/
<<set $breastfeedingdisable to "f">>
<<set $analpregdisable to "f">>
<<set $asphyxiaLvl to 3>>
<<set $NudeGenderDC to 1>>
<<set $footdisable to "f">>
<<set $tipdisable to "f">>
<<set $bodywritingImages to true>>
<<if $debug is 1>>
	<<set $debugdisable to "f">>
<<else>>
	<<set $debugdisable to "t">>
<</if>>
<<set $cheatdisable to "t">>
<<set $watersportsdisable to "f">>
<<set $timestyle to "military">>
<<set $saveName to "">>
<<set $zoom to 100>>
<<set $checkstyle to "words">>
<<set $blackwolfmonster to 1>>
<<set $greathawkmonster to 1>>
<<set $blinkingdisable to "f">>
<<set $halfcloseddisable to "f">>

<<set $newWardrobeStyle to true>>
<<set $imgLighten to "">>
<<set $sidebarStats to "Disabled">>
<<set $sidebarTime to "Disabled">>
<<set $combatControls to "radio">>
<<set $reducedLineHeight to false>>
<<set $sidebarAnimations to true>>
<<set $combatAnimations to true>>
<<set $clothesPrice to 1>>
<<set $clothesPriceUnderwear to 1>>
<<set $clothesPriceSchool to 1>>
<<set $clothesPriceLewd to 1>>
<<set $baseVaginalPregnancyChance to 80>>
<<set $baseNpcPregnancyChance to 8>>
<<set $humanPregnancyMonths to 3>>
<<set $wolfPregnancyWeeks to 4>>
<<set $playerPregnancyHumanDisable to "f">>
<<set $playerPregnancyBeastDisable to "f">>
<<set $npcPregnancyDisable to "f">>
<<set $rentmod to 1>>
<<set $condomchance to 50>>
<<set $condomautochance to 50>>
<<set $multipleWardrobes to "isolated">>
<<set $targetYourself to false>>

<<set $notifyUpdate = true>>

<<startingPlayerImageReset>>
<</widget>>

<<widget "displaySettings">>
<<if $args[0]>>
	<<set $currentSettings to $args[0]>>
<</if>>
<<if $passage isnot "Start" and ["characterSettings", "featSettings"].includes($currentSettings)>>
	<<set $currentSettings to "gameSettings">>
<</if>>
<<switch $currentSettings>>
	<<case "quickStart">><<replace #settingsDiv>><<quickStart>><</replace>>
	<<case "presetConfirmDetails">><<replace #settingsDiv>><<presetConfirmDetails>><</replace>>
	<<case "characterSettings">>
		<<replace #settingsDiv>><<characterSettings>><</replace>>
		<<if StartConfig.enableImages and $passage is "Start">><<startingPlayerImageUpdate>><<removeclass #startingPlayerImage "hidden">><</if>>
	<<case "featSettings">><<replace #settingsDiv>><<featSettings>><</replace>>
	<<case "gameSettings">><<replace #settingsDiv>><<gameSettings>><</replace>>
	<<case "sizeLimitsSettings">><<replace #settingsDiv>><<sizeLimitsSettings>><</replace>>
	<<case "npcSettings">><<replace #settingsDiv>><<npcSettings>><</replace>>
	<<case "generalSettings">><<replace #settingsDiv>><<generalSettings>><</replace>>
	<<case "exportsettings">><<replace #settingsDiv>><<exportsettings>><</replace>>
	<<case "importConfirmDetails">><<replace #settingsDiv>><<importConfirmDetails>><</replace>>
	<<default>><<replace #settingsDiv>><<gameSettings>><</replace>>
<</switch>>
<<if $currentSettings isnot "importConfirmDetails">>
	<<unset $importString>>
<</if>>
<</widget>>

<<widget "displaySubsection">>
<<if $args[0]>>
	<<set $currentSubsection to $args[0]>>
<</if>>
<<switch $currentSubsection>>
	<<case "humanSettings">><<replace #subsectionDiv>><<humanSettings>><</replace>>
	<<case "beastSettings">><<replace #subsectionDiv>><<beastSettings>><</replace>>
	<<case "priceSettings">><<replace #subsectionDiv>><<priceSettings>><</replace>>
	<<case "pregnancySettings">><<replace #subsectionDiv>><<pregnancySettings>><</replace>>
	<<default>><<replace #subsectionDiv>><<humanSettings>><</replace>>
<</switch>>
<</widget>>

<<widget "settings">>
<<updatehistorycontrols>>
<<if $passage is "Start">>

		<<settingsExit>>

<</if>>
<<set $cheatdisabletoggle to $cheatdisable>>

	<<button `$passage is "Start" ? "Quick Start" : "Quick Edit"`>>
		<<displaySettings "quickStart">>
	<</button>>
	<<if $passage is "Start">>
		<<button "Character Creation*">>
			<<displaySettings "characterSettings">>
		<</button>>
		<<if $images is 1>>
			<<button "Feat Boosts* ">>
				<<displaySettings "featSettings">>
			<</button>>
		<<else>>
			<<button "Feat Boosts*">>
				<<displaySettings "featSettings">>
			<</button>>
		<</if>>
	<</if>>
	<<button "Game Settings">>
		<<displaySettings "gameSettings">>
	<</button>>
	<<button "Size Limits">>
		<<displaySettings "sizeLimitsSettings">>
	<</button>>
	<<button "Named NPC Settings">>
		<<displaySettings "npcSettings">>
	<</button>>
	<<button "General">>
		<<displaySettings "generalSettings">>
	<</button>>
	<<button "Export/Import Settings">>
		<<displaySettings "exportsettings">>
	<</button>>

	<<if $passage is "Start">>
		<<quickStart>><<set $currentSettings to "quickStart">>
	<<else>>
		<<quickStart>><<set $currentSettings to "quickStart">>
	<</if>>

<<link "Top of Page">>
	<>
<</link>>
<<if $passage isnot "Start">>

	<<settingsExit>>

<</if>>

<</widget>>

<<widget "settingsExit">>
<<if $passage is "Start">>
	<<set _buttonName to "Begin">>
<<else>>
	<<set _buttonName to "Confirm">>
<</if>>
<<link _buttonName>>
	<<if ($feats.locked is true or ($cheatdisabletoggle is "t" and $rentmod gte 1)) and ($feats.soft is true or ($gamemode isnot "soft" and $alluremod gte 1)) and $maxStates lte 5>>
		<<settingsExitFunction>>
	<<elseif $maxStates lte 5>>
		<<replace #settingsExit>><<settingsExitConfirm>><</replace>>
	<<else>>
		<<replace #settingsExit>><<settingsExitConfirmHistory>><</replace>>
	<</if>>
<</link>>
<</widget>>

<<widget "settingsExitConfirm">>
Some settings will disable feats in some way, is this OK?

<<link "No, please undo these changes">>
	<<set $cheatdisabletoggle to "t">>
	<<if $gamemode is "soft">>
		<<set $gamemode to "normal">>
	<</if>>
	<<if $alluremod lt 1>>
		<<set $alluremod to 1>>
	<</if>>
	<<if $rentmod lt 1>>
		<<set $rentmod to 1>>
	<</if>>
	<<replace #settingsExit>><<settingsExit>><</replace>>
	<<displaySettings>>
<</link>>

<<link "Yes">>
	<<settingsExitFunction>>
<</link>>
<</widget>>

<<widget "settingsExitConfirmHistory">>
WARNING! Your history depth setting is too high!

Values above 5 can lead to errors when creating new saves! Make sure you know what you're doing before proceeding, or turn it down!

<<link "Disable the feature">>
	<<set $maxStates to 1>>
	<<replace #settingsExit>><<settingsExit>><</replace>>
	<<displaySettings>>
<</link>>

<<link "Lower the values to safer levels">>
	<<set $maxStates to 5>>
	<<replace #settingsExit>><<settingsExit>><</replace>>
	<<displaySettings>>
<</link>>

<<link "I love shooting myself in the foot">>
	<<settingsExitFunction>>
<</link>>
<</widget>>

<<widget "settingsExitFunction">>
	<<if $settingsExitPassage is "Start2">>
		<<setSkinColorBase>>
	<</if>>
	<<set $cheatdisable to $cheatdisabletoggle>>
	<<if $cheatdisable is "f" or $rentmod lt 1>>
		<<set $feats.locked to true>>
	<</if>>
	<<unset $cheatdisabletoggle>>
	<<if $gamemode is "soft" or $alluremod lt 1>>
		<<set $feats.soft to true>>
	<</if>>
	<<updatehistorycontrols>>
	<<initnpcgender>>
	<<updatePersistentNPCs>>
	<<hirsuteHideCheck>>
	<<generateTipsList>>
	<<tanned 0 "ignoreCoverage">>
	<<if $player.freckles is "random">>
		<<set $player.freckles to (random(1, 5) is 1)>>
	<</if>>

	<<if $facestyle is "" or isImageOk("#testImage")>>
		<<set $facestyle = "default">>
	<</if>>

	<<if $mannequinHasPenis is undefined>>
		<<set $mannequinHasPenis to $player.penisExist>>
		<<set $mannequinBreastsSize to ($mannequinHasPenis ? 0 : 3)>>
	<</if>>
	<<if $clothesPriceLewd lt Math.ceil(10 / $clothesPrice) * 0.1>>
		<<set $clothesPriceLewd to parseFloat((Math.ceil(10 / $clothesPrice) * 0.1).toFixed(1))>>
	<</if>>
	<<set _settingsExitPassage to clone($settingsExitPassage)>>
	<<unset $settingsExitPassage>>
	<<run State.display(_settingsExitPassage)>>
	<<set $saveName to $saveName.replace(/[^a-zA-Z 0-9]+/g,"")>>
	<<unset $importString>>
<</widget>>

/*complete:{"Vrelnir (Default)":"vrelDefault","Lollipop Scythe":"lollipopScythe","PurityGuy":"purityGuy","Fangi":"fangi"},*/
<<widget "quickStartOptions">>
<<if _quickStartOptions is undefined>>
	<<set _quickStartOptions to {
		player:{"Female Waif":"femaleWaif","Male Waif":"maleWaif", "Hermaphrodite Waif":"hermaphroditeWaif", "Vrelnir PC":"vrel", "Crossdresser":"crossdresser","Tough Guy":"toughGuy"},
		genericNpc:{"Default Genders":"genericNpcDefaultGender", "All Male":"genericNpcAllMaleGender", "All Female":"genericNpcAllFemaleGender"},
		namedNpc:{"Default Genders":"namedNpcDefaultGender", "All Male":"namedNpcAllMaleGender", "All Female":"namedNpcAllFemaleGender"},
		beasts:{"Default Genders":"beastDefaultGenders", "All Male":"beastMaleGenders", "All Female":"beastFemaleGenders"},
		monsters:{"When Hallucinating":"monstersDefault", "No Monsters":"monstersNone", "All Monsters":"monstersAll"},
		kink:{"Reasonably Debauched":"kinkDefault", "Vanilla":"kinkVanilla", "No Beasts":"kinkNoBeasts", "Everything Goes":"kinkEverything"},
		game:{
			"Normal ":"gameNormal","Soft (No Feats)":"gameSoft","Hard":"gameHard","Masochist":"gameMasochist","Soft with Cheats (No Feats)":"gameSoftCheats","Normal with Cheats (No Feats)":"gameNormalCheats","Hard with Cheats (No Feats)":"gameHardCheats","Masochist with Cheats (No Feats)":"gameMasochistCheats"
		},
		images:{"Default":"imagesdefault","High Quality":"imagesHigh","Low Quality":"imagesLow","Performance Mode":"imagesPerformance","Disable images":"imagesDisable"},
		settings:{"PC, Tips":"settingPCTip","PC, no Tips":"settingPCNoTip","Mobile, Tips":"settingMobileTips","Mobile, no Tips":"settingMobileNoTips"}
	}>>
<</if>>
<</widget>>

<<widget "quickStart">>
<<quickStartOptions>>
Gender ratios and kinks can be fine-tuned in the Game Settings Tab.

/*
Complete Contributor Preset: <<listbox "_completePreset" autoselect>><<optionsfrom _quickStartOptions.complete>><</listbox>> |
<<link Set>><<presets _completePreset>><</link>>

*/

/*
Player Preset: <<listbox "_playerPreset" autoselect>><<optionsfrom _quickStartOptions.player>><</listbox>> |
<<link Set>><<presets _playerPreset>><</link>>

*/

Generic NPC Preset: <<listbox "_genericNpcPreset" autoselect>><<optionsfrom _quickStartOptions.genericNpc>><</listbox>> |
<<link Set>><<presets _genericNpcPreset>><</link>>

Named NPC Preset: <<listbox "_namedNpcPreset" autoselect>><<optionsfrom _quickStartOptions.namedNpc>><</listbox>> |
<<link Set>><<presets _namedNpcPreset>><</link>>

Beasts Preset: <<listbox "_beastPreset" autoselect>><<optionsfrom _quickStartOptions.beasts>><</listbox>> |
<<link Set>><<presets _beastPreset>><</link>>

Beasts as monsters Preset: <<listbox "_monstersPreset" autoselect>><<optionsfrom _quickStartOptions.monsters>><</listbox>> |
<<link Set>><<presets _monstersPreset>><</link>>

Kinks Preset: <<listbox "_kinkPreset" autoselect>><<optionsfrom _quickStartOptions.kink>><</listbox>> |
<<link Set>><<presets _kinkPreset>><</link>>

<<if $passage is "Start">>
	Difficulty Preset: <<listbox "_gamePreset" autoselect>><<optionsfrom _quickStartOptions.game>><</listbox>> |
	<<link Set>><<presets _gamePreset>><</link>>

<</if>>
<<if StartConfig.enableImages is true>>
	Images Preset: <<listbox "_imagesPreset" autoselect>><<optionsfrom _quickStartOptions.images>><</listbox>> |
	<<link Set>><<presets _imagesPreset>><</link>>

<</if>>
Settings Preset: <<listbox "_settingsPreset" autoselect>><<optionsfrom _quickStartOptions.settings>><</listbox>> |
<<link Set>><<presets _settingsPreset>><</link>>

<</widget>>

<<widget "characterSettings">>

	<<if StartConfig.enableImages is true>>
		View a preview of the character in the side bar Hide Clothes <<checkbox "_showClothes" true false autocheck>> Hide Underwear <<checkbox "_showUnderwear" true false autocheck>>
	<mouse class="tooltip linkBlue">(?)'Visual representation of the player character's skin colour' needs to be enabled in the general tab for skin colouring to show during normal gameplay.</mouse>

	<</if>>

	<<if $dev is 1>>
		Difficulty

		Harder <------------------------------> Easier

		<<numberslider "$devlevel" $devlevel 6 16 1>>

	<<else>>
		Body size <mouse class="tooltip linkBlue">(?)A smaller body makes you inflict less damage during encounters, making defiance harder.</mouse>

		Tiny <<radiobutton "$bodysize" 0 autocheck>> |
		Small <<radiobutton "$bodysize" 1 autocheck>> |
		Normal <<radiobutton "$bodysize" 2 autocheck>> |
		Large <<radiobutton "$bodysize" 3 autocheck>>

	<</if>>

	Gender

	Male <<radiobutton "$player.gender" "m" autocheck>> |
	Female <<radiobutton "$player.gender" "f" autocheck>> |
	Hermaphrodite <<radiobutton "$player.gender" "h" autocheck>>

	<<run settingsPCGenderUpdate()>>

	Natural features

	Masculine <<radiobutton "$player.gender_body" "m" autocheck>> |
	Feminine <<radiobutton "$player.gender_body" "f" autocheck>> |
	Androgynous <<radiobutton "$player.gender_body" "a" autocheck>> |

	<<if $dev is 1>>
		Sex

		Penis <<radiobutton "$player.sex" "m" autocheck>> |
		Vagina <<radiobutton "$player.sex" "f" autocheck>>

	<</if>>

	Penis size - if applicable

	Tiny <<radiobutton "$penissize" 0 autocheck>> |
	Small <<radiobutton "$penissize" 1 autocheck>> |
	Normal <<radiobutton "$penissize" 2 autocheck>>

	Breast size

	Flat <<radiobutton "$breastsize" 0 autocheck>> |
	Budding <<radiobutton "$breastsize" 1 autocheck>> |
	Tiny <<radiobutton "$breastsize" 2 autocheck>> |
	Small <<radiobutton "$breastsize" 3 autocheck>> |
	Pert <<radiobutton "$breastsize" 4 autocheck>>

	Ass size

	Slender <<radiobutton "$bottomsize" 0 autocheck>> |
	Slim <<radiobutton "$bottomsize" 1 autocheck>> |
	Modest <<radiobutton "$bottomsize" 2 autocheck>> |
	Cushioned <<radiobutton "$bottomsize" 3 autocheck>>

	Testes - applicable only if hermaphrodite

	Yes <<radiobutton "$player.ballsExist" true autocheck>> |
	No <<radiobutton "$player.ballsExist" false autocheck>> |

	Chest sensitivity

	Normal <<radiobutton "$breastsensitivity" 1 autocheck>> |
	Sensitive <<radiobutton "$breastsensitivity" 3 autocheck>> |
	Very sensitive <<radiobutton "$breastsensitivity" 5 autocheck>>

	Genital sensitivity

	Normal <<radiobutton "$genitalsensitivity" 1 autocheck>> |
	Sensitive <<radiobutton "$genitalsensitivity" 3 autocheck>> |
	Very sensitive <<radiobutton "$genitalsensitivity" 5 autocheck>>

	Eye Colour

	Purple <<radiobutton "$eyeselect" "purple" autocheck>> |
	Dark Blue <<radiobutton "$eyeselect" "dark blue" autocheck>> |
	Light Blue <<radiobutton "$eyeselect" "light blue" autocheck>> |
	Amber <<radiobutton "$eyeselect" "amber" autocheck>> |
	Hazel <<radiobutton "$eyeselect" "hazel" autocheck>> |
	Green <<radiobutton "$eyeselect" "green" autocheck>> |
	Red <<radiobutton "$eyeselect" "red" autocheck>> |
	Pink <<radiobutton "$eyeselect" "pink" autocheck>> |
	Grey <<radiobutton "$eyeselect" "grey" autocheck>> |
	Random <<radiobutton "$eyeselect" "random" autocheck>>

	Hair Colour

	Red <<radiobutton "$hairselect" "red" autocheck>> |
	Jet Black <<radiobutton "$hairselect" "jetblack" autocheck>> |
	Black <<radiobutton "$hairselect" "black" autocheck>> |
	Brown <<radiobutton "$hairselect" "brown" autocheck>> |
	Soft Brown <<radiobutton "$hairselect" "softbrown" autocheck>> |
	Light brown <<radiobutton "$hairselect" "lightbrown" autocheck>> |
	Burnt Orange <<radiobutton "$hairselect" "burntorange" autocheck>> |
	Blond <<radiobutton "$hairselect" "blond" autocheck>> |
	Soft Blond <<radiobutton "$hairselect" "softblond" autocheck>> |
	Platinum blond <<radiobutton "$hairselect" "platinumblond" autocheck>> |
	Ashy blond <<radiobutton "$hairselect" "ashyblond" autocheck>> |
	Strawberry blond <<radiobutton "$hairselect" "strawberryblond" autocheck>> |
	Ginger <<radiobutton "$hairselect" "ginger" autocheck>> |
	Random <<radiobutton "$hairselect" "random" autocheck>>

	Hair length

	Ear <<radiobutton "$hairlength" 0 autocheck>> |
	Neck <<radiobutton "$hairlength" 200 autocheck>> |
	Chest <<radiobutton "$hairlength" 400 autocheck>>

	Freckles

	Yes <<radiobutton "$player.freckles" true autocheck>> |
	No <<radiobutton "$player.freckles" false autocheck>> |
	Random <<radiobutton "$player.freckles" "random" autocheck>> |

	Skin Colour <mouse class="tooltip linkBlue">(?)Visual representation of the PC's skin colour and tanning changes must be enabled through the General tab of this Settings menu before they will function. They are disabled by default due to performance issues on some devices.</mouse>

	Reddish:
	Light <<radiobutton "$skinColor.natural" "light" autocheck>> |
	Medium <<radiobutton "$skinColor.natural" "medium" autocheck>> |
	Dark <<radiobutton "$skinColor.natural" "dark" autocheck>> |
	Gyaru <<radiobutton "$skinColor.natural" "gyaru" autocheck>> (Pale with no tan, very dark with full tan)

	Yellowish:
	Light <<radiobutton "$skinColor.natural" "ylight" autocheck>> |
	Medium <<radiobutton "$skinColor.natural" "ymedium" autocheck>> |
	Dark <<radiobutton "$skinColor.natural" "ydark" autocheck>> |
	Gyaru <<radiobutton "$skinColor.natural" "ygyaru" autocheck>>

	Initial Tan Value: <<numberslider "$skinColor.range" $skinColor.range 0 100 1>>

	<<if StartConfig.enableImages is true>>
		<<link "Test Colour">>
			<<replace #test>>
				<<if $skinColor.tanImgEnabled is "f">>
					<<set $skinColor.tanImgEnabled to "t">>
					<<set _skincolortemp to true>>
				<</if>>
				<<print '

'>>
				<<if _skincolortemp is true>>
					<<set $skinColor.tanImgEnabled to "f">>
				<</if>>
			<</replace>>
		<</link>> (approximate)

/*<<print '

'>>*/

	<</if>>

	Awareness <mouse class="tooltip linkBlue">(?)Whether your character knows a thing or two about sex despite their lack of experience.</mouse>

	Innocent <<radiobutton "$awareselect" "innocent" autocheck>> |
	Knowledgeable <<radiobutton "$awareselect" "knowledgeable" autocheck>>

	Background

	Waif <<radiobutton "$background" "waif" autocheck>> - No special advantages or disadvantages. Recommended for beginners.

	Nerd <<radiobutton "$background" "nerd" autocheck>> - Good at school. Picked on. (This will prevent Unsocial Moth feat from being earned)

	Athlete <<radiobutton "$background" "athlete" autocheck>> - Physically capable. Grades have suffered.

	Delinquent <<radiobutton "$background" "delinquent" autocheck>> - Your antics have made you popular with other students. Less so with the teachers.

	Promiscuous <<radiobutton "$background" "promiscuous" autocheck>> - You've experimented sexually.

	Exhibitionist <<radiobutton "$background" "exhibitionist" autocheck>> - You have an affinity for exposing yourself in public places.

	Deviant <<radiobutton "$background" "deviant" autocheck>> - You really like animals.

	Beautiful <<radiobutton "$background" "beautiful" autocheck>> - You turn heads. Not recommended for beginners.

	Crossdresser <<radiobutton "$background" "crossdresser" autocheck>> - You've taken a liking to the clothing of the opposite sex. Does nothing for hermaphrodites.

	Lustful <<radiobutton "$background" "lustful" autocheck>> - Arousal increases over time, and needs to be managed.
	/*

	Green Thumb <<radiobutton "$background" "greenthumb" autocheck>> - More bountiful crops and no decay when using fertiliser. Start with ne unit of fertiliser.*/

	<mouse class="tooltip lewd">Dendrophile <<radiobutton "$background" "plantlover" autocheck>> - Plants are everything to you.You're addicted to nectar. You're more vulnerable to aphrodisiacs and alcohol. Plantpeople and plant-based tentacles no longer require hallucinations to encounter. You get a bonus to Tending, as your Trauma increases.</mouse>

<</widget>>

<<widget "featSettings">>

	<<if $feats.allSaves.points is undefined or $feats.allSaves.points is 0>>
		You have 0 VrelCoins to use on boosts at the moment. If this is incorrect, please load your last save and restart.
	<<else>>
		<<link "Reset All Feats">>
			<<set $feats to {
				"locked":false,
				"soft":false,
				"allSaves":{},
				"currentSave":{},
				"filter":"All"
			}>>
			<>
			<<setupFeats true>>
			<<displaySettings "featSettings">>
		<</link>> This will remove all feats that have been earned so far, meaning you will have to collect them again.
		Loading your last save with these feats will revert this.

		<<set _upgradeNames to Object.keys($featsBoosts.upgrades)>>
		<<set _visibleUpgradeNames to []>>
		<<set _visibleUpgradeIDs to []>>
		<<for _i to 0; _i lt _upgradeNames.length; _i++>>
			<<if $featsBoosts.upgradeDetails[_upgradeNames[_i]].count gte $featsBoosts.upgradeDetails[_upgradeNames[_i]].minCount>>
				<<set _visibleUpgradeNames.push($featsBoosts.name[_upgradeNames[_i]])>>
				<<set _visibleUpgradeIDs.push(clone(_i))>>
			<<else>>
				<<set _visibleUpgradeNames.push("?????")>>
				<<set _visibleUpgradeIDs.push(clone(_i))>>
			<</if>>
		<</for>>

			<<featsPointsMenu>>

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

<<widget "gameSettings">>
	Game Mode

	<mouse class="tooltip green">Normal modeSurvive in a dangerous world.</mouse>
	<<radiobutton "$gamemode" "normal" autocheck>>

	<mouse class = "tooltip blue">Soft modeFor those who prefer a light-hearted lewd adventure, though the game is still dark in places.This is an experimental feature, and contains gamebreaking bugs. It will be changed or removed in the future. Leaving the settings with soft mode will prevent you from earning feats until it is set to normal mode. Doing this will permanently prevent some feats from being earned.</mouse>
	<<radiobutton "$gamemode" "soft" autocheck>>

	<<if $intro is 1 or $gamemode is "hard">>
		<mouse class = "tooltip purple">Hard modeRemoves lewd stat decay (promiscuity, exhibitionism, deviancy) making trauma and control increasingly difficult to manage. Can only be chosen at the game's start, and being incarcerated in the asylum will put you in normal mode.This is an experimental feature, and will be changed or removed in the future.</mouse>
		<<radiobutton "$gamemode" "hard" autocheck>>

	<</if>>

	The rate that events are triggered by allure - Default is 1.0.

	Setting this below 1 will permanently prevent you from earning some feats, and prevent you from earning others until it is increased to at least 1.

	<<numberslider "$alluremod" $alluremod 0.2 2 0.1>>

	Multiple Wardrobes <mouse class="tooltip linkBlue">(?)This is an experimental feature, and will be changed or removed in the future. While you may change this during gameplay, it's not recommended as disabling will remove access to clothing and enabling it may leave you stuck with your only option wearing a towel.</mouse>

	<<radiobutton "$multipleWardrobes" false autocheck>> Single shared wardrobe only

	<<radiobutton "$multipleWardrobes" "isolated" autocheck>> Isolated areas will have their own wardrobe

	<<if $debug is 1>>

		<<radiobutton "$multipleWardrobes" "all" autocheck>> Enable for all wardrobes

	<</if>>

	<<button "Human NPC Settings">>
		<<displaySubsection "humanSettings">>
	<</button>>
	<<button "Beast Settings and Toggles">>
		<<displaySubsection "beastSettings">>
	<</button>>
	<<button "Price Settings">>
		<<displaySubsection "priceSettings">>
	<</button>>
	/*ToDo: Pregnancy, remove check to properly enable*/
	<<if $pregnancyTesting>>
		<<button "Pregnancy Settings">>
			<<displaySubsection "pregnancySettings">>
		<</button>>
	<</if>>

	<<widget "humanSettings">>

			Percentage of people attracted to you that are male

			<<numberslider "$malechance" $malechance 0 100 1>>

			Percentage of women that have penises

			<<numberslider "$dgchance" $dgchance 0 100 1>>

			Percentage of women that have strap-on penises

			<<numberslider "$straponchance" $straponchance 0 100 1>>

			Percentage of men that have vaginas

			<<numberslider "$cbchance" $cbchance 0 100 1>>

			Percentage of other victims that are male

			<<numberslider "$malevictimchance" $malevictimchance 0 100 1>>

			Proportion of same-sex couples

			<<numberslider "$homochance" $homochance 0 100 1>>

			Average size of women's breasts <mouse class="tooltip linkBlue">(?)A bigger number means bigger breasts in the world. At 12 everyone will have enormous breasts. At -12 everyone will have flat chests. Defaults to 0, which will result in a broad range of sizes.</mouse>

			<<numberslider "$breast_mod" $breast_mod -12 12 1>>

			Average size of NPC penises <mouse class="tooltip linkBlue">(?)A bigger number means bigger penises in the world. At 8 everyone will have enormous penises. At -8 everyone will have tiny penises. Defaults to 0, which will result in a broad range of sizes.</mouse>

			<<numberslider "$penis_mod" $penis_mod -8 8 1>>

			Likelihood that people have pale skin

			<<numberslider "$whitechance" $whitechance 0 100 1>>

			Likelihood that people have dark skin

			<<numberslider "$blackchance" $blackchance 0 100 1>>

			<<if $pregnancyTesting>>
				/*ToDo: Pregnancy, remove check to properly enable*/
				Likelihood of NPCs having condoms on them

				<<numberslider "$condomchance" $condomchance 0 100 1>>

				Likelihood of NPCs using a condom without being asked

				<<numberslider "$condomautochance" $condomautochance 0 100 1>>

			<</if>>

	<</widget>>

	<<widget "beastSettings">>

			Percentage of beasts or monsters attracted to you that are male

			<<numberslider "$beastmalechance" $beastmalechance 0 100 1>>

			Percentage of beasts that are replaced with monster girls or boys

			<<numberslider "$monsterchance" $monsterchance 0 100 1>>

			Replace beasts with monster boys and girls

			Only when hallucinating <<radiobutton "$monsterhallucinations" "t" autocheck>> |
			At any time <<radiobutton "$monsterhallucinations" "f" autocheck>>

			Disabling bestiality will still allow lewd events with monster girls and boys.

			Beast Toggles

			<<run beastTogglesCheck()>>
			<<button `(_anyBeastOn ? "Disable" : "Enable") + " all beast toggles"`>>
				<>
				<<displaySubsection "beastSettings">>
			<</button>>

			<<checkbox "$bestialitydisable" "t" "f" autocheck>> Enable bestiality

			<<checkbox "$swarmdisable" "t" "f" autocheck>> Enable swarms (Eels, etc)

			<<checkbox "$parasitedisable" "t" "f" autocheck>> Enable parasites

			/*ToDo: Pregnancy, remove duplicate option once enabled*/

			<<checkbox "$analpregdisable" "t" "f" autocheck>> Enable anal parasitic pregnancy

			<<checkbox "$tentacledisable" "t" "f" autocheck>> Enable tentacles

			<<checkbox "$slimedisable" "t" "f" autocheck>> Enable slimes

			<<checkbox "$voredisable" "t" "f" autocheck>> Enable soft monster vore

			<<checkbox "$spiderdisable" "t" "f" autocheck>> Enable spiders

			<<checkbox "$slugdisable" "t" "f" autocheck>> Enable slugs

			<<checkbox "$waspdisable" "t" "f" autocheck>> Enable wasps

			<<checkbox "$beedisable" "t" "f" autocheck>> Enable bees

			<<checkbox "$lurkerdisable" "t" "f" autocheck>> Enable lurkers

			<<checkbox "$horsedisable" "t" "f" autocheck>> Enable horses and centaurs

			<<checkbox "$plantdisable" "t" "f" autocheck>> Enable plantpeople

/*Keep at end of toggles*/

	<</widget>>

	<<widget "priceSettings">>

			Clothing Price

Modify cost of clothing items. This includes the cost for buying, the automatic re-buy and repairing. Towels are still free.

					All Clothes

For hard mode 200% is recommended.

					<<numberslider "$clothesPrice" $clothesPrice 1 10 0.5>>

					Underwear
					<<numberslider "$clothesPriceUnderwear" $clothesPriceUnderwear 1 2 0.1>>

					School Clothes
					<<numberslider "$clothesPriceSchool" $clothesPriceSchool 1 2 0.1>>

					Lewd Clothes
					<<numberslider "$clothesPriceLewd" $clothesPriceLewd 0.1 2 0.1>>

				Bailey's Rent

Modifies the amount of money Bailey demands weekly. 100% is default.

				Setting this below 100% will prevent feats being earned in that save.
				<<numberslider "$rentmod" $rentmod 0.1 3 0.1>>

			<<run $(() => { $('.clothes-price-container input').on('input change', e => {
					let valSpan = $(e.currentTarget).siblings().first();
					let value = valSpan.text();

					valSpan.text((i, value) => Math.round(value * 100) + '%');

					if (value > 1)
						valSpan.css('color', 'gold');
					else if (value < 1)
						valSpan.css('color', 'green');
					else
						valSpan.css('color', 'unset');
				}).trigger('change') })>>

			<<run $(() => {
				let newmin = parseFloat((Math.ceil(10 / $('#numberslider-input-clothesprice').val()) * 0.1).toFixed(1));
				let oldval = V.clothesPriceLewd;
				$('#numberslider-input-clothespricelewd').attr('min', newmin).val(oldval).trigger('change');
			})>>

			<<run $(() => {
				$('#numberslider-input-clothesprice').on('input change', e => {
					let newmin = parseFloat((Math.ceil(10 / $(e.currentTarget).val()) * 0.1).toFixed(1));
					let oldval = V.clothesPriceLewd;
					$('#numberslider-input-clothespricelewd').attr('min', newmin).val(oldval).trigger('change');
				})
			})>>

	<</widget>>

	<<widget "pregnancySettings">><<nobr>>

				Base Vaginal Pregnancy Chance

Chance of conceiving when only being inseminated once at the right time, <<print 100 - $baseVaginalPregnancyChance>> times to guarantee. Some events may leave you with more than one helping of cum.

				<<numberslider "$baseVaginalPregnancyChance" $baseVaginalPregnancyChance 0 96 4>>

			<<run $(() => { $('.basevaginalpregnancychance-container input').on('input change', e => {
				let valSpan = $(e.currentTarget).siblings().first();
				let value = valSpan.text();

				valSpan.text((i, value) => "1 in " + (100 - value));
				$('#maxRequired').text(100 - $baseVaginalPregnancyChance);
			}).trigger('change') })>>

				Base NPC Pregnancy Chance

Chance of an npc conceiving when only being inseminated once at the right time, <<print 20 - $baseNpcPregnancyChance>> times to guarantee.

				<<numberslider "$baseNpcPregnancyChance" $baseNpcPregnancyChance 0 16 4>>

			<<run $(() => { $('.basenpcpregnancychance-container input').on('input change', e => {
				let valSpan = $(e.currentTarget).siblings().first();
				let value = valSpan.text();

				valSpan.text((i, value) => "1 in " + (20 - value));
				$('#npcMaxRequired').text(20 - $baseNpcPregnancyChance);
			}).trigger('change') })>>

				Human Pregnancy Length in Months
				<<numberslider "$humanPregnancyMonths" $humanPregnancyMonths 1 9 1>>

				Wolf Pregnancy Length in Weeks
				<<numberslider "$wolfPregnancyWeeks" $wolfPregnancyWeeks 2 12 1>>

Will not stop existing pregnancy.

				<<checkbox "$playerPregnancyHumanDisable" "t" "f" autocheck>>
				Enable Player Human Pregnancy

				<<checkbox "$playerPregnancyBeastDisable" "t" "f" autocheck>> Enable Player Beast Pregnancy

				<<checkbox "$npcPregnancyDisable" "t" "f" autocheck>> Enable NPC Pregnancy

			<<checkbox "$analpregdisable" "t" "f" autocheck>> Enable anal parasitic pregnancy

/*Keep at end of toggles*/

	<</nobr>><</widget>>

	Togglable Features

	<<checkbox "$analdisable" "t" "f" autocheck>> Enable anal

	<<run settingsDoubleAnalToggleGreyOut()>>

	Analingus:

		<<checkbox "$analingusdisablegiving" "t" "f" autocheck>> Giving

		<<checkbox "$analingusdisablereceiving" "t" "f" autocheck>> Receiving

	Double penetration:

		<<checkbox "$vaginaldoubledisable" "t" "f" autocheck>> Vaginal

		<<checkbox "$analdoubledisable" "t" "f" autocheck>> Anal

	<mouse class="tooltip linkBlue">(?)Note that double anal requires anal to be enabled.

"Double penetration" here means two phalluses in the same orifice of the player.</mouse>

	<<checkbox "$pbdisable" "t" "f" autocheck>> Enable pubic hair growth

	Transformations:
	<<checkbox "$transformdisable" "t" "f" autocheck>> Animal
	<<checkbox "$transformdisabledivine" "t" "f" autocheck>> Divine
	<mouse class="tooltip linkBlue">(?)You may have both one divine and one animal transformation at the same time.</mouse>

	/*

	<<checkbox "$hirsutedisable" "t" "f" autocheck>> Extra hirsute/hairy wolf transformation

*/

	<<checkbox "$breastfeedingdisable" "t" "f" autocheck>> Enable lactation

	<<checkbox "$watersportsdisable" "t" "f" autocheck>> Enable watersports
	<mouse class="tooltip linkBlue">(?)This toggle is largely unused, only affecting a single very rare event as of right now.</mouse>

	<<checkbox "$footdisable" "t" "f" autocheck>> Enable feet
	<mouse class="tooltip linkBlue">(?)Does not remove the player's feet.</mouse>

	 Asphyxiation
	<<numberslider "$asphyxiaLvl" $asphyxiaLvl 0 4 1>>
	<<run settingsAsphyxiation()>>

	 Bodywriting
	<<numberslider "$bodywritingLvl" $bodywritingLvl 0 3 1>>
	<<run settingsBodywriting()>>

	 Nude Gender Appearance
	<<numberslider "$NudeGenderDC" $NudeGenderDC 0 2 1>>
	<<run settingsNudeGenderAppearance()>>

/*Keep at end of toggles*/

<</widget>>

<<widget "sizeLimitsSettings">>
	Maximum player character breast size <mouse class="tooltip linkBlue">(?)Breasts already above this size won't automatically shrink. Your breasts will grow regardless of gender. Males and those with high purity experience slower growth. Surgery, pills and parasites can influence growth in both directions. Having breasts played with and hosting internal parasites increase growth.</mouse>

	<<set _name to ["Flat", "Budding", "Tiny", "Small", "Pert", "Modest", "Full", "Large", "Ample", "Massive", "Huge", "Gigantic", "Enormous"]>>
	<<for _i to 0; _i lt _name.length; _i++>>
		<<print _name[_i]>> <<radiobutton "$breastsizemax" `_i` autocheck>> |
	<</for>>

	Minimum player character breast size <mouse class="tooltip linkBlue">(?)Breasts already below this size won't automatically grow.</mouse>

	<<for _i to 0; _i lt 5; _i++>>
		<<print _name[_i]>> <<radiobutton "$breastsizemin" _i autocheck>> |
	<</for>>

	Maximum player character ass size <mouse class="tooltip linkBlue">(?)Bottoms already above this size won't automatically shrink.</mouse>

	<<set _name to ["Slender", "Slim", "Modest", "Cushioned", "Soft", "Round", "Plump", "Large", "Huge"]>>
	<<for _i to 0; _i lt _name.length; _i++>>
		<<print _name[_i]>> <<radiobutton "$bottomsizemax" _i autocheck>> |
	<</for>>

	Maximum player character penis size <mouse class="tooltip linkBlue">(?)Penises already above this size won't automatically shrink. Surgery, pills and parasites can influence growth in both directions.</mouse>

	<<set _name to ["Micro","Mini", "Tiny", "Small", "Normal", "Large", "Enormous"]>>
	<<for _i to 0; _i lt _name.length; _i++>>
		<<print _name[_i]>> <<radiobutton "$penissizemax" `(_i - 2)` autocheck>> |
	<</for>>

	Minimum player character penis size <mouse class="tooltip linkBlue">(?)Penises already below this size won't automatically grow. The smaller sizes have additional requirements to shrink to/grow from.</mouse>

	<<set _name to ["Micro","Mini", "Tiny"]>>
	<<for _i to 0; _i lt _name.length; _i++>>
		<<print _name[_i]>> <<radiobutton "$penissizemin" `(_i - 2)` autocheck>> |
	<</for>>

<</widget>>

<<widget "generalSettings">>
	Images
	<<if StartConfig.enableImages is true>>

		<<checkbox "$images" 0 1 autocheck>> Enable images

Images may not load properly on older Androids.

		CSS animations

<<checkbox "$sidebarAnimations" false true autocheck>> Sidebar animations

<<checkbox "$combatAnimations" false true autocheck>> Combat animations

Disabling may help improve performance and prevent images from loading incorrectly. Gif images will not be affected. Try disabling sidebar images first.

		<<checkbox "$bodywritingImages" false true autocheck>> Enable body-writing Images

Disabling may improve performance and potentially prevent images from not loading correctly.

		<<checkbox "$silhouettedisable" "t" "f" autocheck>> Enable NPC silhouettes

		<<if $skinColor.init is false and $passage isnot "Start">>
			You can now choose your character's skin colour. Click "Test" to preview the setting on the paperdolls. Click "Confirm" when you've made your selection. This can cause performance issues on some devices. Should this be an issue, the option to disable the new skin system will appear here.

			Skin colour:

			Reddish:
			Light <<radiobutton "$naturalSkinColor" "light" autocheck>> |
			Medium <<radiobutton "$naturalSkinColor" "medium" autocheck>> |
			Dark <<radiobutton "$naturalSkinColor" "dark" autocheck>> |
			Gyaru <<radiobutton "$naturalSkinColor" "gyaru" autocheck>> (Pale with no tan, very dark with full tan)

			Yellowish:
			Light <<radiobutton "$naturalSkinColor" "ylight" autocheck>> |
			Medium <<radiobutton "$naturalSkinColor" "ymedium" autocheck>> |
			Dark <<radiobutton "$naturalSkinColor" "ydark" autocheck>>
			Gyaru <<radiobutton "$naturalSkinColor" "ygyaru" autocheck>>

			<<if $range is undefined>>
				<<set $range to 0>>
			<</if>>
			Initial Tan: <<numberslider "$range" 0 0 100 1>>

			<<link Test>>
				<<if $range isnot undefined and $naturalSkinColor isnot undefined>>
					<<replace #skinColorDiv>><<SkinColorImgTest $range $naturalSkinColor>><</replace>>
				<</if>>
			<</link>>

			<<link [[Confirm|$passage]]>>
				<<if $range isnot undefined and $naturalSkinColor isnot undefined>>
					<<set $skinColor.range to $range>>
					<<set $skinColor.natural to $naturalSkinColor>>
					<<set $skinColor.tanningEnabled to true>>
					<<set $skinColor.tanImgEnabled to "t">>
					<<setSkinColorBase>>
					<<unset $naturalSkinColor>>
					<<unset $range>>
				<</if>>
			<</link>> - These settings can not be changed after Confirming.
		<<else>>

			<<checkbox "$skinColor.tanImgEnabled" "f" "t" autocheck>> Visual representation of the player character's skin colour

May hinder performance on some devices.

			<<checkbox "$skinColor.tanningEnabled" false true autocheck>> Tanning changes due to sun exposure

Option to disable may be removed at a later date.

		<</if>>

		<<checkbox "$blinkingdisable" "t" "f" autocheck>> Animate eyes blinking

Works only if CSS animations are enabled.

		<<if $eyelidTEST is true>>

		<<checkbox "$halfcloseddisable" "t" "f" autocheck>> Enable half-closed eyes graphics

Draw eyelids in sidebar as half-closed when highly aroused.

		<</if>>
		<<if $debug is 1>>

			Face style

<<textbox "$facestyle" $facestyle>>

This setting works only if you have installed face styles other than default.

			<>

		<</if>>
	<<else>>

		Not Available
	<</if>>

	Numbered link navigation

	<<if StartConfig.enableLinkNumberify is true>>

		<<checkbox "$numberify_enabled" 0 1 autocheck>> Enable numbered link navigation

Allows navigation with keyboard.

	<<else>>

		Not Available
	<</if>>

	Time format

	24-hour <<radiobutton "$timestyle" "military" autocheck>> |
	12-hour <<radiobutton "$timestyle" "ampm" autocheck>>

	<<checkbox "$oldclock" false true autocheck>> Use old clock style in the sidebar

	Skill check display

	Show exact percentage <<radiobutton "$checkstyle" "percentage" autocheck>> |
	Show only general description <<radiobutton "$checkstyle" "words" autocheck>> |
	Show only skill name <<radiobutton "$checkstyle" "skillname" autocheck>> |

	In game hints and tips

	<<checkbox "$tipdisable" "t" "f" autocheck>> Enable hints and tips

Shows in the sidebar.

<<link [["View all tips"|Tips]]>><<set $lastPassage to $passage>><</link>>

	Additional error information

	<<checkbox "$debugdisable" "t" "f" autocheck>> Enable additional error messages

Shows in the sidebar.

	Save Name

	<<textbox "$saveName" $saveName>>

Shows in the save menu in place of the save id.

Only 10 characters at most will show in the save menu, leave empty to show the save ID.

	Game Zoom <mouse class="tooltip linkBlue">(?)Will allow you to adjust the size of game elements and text. 100 is the default value.
	A value of 50 will zoom the page out to half of its original size, while a value of 200 will zoom the page in to double its size.
	The test button will not save the zoom value into the current save.

		Please be careful with this setting! Only save if you are happy with the changes made, as reloading the game will reset it to the last value used in that save.
		Depending on the device and browser, the setting may break entirely, and may cause unexpected effects. Please report these issues as necessary.
	</mouse>

	<<numberslider "$zoom" $zoom 50 200 1>>
	<input type="button" value="Set Zoom Test" onclick="zoom()"/>

	<input type="button" value="Reset Zoom" onclick="zoom(100, true)"/>
	<input type="button" value="Set Zoom" onclick="zoom(undefined, true)"/>

	History depth

Enables going back in history up to N-1 passages. Changes take effect on settings exit.

	WARNING: Will cause slowdowns. Additionally, values above 5 can exceed your localStorage quota and cause

	troubles with saves. Use at your own risk.

	<<numberslider "$maxStates" $maxStates 1 20 1>>

	Cheats menu

	<<checkbox "$cheatdisabletoggle" "t" "f" autocheck>> Enable cheats

Button shows in sidebar. Leaving the settings with cheats enabled will prevent you from earning feats in a save.

	Gallery - these will not affect your save in any way.

	<<if version.major gt 2 or version.minor gt 29>>
		<<link [["Character Viewer"|Clothes Testing]]>>
			<<set $lastPassage to $passage>>
			<<set $gameTanImgSetting to clone($skinColor.tanImgEnabled)>>
		<</link>>
		- This will allow you to have a play with the character sprites.

	<</if>>
	<<if $passage isnot "Start">>
		<<link [["Scene Viewer"|Scene Viewer]]>>
			<<set $lastPassage to $passage>>
			<<seenPassageChecks>>
		<</link>>
		- This will allow you to replay scenes that you have unlocked.

	<<else>>
		The Scene Viewer is not available on the start page.

	<</if>>
	<<link [["Test Renderer"|Renderer Test Page]]>>
		<<set $lastPassage to $passage>>
	<</link>>
	- This will check your browser's capabilities required for new renderer.

<</widget>>

<<widget "npcSettings">>
<<if $passage is "Start">>
	Untouched options will be automatically generated for you.

<</if>>
<<link "Generate all genders based on game settings">>
	<<initnpcgender "genders">>
	<<updatePersistentNPCs "genders">>
	<<displaySettings>>
<</link>>

<<link "Generate all penis sizes based on game settings">>
	<<initnpcgender "penis">>
	<<updatePersistentNPCs "penis">>
	<<displaySettings>>
<</link>>

<<link "Generate all breast sizes based on game settings">>
	<<initnpcgender "breasts">>
	<<updatePersistentNPCs "breasts">>
	<<displaySettings>>
<</link>>
<<if $debug is 1>>

	<<link "Reset hair and eye colours (Will only effect NPC's with a default colour)">>
		<<generateNPCNameHairAndEyeColors "default">>
		<<displaySettings>>
	<</link>>
<</if>>

<<if _npcId is undefined>>
	<<set _npcId to 0>>

	<<set _breastDescription to ["Flat","Small","Pert","Modest","Full","Large"]>>
	<<set _breastDescriptionNPC to ["nipple","small breast","pert breast","modest breast","full breast","large breast"]>>
	<<set _breastsDescriptionNPC to ["nipples","small breast","pert breast","modest breast","full breast","large breast"]>>

	<<set _hairColorNPC to ["Red","Black","Brown","Light Brown","Blond","Platinum blond","Strawberry blond","Ginger", "mousy"]>>
	<<set _hairColorNPCData to ["red","black","brown","lightbrown","blond","platinumblond","strawberryblond","ginger", "mousy"]>>
	<<set _hairColorNPCText to ["red","black","brown","lightbrown","gold","platinum","strawberry","tangerine", "mousy"]>>

	<<set _eyeColorNPC to ["Purple","Dark Blue","Light Blue","Amber","Hazel","Green","Red","Pink","Grey"]>>
	<<set _eyeColorNPCData to ["purple","dark blue","light blue","amber","hazel","green","red","pink","grey"]>>
	<<set _eyeColorNPCText to ["purple","blue","lblue","tangerine","brown","green","red","pink","grey"]>>
<</if>>

<<if _npcList is undefined>>
	<<set _npcList to {}>>
	<<for $_i to 0; $_i lt $NPCNameList.length; $_i++>>
		<<set _npcList[clone($NPCNameList[$_i])] to clone($_i)>>
	<</for>>
<</if>>

	<<npcSettingsMenu>>

<<if $passage isnot "start" and $per_npc and Object.keys($per_npc).length gt 0>>
	<<run
		if (!T.perNPCLock) {
			$("#passages").on('change', '#perNPCSettingsMenu .macro-listbox', function (e) {
				new Wikifier(null, '<<replace #perNPCSettingsMenu>><<perNPCSettingsMenu>><</replace>>');
			});

			T.keys = {};
			T.keyNames = [];
			T.allowed_npcs = ["steed", "guard", "inmate", "panty_thief", "tower_creature", "wraith", "pinch"];
			Object.keys(V.per_npc).forEach(k => {
				for (let j of T.allowed_npcs){
					if (k.includes(j)){
						T.keyNames.push(k);
						T.keys[k.toUpperFirst().replaceAll('_', ' ')] = k;
						break
					}
				}
			});
			T.perNPCLock = true;
		}
	>>
	<<if T.keyNames and T.keyNames.length>>

			<<perNPCSettingsMenu>>

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

<<if _listActive isnot true>>
	<<NPCSettingsReset>>
	<<set _listActive to true>>
<</if>>

<</widget>>

<<widget "exportsettings">>

	Will also import/export settings found in the "SAVE/OPTIONS" overlay.

Settings File Import/Export

	<<if SugarCube.Browser.isMobile.any() is true>>
		Note that saving and loading from file does not work on Android currently.
	<<else>>
		Load from file: <input id="saveImport" type="file" value="Load from file" onchange="importSettings(this.files, 'file')">

		<input type="button" value="Save to file" onclick="exportSettings(null,'file')">
	<</if>>

Settings Text Import/Export

	To save your current settings, click on "Get Settings Data", then copy and paste the save data where required.

	To load your current settings, paste in the settings data then click "Load Settings Data".

	To transfer to and from Android, it is recommended to use email or a service such as pastebin. Please ensure that the start and the end of the save is exact to prevent issues.

	Click on "Copy Text Area" to copy the current contents for you. The button name will change to "Copying Error" if your device or browser does not support it.

	<textarea id="settingsDataInput" rows="4" cols="40" onClick="if(V.disableAutoSelect == false)this.select();" onfocus="V.tempDisable = true;" onblur="V.tempDisable = false;"></textarea>

	<input type="button" value="Clear Text Box" onclick="clearTextBox('settingsDataInput')"/>
	<input type="button" value="Top of Text Box" onclick="topTextArea('settingsDataInput')"/>
	<input type="button" value="Bottom of Text Box" onclick="bottomTextArea('settingsDataInput')"/>
	<input type="button" value="Get Settings Data" onclick="exportSettings(null,'text')"/>
	<input type="button" value="Load Settings Data" onclick="importSettings(null,'text')"/>
	<input id="CopyTextArea" type="button" value="Copy Text Area" onclick="copySavedata('settingsDataInput')">
	<input id="LoadExternalExportFile" type="button" value="Load External Export File" onclick="loadExternalExportFile()">

		<<checkbox "$disableAutoSelect" false true autocheck>>
		Disables auto select.

<</widget>>

<<widget "npcSettingsMenu">>
	<<listbox "_npcId" autoselect>>
		<<optionsfrom _npcList>>
	<</listbox>>
	| <<link Previous>>
		<<if _npcId is 0>>
			<<set _npcId to $NPCNameList.length - 1>>
		<<else>>
			<<set _npcId-->>
		<</if>>
		<<replace #npcSettingsMenu>><<npcSettingsMenu>><</replace>>
	<</link>> |
	<<link Next>>
		<<set _npcId++>>
		<<replace #npcSettingsMenu>><<npcSettingsMenu>><</replace>>
	<</link>>

	$NPCName[_npcId].nam the $NPCName[_npcId].title

	<<radiobutton "$NPCName[_npcId].pronoun" "f" autocheck>> Female |
	<<radiobutton "$NPCName[_npcId].pronoun" "m" autocheck>> Male

	<<if $NPCName[_npcId].pregnancy[0] is null>>
		<<radiobutton "$NPCName[_npcId].gender" "f" autocheck>> Vagina |
		<<radiobutton "$NPCName[_npcId].gender" "m" autocheck>> Penis
		<<run settingsNamedNpcGenderUpdate()>>
	<<else>>
		Unable to change the npc genitals due to their pregnancy.
	<</if>>

	Penis size - if applicable:

	<<set _penisNames to ["", "Tiny", "Average", "Thick", "Huge"]>> /* the empty first element is necessary because _j starts at 1 */
	<<for _j to 1; _j lt _penisNames.length; _j++>>

			<<radiobutton "$NPCName[_npcId].penissize" _j autocheck>>
			<<print _penisNames[_j]>>

		<<if _j isnot _penisNames.length -1>>|<</if>>
	<</for>>

	Breast size
	<<numberslider "$NPCName[_npcId].breastsize" $NPCName[_npcId].breastsize 0 12 1>>
	<<run settingsNamedNpcBreastSize(Util.slugify('$NPCName[_npcId].breastsize'), false)>>

/*Keep at end of toggles*/

	<<if $NPCName[_npcId].nam is "Black Wolf">>
		Beast Type:

		<<radiobutton "$blackwolfmonster" 0 autocheck>> Always a beast |
		<<radiobutton "$blackwolfmonster" 1 autocheck>> Monster girl or boy when requirements met |
		<<radiobutton "$blackwolfmonster" 2 autocheck>> Always a monster girl or boy

	<<elseif $NPCName[_npcId].nam is "Great Hawk">>
		Beast Type:

		<<radiobutton "$greathawkmonster" 0 autocheck>> Always a beast |
		<<radiobutton "$greathawkmonster" 1 autocheck>> Monster girl or boy when requirements met |
		<<radiobutton "$greathawkmonster" 2 autocheck>> Always a monster girl or boy

	<</if>>
	<<if $debug is 1>>
		Hair Colour:

		<<for _j to 0; _j lt _hairColorNPC.length; _j++>>

				<<print '<<radiobutton "$NPCName['+_npcId+'].hairColour" "'+_hairColorNPCData[_j]+'" ' + ($NPCName[_npcId].hairColour is _hairColorNPCData[_j] ? "checked" : "") + '>>'>>
				_hairColorNPC[_j]
			 |
		<</for>>

		Eye Colour:

		<<for _j to 0; _j lt _eyeColorNPC.length; _j++>>

				<<print '<<radiobutton "$NPCName['+_npcId+'].eyeColour" "'+_eyeColorNPCData[_j]+'" ' + ($NPCName[_npcId].eyeColour is _eyeColorNPCData[_j] ? "checked" : "") + '>>'>>
				_eyeColorNPC[_j]
			 |
		<</for>>

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

<<widget "perNPCSettingsMenu">>
	Persistent NPCs:

	<<listbox "_pNPCId" autoselect>>
		<<optionsfrom _keys>>
	<</listbox>>
	<<switch _pNPCId>>
		<<case "scarred_inmate">>
			<<if $per_npc[_pNPCId].description isnot "scarred">>
				<<generate_scarred_inmate 0>>
				<<clearsinglenpc 0>>
			<</if>>
		<<case "veteran_guard">>
			<<if $per_npc[_pNPCId].description isnot "veteran">>
				<<generate_veteran_guard 0>>
				<<clearsinglenpc 0>>
			<</if>>
	<</switch>>
	<<set _index to _keyNames.indexOf(_pNPCId)>>
	| <<link Previous>>
		<<set _index to (_index is 0 ? _keyNames.length - 1 : --_index)>>
		<<set _pNPCId to _keyNames[_index]>>
		<<replace #perNPCSettingsMenu>><<perNPCSettingsMenu>><</replace>>
	<</link>> |
	<<link Next>>
		<<set _index++>>
		<<set _pNPCId to _keyNames[_index]>>
		<<replace #perNPCSettingsMenu>><<perNPCSettingsMenu>><</replace>>
	<</link>>

	<<if $per_npc[_pNPCId].name_known>>
		$per_npc[_pNPCId].name the <<print _pNPCId.replaceAll('_', ' ')>>
	<<elseif $per_npc[_pNPCId].name is "Ivory Wraith">>
		The Ivory Wraith
	<<elseif _pNPCId is "tower_creature">>
		The Night Monster
	<<else>>
		<<print _pNPCId.toUpperFirst().replaceAll('_', ' ')>>
	<</if>>
	<<if $per_npc[_pNPCId].name_known and $debug is 1>>
		| <<link Rename>>
			<<if $per_npc[_pNPCId].pronoun is "f">>
				<<set $per_npc[_pNPCId].name to $NPC_names_f.random()>>
			<<else>>
				<<set $per_npc[_pNPCId].name to $NPC_names_m.random()>>
			<</if>>
			<<replace #perNPCSettingsMenu>><<perNPCSettingsMenu>><</replace>>
		<</link>>
	<</if>>

	<<radiobutton "$per_npc[_pNPCId].pronoun" "f" autocheck>> Female |
	<<radiobutton "$per_npc[_pNPCId].pronoun" "m" autocheck>> Male

	<<radiobutton "$per_npc[_pNPCId].gender" "f" autocheck>> Vagina |
	<<radiobutton "$per_npc[_pNPCId].gender" "m" autocheck>> Penis
	<<run settingsPersistentNpcGenderUpdate()>>

	Penis size - if applicable:

	<<set _penisNames to ["", "Tiny", "Average", "Thick", "Huge"]>> /* the empty first element is necessary because _j starts at 1 */
	<<for _j to 1; _j lt _penisNames.length; _j++>>

			<<radiobutton "$per_npc[_pNPCId].penissize" _j autocheck>>
			<<print _penisNames[_j]>>

		<<if _j isnot _penisNames.length -1>>|<</if>>
	<</for>>

		Breast size
		<<numberslider "$per_npc[_pNPCId].breastsize" $per_npc[_pNPCId].breastsize 0 12 1>>
		<<run settingsNamedNpcBreastSize(Util.slugify('$per_npc[_pNPCId].breastsize'), true)>>

		/*Keep at end of toggles*/

<</widget>>

:: Settings
<<settings>>

:: Attitudes
<<attitudes>>
<<set $attitudesControl.showGoldLink to "false">>

<<link [[Confirm|$attitudesExitPassage]]>>
	<<unset $attitudesExitPassage>>
	<<run DefaultActions.save(T.defaultActions)>>
<</link>>

repo_name: Area/degrees

license: mit


code:
:: Widgets Difficulty [widget]
<<widget "chestdifficulty">>
<<if $checkstyle is "skillname">>
<<elseif (990 - ($enemytrust * 10) - $chestskill + $enemyanger) lte (($enemyarousalmax / ($enemyarousal + 1)) * 100)>>
	(Very Easy)
<<elseif (800 - ($enemytrust * 10) - $chestskill + $enemyanger) lte (($enemyarousalmax / ($enemyarousal + 1)) * 100)>>
	(Easy)
<<elseif (600 - ($enemytrust * 10) - $chestskill + $enemyanger) lte (($enemyarousalmax / ($enemyarousal + 1)) * 100)>>
	(Medium)
<<elseif (400 - ($enemytrust * 10) - $chestskill + $enemyanger) lte (($enemyarousalmax / ($enemyarousal + 1)) * 100)>>
	(Challenging)
<<elseif (200 - ($enemytrust * 10) - $chestskill + $enemyanger) lte (($enemyarousalmax / ($enemyarousal + 1)) * 100)>>
	(Hard)
<<elseif (1 - ($enemytrust * 10) - $chestskill + $enemyanger) lte (($enemyarousalmax / ($enemyarousal + 1)) * 100)>>
	(Very Hard)
<<else>>
	(Impossible)
<</if>>
<</widget>>
<<widget "seductiondifficulty">><<silently>>
<<if $checkstyle is "skillname">>
	<<set _text_output to "">>
<<elseif $combat is 1>>
	<<if $args[0] is true>>
		<<if (990 - ($enemytrust * 10) - $seductionskill + $enemyanger) lte (($enemyarousalmax / ($enemyarousal + 1)) * 100)>>
			<<set _text_output to '(Very Easy)'>>
		<<elseif (800 - ($enemytrust * 10) - $seductionskill + $enemyanger) lte (($enemyarousalmax / ($enemyarousal + 1)) * 100)>>
			<<set _text_output to '(Easy)'>>
		<<elseif (600 - ($enemytrust * 10) - $seductionskill + $enemyanger) lte (($enemyarousalmax / ($enemyarousal + 1)) * 100)>>
			<<set _text_output to '(Medium)'>>
		<<elseif (400 - ($enemytrust * 10) - $seductionskill + $enemyanger) lte (($enemyarousalmax / ($enemyarousal + 1)) * 100)>>
			<<set _text_output to '(Challenging)'>>
		<<elseif (200 - ($enemytrust * 10) - $seductionskill + $enemyanger) lte (($enemyarousalmax / ($enemyarousal + 1)) * 100)>>
			<<set _text_output to '(Hard)'>>
		<<elseif (1 - ($enemytrust * 10) - $seductionskill + $enemyanger) lte (($enemyarousalmax / ($enemyarousal + 1)) * 100)>>
			<<set _text_output to '(Very Hard)'>>
		<<else>>
			<<set _text_output to '(Impossible)'>>
		<</if>>
	<<else>>
		<<if (990 - ($enemytrust * 10) - $seductionskill + $enemyanger) lte (($enemyarousalmax / ($enemyarousal + 1)) * 100)>>
			<<set _text_output to '(Very Easy)'>>
		<<elseif (800 - ($enemytrust * 10) - $seductionskill + $enemyanger) lte (($enemyarousalmax / ($enemyarousal + 1)) * 100)>>
			<<set _text_output to '(Easy)'>>
		<<elseif (600 - ($enemytrust * 10) - $seductionskill + $enemyanger) lte (($enemyarousalmax / ($enemyarousal + 1)) * 100)>>
			<<set _text_output to '(Medium)'>>
		<<elseif (400 - ($enemytrust * 10) - $seductionskill + $enemyanger) lte (($enemyarousalmax / ($enemyarousal + 1)) * 100)>>
			<<set _text_output to '(Challenging)'>>
		<<elseif (200 - ($enemytrust * 10) - $seductionskill + $enemyanger) lte (($enemyarousalmax / ($enemyarousal + 1)) * 100)>>
			<<set _text_output to '(Hard)'>>
		<<elseif (1 - ($enemytrust * 10) - $seductionskill + $enemyanger) lte (($enemyarousalmax / ($enemyarousal + 1)) * 100)>>
			<<set _text_output to '(Very Hard)'>>
		<<else>>
			<<set _text_output to '(Impossible)'>>
		<</if>>
	<</if>>
<<else>>
	<<if 990 - $seductionskill - ($attractiveness / 10) lte -100>>
		<<set _text_output to '(Very Easy)'>>
	<<elseif 800 - $seductionskill - ($attractiveness / 10) lte -100>>
		<<set _text_output to '(Easy)'>>
	<<elseif 600 - $seductionskill - ($attractiveness / 10) lte -100>>
		<<set _text_output to '(Medium)'>>
	<<elseif 400 - $seductionskill - ($attractiveness / 10) lte -100>>
		<<set _text_output to '(Challenging)'>>
	<<elseif 200 - $seductionskill - ($attractiveness / 10) lte -100>>
		<<set _text_output to '(Hard)'>>
	<<elseif 1 - $seductionskill - ($attractiveness / 10) lte -100>>
		<<set _text_output to '(Very Hard)'>>
	<<else>>
		<<set _text_output to '(Impossible)'>>
	<</if>>
<</if>>
<</silently>><<if _text_output and $args[0] isnot true and $checkstyle isnot "skillname">><<print _text_output>><</if>>
<</widget>>

<<widget "oraldifficulty">>
<<if $checkstyle is "skillname">>
<<elseif (990 - ($enemytrust * 10) - $oralskill + $enemyanger) lte (($enemyarousalmax / ($enemyarousal + 1)) * 100)>>
	(Very Easy)
<<elseif (800 - ($enemytrust * 10) - $oralskill + $enemyanger) lte (($enemyarousalmax / ($enemyarousal + 1)) * 100)>>
	(Easy)
<<elseif (600 - ($enemytrust * 10) - $oralskill + $enemyanger) lte (($enemyarousalmax / ($enemyarousal + 1)) * 100)>>
	(Medium)
<<elseif (400 - ($enemytrust * 10) - $oralskill + $enemyanger) lte (($enemyarousalmax / ($enemyarousal + 1)) * 100)>>
	(Challenging)
<<elseif (200 - ($enemytrust * 10) - $oralskill + $enemyanger) lte (($enemyarousalmax / ($enemyarousal + 1)) * 100)>>
	(Hard)
<<elseif (1 - ($enemytrust * 10) - $oralskill + $enemyanger) lte (($enemyarousalmax / ($enemyarousal + 1)) * 100)>>
	(Very Hard)
<<else>>
	(Impossible)
<</if>>
<</widget>>

<<widget "vaginaldifficulty">>
<<if $checkstyle is "skillname">>
<<elseif (990 - ($enemytrust * 10) - $vaginalskill + $enemyanger) lte (($enemyarousalmax / ($enemyarousal + 1)) * 100)>>
	(Very Easy)
<<elseif (800 - ($enemytrust * 10) - $vaginalskill + $enemyanger) lte (($enemyarousalmax / ($enemyarousal + 1)) * 100)>>
	(Easy)
<<elseif (600 - ($enemytrust * 10) - $vaginalskill + $enemyanger) lte (($enemyarousalmax / ($enemyarousal + 1)) * 100)>>
	(Medium)
<<elseif (400 - ($enemytrust * 10) - $vaginalskill + $enemyanger) lte (($enemyarousalmax / ($enemyarousal + 1)) * 100)>>
	(Challenging)
<<elseif (200 - ($enemytrust * 10) - $vaginalskill + $enemyanger) lte (($enemyarousalmax / ($enemyarousal + 1)) * 100)>>
	(Hard)
<<elseif (1 - ($enemytrust * 10) - $vaginalskill + $enemyanger) lte (($enemyarousalmax / ($enemyarousal + 1)) * 100)>>
	(Very Hard)
<<else>>
	(Impossible)
<</if>>
<</widget>>

<<widget "analdifficulty">>
<<if $checkstyle is "skillname">>
<<elseif (990 - ($enemytrust * 10) - $analskill + $enemyanger) lte (($enemyarousalmax / ($enemyarousal + 1)) * 100)>>
	(Very Easy)
<<elseif (800 - ($enemytrust * 10) - $analskill + $enemyanger) lte (($enemyarousalmax / ($enemyarousal + 1)) * 100)>>
	(Easy)
<<elseif (600 - ($enemytrust * 10) - $analskill + $enemyanger) lte (($enemyarousalmax / ($enemyarousal + 1)) * 100)>>
	(Medium)
<<elseif (400 - ($enemytrust * 10) - $analskill + $enemyanger) lte (($enemyarousalmax / ($enemyarousal + 1)) * 100)>>
	(Challenging)
<<elseif (200 - ($enemytrust * 10) - $analskill + $enemyanger) lte (($enemyarousalmax / ($enemyarousal + 1)) * 100)>>
	(Hard)
<<elseif (1 - ($enemytrust * 10) - $analskill + $enemyanger) lte (($enemyarousalmax / ($enemyarousal + 1)) * 100)>>
	(Very Hard)
<<else>>
	(Impossible)
<</if>>
<</widget>>

<<widget "handdifficulty">>
<<if $checkstyle is "skillname">>
<<elseif (990 - ($enemytrust * 10) - $handskill + $enemyanger) lte (($enemyarousalmax / ($enemyarousal + 1)) * 100)>>
	(Very Easy)
<<elseif (800 - ($enemytrust * 10) - $handskill + $enemyanger) lte (($enemyarousalmax / ($enemyarousal + 1)) * 100)>>
	(Easy)
<<elseif (600 - ($enemytrust * 10) - $handskill + $enemyanger) lte (($enemyarousalmax / ($enemyarousal + 1)) * 100)>>
	(Medium)
<<elseif (400 - ($enemytrust * 10) - $handskill + $enemyanger) lte (($enemyarousalmax / ($enemyarousal + 1)) * 100)>>
	(Challenging)
<<elseif (200 - ($enemytrust * 10) - $handskill + $enemyanger) lte (($enemyarousalmax / ($enemyarousal + 1)) * 100)>>
	(Hard)
<<elseif (1 - ($enemytrust * 10) - $handskill + $enemyanger) lte (($enemyarousalmax / ($enemyarousal + 1)) * 100)>>
	(Very Hard)
<<else>>
	(Impossible)
<</if>>
<</widget>>

<<widget "feetdifficulty">>
<<if $checkstyle is "skillname">>
<<elseif (990 - ($enemytrust * 10) - $feetskill + $enemyanger) lte (($enemyarousalmax / ($enemyarousal + 1)) * 100)>>
	(Very Easy)
<<elseif (800 - ($enemytrust * 10) - $feetskill + $enemyanger) lte (($enemyarousalmax / ($enemyarousal + 1)) * 100)>>
	(Easy)
<<elseif (600 - ($enemytrust * 10) - $feetskill + $enemyanger) lte (($enemyarousalmax / ($enemyarousal + 1)) * 100)>>
	(Medium)
<<elseif (400 - ($enemytrust * 10) - $feetskill + $enemyanger) lte (($enemyarousalmax / ($enemyarousal + 1)) * 100)>>
	(Challenging)
<<elseif (200 - ($enemytrust * 10) - $feetskill + $enemyanger) lte (($enemyarousalmax / ($enemyarousal + 1)) * 100)>>
	(Hard)
<<elseif (1 - ($enemytrust * 10) - $feetskill + $enemyanger) lte (($enemyarousalmax / ($enemyarousal + 1)) * 100)>>
	(Very Hard)
<<else>>
	(Impossible)
<</if>>
<</widget>>

<<widget "bottomdifficulty">>
<<if $checkstyle is "skillname">>
<<elseif (990 - ($enemytrust * 10) - $bottomskill + $enemyanger) lte (($enemyarousalmax / ($enemyarousal + 1)) * 100)>>
	(Very Easy)
<<elseif (800 - ($enemytrust * 10) - $bottomskill + $enemyanger) lte (($enemyarousalmax / ($enemyarousal + 1)) * 100)>>
	(Easy)
<<elseif (600 - ($enemytrust * 10) - $bottomskill + $enemyanger) lte (($enemyarousalmax / ($enemyarousal + 1)) * 100)>>
	(Medium)
<<elseif (400 - ($enemytrust * 10) - $bottomskill + $enemyanger) lte (($enemyarousalmax / ($enemyarousal + 1)) * 100)>>
	(Challenging)
<<elseif (200 - ($enemytrust * 10) - $bottomskill + $enemyanger) lte (($enemyarousalmax / ($enemyarousal + 1)) * 100)>>
	(Hard)
<<elseif (1 - ($enemytrust * 10) - $bottomskill + $enemyanger) lte (($enemyarousalmax / ($enemyarousal + 1)) * 100)>>
	(Very Hard)
<<else>>
	(Impossible)
<</if>>
<</widget>>

<<widget "thighdifficulty">>
<<if $checkstyle is "skillname">>
<<elseif (990 - ($enemytrust * 10) - $thighskill + $enemyanger) lte (($enemyarousalmax / ($enemyarousal + 1)) * 100)>>
	(Very Easy)
<<elseif (800 - ($enemytrust * 10) - $thighskill + $enemyanger) lte (($enemyarousalmax / ($enemyarousal + 1)) * 100)>>
	(Easy)
<<elseif (600 - ($enemytrust * 10) - $thighskill + $enemyanger) lte (($enemyarousalmax / ($enemyarousal + 1)) * 100)>>
	(Medium)
<<elseif (400 - ($enemytrust * 10) - $thighskill + $enemyanger) lte (($enemyarousalmax / ($enemyarousal + 1)) * 100)>>
	(Challenging)
<<elseif (200 - ($enemytrust * 10) - $thighskill + $enemyanger) lte (($enemyarousalmax / ($enemyarousal + 1)) * 100)>>
	(Hard)
<<elseif (1 - ($enemytrust * 10) - $thighskill + $enemyanger) lte (($enemyarousalmax / ($enemyarousal + 1)) * 100)>>
	(Very Hard)
<<else>>
	(Impossible)
<</if>>
<</widget>>

<<widget "peniledifficulty">>
<<if $checkstyle is "skillname">>
<<elseif (990 - ($enemytrust * 10) - $penileskill + $enemyanger) lte (($enemyarousalmax / ($enemyarousal + 1)) * 100)>>
	(Very Easy)
<<elseif (800 - ($enemytrust * 10) - $penileskill + $enemyanger) lte (($enemyarousalmax / ($enemyarousal + 1)) * 100)>>
	(Easy)
<<elseif (600 - ($enemytrust * 10) - $penileskill + $enemyanger) lte (($enemyarousalmax / ($enemyarousal + 1)) * 100)>>
	(Medium)
<<elseif (400 - ($enemytrust * 10) - $penileskill + $enemyanger) lte (($enemyarousalmax / ($enemyarousal + 1)) * 100)>>
	(Challenging)
<<elseif (200 - ($enemytrust * 10) - $penileskill + $enemyanger) lte (($enemyarousalmax / ($enemyarousal + 1)) * 100)>>
	(Hard)
<<elseif (1 - ($enemytrust * 10) - $penileskill + $enemyanger) lte (($enemyarousalmax / ($enemyarousal + 1)) * 100)>>
	(Very Hard)
<<else>>
	(Impossible)
<</if>>
<</widget>>

<<widget "skulduggerycheck">>
<<set $skulduggeryroll to random(1, 1000)>>
<<set _skulduggery to clone($skulduggery)>>
<<if $moorLuck gt 0>>
	<<set _skulduggery to Math.floor(_skulduggery * (1 + ($moorLuck / 100)))>>
<</if>>
<<if $worn.hands.type.includes("sticky_fingers")>>
	<<set _skulduggery to Math.floor(_skulduggery * 1.05)>>
<</if>>
<<if $harpy gte 2 or $cat gte 2>>
	<<set _skulduggery to Math.floor(_skulduggery * 1.05)>>
<</if>>
<<if _skulduggery gte $skulduggerydifficulty>>
	<<set $skulduggerysuccess to 1>>
	You succeed in your skulduggery.
<<elseif _skulduggery + 100 gte $skulduggerydifficulty>>
	<<if $skulduggeryroll gte 100>>
		<<set $skulduggerysuccess to 1>>
		You succeed in your skulduggery.
	<<else>>
		<<set $skulduggerysuccess to 0>>
		You fail in your skulduggery.
	<</if>>
<<elseif _skulduggery + 200 gte $skulduggerydifficulty>>
	<<if $skulduggeryroll gte 300>>
		<<set $skulduggerysuccess to 1>>
		You succeed in your skulduggery.
	<<else>>
		<<set $skulduggerysuccess to 0>>
		You fail in your skulduggery.
	<</if>>
<<elseif _skulduggery + 300 gte $skulduggerydifficulty>>
	<<if $skulduggeryroll gte 500>>
		<<set $skulduggerysuccess to 1>>
		You succeed in your skulduggery.
	<<else>>
		<<set $skulduggerysuccess to 0>>
		You fail in your skulduggery.
	<</if>>
<<elseif _skulduggery + 400 gte $skulduggerydifficulty>>
	<<if $skulduggeryroll gte 700>>
		<<set $skulduggerysuccess to 1>>
		You succeed in your skulduggery.
	<<else>>
		<<set $skulduggerysuccess to 0>>
		You fail in your skulduggery.
	<</if>>
<<elseif _skulduggery + 500 gte $skulduggerydifficulty>>
	<<if $skulduggeryroll gte 900>>
		<<set $skulduggerysuccess to 1>>
		You succeed in your skulduggery.
	<<else>>
		<<set $skulduggerysuccess to 0>>
		You fail in your skulduggery.
	<</if>>
<<else>>
	<<set $skulduggerysuccess to 0>>
	You fail in your skulduggery.
<</if>>
<</widget>>

<<widget "skulduggerydifficulty">>
<<if $checkstyle is "skillname">>
 	| Skulduggery
 <<else>>
	<<set _skulduggery to clone($skulduggery)>>
	<<if $moorLuck gt 0>>
		<<set _skulduggery to Math.floor(_skulduggery * (1 + ($moorLuck / 100)))>>
	<</if>>
	<<if $worn.hands.type.includes("sticky_fingers")>>
		<<set _skulduggery to Math.floor(_skulduggery * 1.05)>>
	<</if>>
	<<if $harpy gte 2 or $cat gte 2>>
		<<set _skulduggery to Math.floor(_skulduggery * 1.05)>>
	<</if>>
 	| Skulduggery:
	<<if _skulduggery gte $skulduggerydifficulty>>
		Very Easy
	<<elseif _skulduggery + 100 gte $skulduggerydifficulty>>
		Easy
	<<elseif _skulduggery + 200 gte $skulduggerydifficulty>>
		Medium
	<<elseif _skulduggery + 300 gte $skulduggerydifficulty>>
		Challenging
	<<elseif _skulduggery + 400 gte $skulduggerydifficulty>>
		Hard
	<<elseif _skulduggery + 500 gte $skulduggerydifficulty>>
		Very Hard
	<<else>>
		Impossible
	<</if>>
<</if>>
<</widget>>

<<widget "skulduggeryrequired">>
Skulduggery required:
<<if $lock lte 0>>
	None
<<elseif $lock gte 1 and $lock lt 100>>
	F
<<elseif $lock gte 100 and $lock lt 200>>
	F+
<<elseif $lock gte 200 and $lock lt 300>>
	D
<<elseif $lock gte 300 and $lock lt 400>>
	D+
<<elseif $lock gte 400 and $lock lt 500>>
	C
<<elseif $lock gte 500 and $lock lt 600>>
	C+
<<elseif $lock gte 600 and $lock lt 700>>
	B
<<elseif $lock gte 700 and $lock lt 800>>
	B+
<<elseif $lock gte 800 and $lock lt 900>>
	A
<<elseif $lock gte 900 and $lock lt 1000>>
	A+
<<elseif $lock gte 1000>>
	S
<</if>>
<</widget>>
<<widget "seductioncheck">>
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>>

Seduction Skill:
<<if $seductionskill lte 0>>
	None
<<elseif $seductionskill gte 1 and $seductionskill lt 200>>
	F
<<elseif $seductionskill gte 200 and $seductionskill lt 400>>
	D
<<elseif $seductionskill gte 400 and $seductionskill lt 600>>
	C
<<elseif $seductionskill gte 600 and $seductionskill lt 800>>
	B
<<elseif $seductionskill gte 800 and $seductionskill lt 1000>>
	A
<<elseif $seductionskill gte 1000>>
	S
<</if>>

Overall rating:
<<if $attractiveness + ($seductionskill * 5) gte 10000>>
	S
	<<set $seductionrating to 6>>
<<elseif $attractiveness + ($seductionskill * 5) gte 8000>>
	A
	<<set $seductionrating to 5>>
<<elseif $attractiveness + ($seductionskill * 5) gte 6000>>
	B
	<<set $seductionrating to 4>>
<<elseif $attractiveness + ($seductionskill * 5) gte 4000>>
	C
	<<set $seductionrating to 3>>
<<elseif $attractiveness + ($seductionskill * 5) gte 2000>>
	D
	<<set $seductionrating to 2>>
<<else>>
	F
	<<set $seductionrating to 1>>
<</if>>

Required rating:
<<if $seductiondifficulty gte 10000>>
	S
	<<set $seductionrequired to 6>>
<<elseif $seductiondifficulty gte 8000>>
	A
	<<set $seductionrequired to 5>>
<<elseif $seductiondifficulty gte 6000>>
	B
	<<set $seductionrequired to 4>>
<<elseif $seductiondifficulty gte 4000>>
	C
	<<set $seductionrequired to 3>>
<<elseif $seductiondifficulty gte 2000>>
	D
	<<set $seductionrequired to 2>>
<<else>>
	F
	<<set $seductionrequired to 1>>
<</if>>
<</widget>>

<<widget "physiquedifficulty">>
<<set _physiquedifficultymin to ($args[0] ? $args[0] : 1)>>
<<set _physiquedifficultymax to ($args[1] ? $args[1] : $physiquemax)>>
<<set _physique to clone($physique)>>
<<if $moorLuck gt 0>>
	<<set _physique to Math.floor(_physique * (1 + ($moorLuck / 100)))>>
<</if>>
<<if $sexStats.vagina.pregnancy.bellySize gte 10>>
	<<switch $pregnancyStats.mother>>
		<<case 0>><<set _pregnancyModifier to 30>>
		<<case 1>><<set _pregnancyModifier to 40>>
		<<case 2>><<set _pregnancyModifier to 50>>
		<<case 3>><<set _pregnancyModifier to 65>>
		<<case 4>><<set _pregnancyModifier to 100>>
	<</switch>>
	<<set _physique to Math.floor(_physique * (1 - ($sexStats.vagina.pregnancy.bellySize / _pregnancyModifier)))>>
<</if>>
<<switch $location>>
	<<case "forest" "moor" "farm">>
		<<if $worn.feet.type.includes("heels")>>
			<<set _physique to Math.floor(_physique * (1 - ($worn.feet.reveal / 5000)))>>
		<</if>>
		<<if $worn.feet.type.includes("rugged")>>
			<<set _physique to Math.floor(_physique * (1 + ($feetskill / 10000)))>>
		<</if>>
<</switch>>
<<if $args[2] is undefined>>
	<<if $checkstyle is "skillname">>
		| Physique
	<<else>>
		| Physique:
		<<set _difficulty to Math.round(Math.clamp(_physique - _physiquedifficultymin, 0, _physiquedifficultymax) / (_physiquedifficultymax - _physiquedifficultymin) * 100)>>
		<<if _difficulty gt 100>>
			<<set _difficulty to 100>>
		<</if>>
		<<skillDifficultyText _difficulty>>
	<</if>>
<</if>>
<<if _physique gte random(_physiquedifficultymin, _physiquedifficultymax)>>
	<<set $physiqueSuccess to 1>>
<<else>>
	<<set $physiqueSuccess to 0>>
<</if>>
<</widget>>

<<widget "dancedifficulty">>
<<set _dancedifficultymin to ($args[0] ? $args[0] : 1)>>
<<set _dancedifficultymax to ($args[1] ? $args[1] : 1000)>>
<<set _danceskill to clone($danceskill)>>
<<if $moorLuck gt 0>>
	<<set _danceskill to Math.floor(_danceskill * (1 + ($moorLuck / 100)))>>
<</if>>
<<if $sexStats.vagina.pregnancy.bellySize gte 10>>
	<<switch $pregnancyStats.mother>>
		<<case 0>><<set _pregnancyModifier to 30>>
		<<case 1>><<set _pregnancyModifier to 40>>
		<<case 2>><<set _pregnancyModifier to 50>>
		<<case 3>><<set _pregnancyModifier to 65>>
		<<case 4>><<set _pregnancyModifier to 100>>
	<</switch>>
	<<set _danceskill to Math.floor(_danceskill * (1 - ($sexStats.vagina.pregnancy.bellySize / _pregnancyModifier)))>>
<</if>>
<<if $worn.under_upper.type.includesAny("dance", "naked") and $worn.under_lower.type.includesAny("dance", "naked")
and $worn.upper.type.includesAny("dance", "naked")and $worn.lower.type.includesAny("dance", "naked")>>
	<<set _danceskill to Math.floor(_danceskill * 1.05)>>
<</if>>
<<if $worn.feet.type.includes("shackle")>>
	<<set _danceskill to Math.floor(_danceskill * 0.5)>>
<</if>>
<<if $args[2] is undefined>>
	<<if $checkstyle is "skillname">>
		| Dance
	<<else>>
		| Dance:
		<<set _difficulty to Math.round(Math.clamp(_danceskill - _dancedifficultymin, 0, _dancedifficultymax) / (_dancedifficultymax - _dancedifficultymin) * 100)>>
		<<if _difficulty gt 100>>
			<<set _difficulty to 100>>
		<</if>>
		<<skillDifficultyText _difficulty>>
	<</if>>
<</if>>
<<if _danceskill gte random(_dancedifficultymin, _dancedifficultymax)>>
	<<set $danceSuccess to 1>>
<<else>>
	<<set $danceSuccess to 0>>
<</if>>
<</widget>>

<<widget "swimmingdifficulty">>
<<set _swimmingdifficultymin to ($args[0] ? $args[0] : 1)>>
<<set _swimmingdifficultymax to ($args[1] ? $args[1] : 1000)>>
<<set _swimmingskill to clone($swimmingskill)>>
<<if $moorLuck gt 0>>
	<<set _swimmingskill to Math.floor(_swimmingskill * (1 + ($moorLuck / 100)))>>
<</if>>
<<if $sexStats.vagina.pregnancy.bellySize gte 10>>
	<<switch $pregnancyStats.mother>>
		<<case 0>><<set _pregnancyModifier to 30>>
		<<case 1>><<set _pregnancyModifier to 40>>
		<<case 2>><<set _pregnancyModifier to 50>>
		<<case 3>><<set _pregnancyModifier to 65>>
		<<case 4>><<set _pregnancyModifier to 100>>
	<</switch>>
	<<set _swimmingskill to Math.floor(_swimmingskill * (1 - ($sexStats.vagina.pregnancy.bellySize / _pregnancyModifier)))>>
<</if>>
<<if $worn.under_upper.type.includesAny("swim", "naked") and $worn.under_lower.type.includesAny("swim", "naked")
and $worn.upper.type.includesAny("swim", "naked")and $worn.lower.type.includesAny("swim", "naked")>>
	<<set _swimmingskill to Math.floor(_swimmingskill * 1.05)>>
<</if>>
<<if $worn.feet.type.includes("swim")>>
	<<set _swimmingskill to Math.floor(_swimmingskill * (1 + ($feetskill / 10000)))>>
<<elseif !$worn.feet.type.includes("naked")>>
	<<if $worn.feet.type.includes("heels")>>
		<<set _heels to 0.1>>
	<<else>>
		<<set _heels to 0>>
	<</if>>
	<<set _swimmingskill to Math.floor(_swimmingskill * (0.9 + ($feetskill / 10000) - _heels))>>
<</if>>
<<if $worn.feet.type.includes("shackle")>>
	<<set _swimmingskill to Math.floor(_swimmingskill * 0.5)>>
<</if>>
<<if $args[2] is undefined>>
	<<if $checkstyle is "skillname">>
		| Swimming
	<<else>>
		| Swimming:
		<<set _difficulty to Math.round(Math.clamp(_swimmingskill - _swimmingdifficultymin, 0, _swimmingdifficultymax) / (_swimmingdifficultymax - _swimmingdifficultymin) * 100)>>
		<<if _difficulty gt 100>>
			<<set _difficulty to 100>>
		<</if>>
		<<skillDifficultyText _difficulty>>
	<</if>>
<</if>>
<<if _swimmingskill gte random(_swimmingdifficultymin, _swimmingdifficultymax)>>
	<<set $swimmingSuccess to 1>>
<<else>>
	<<set $swimmingSuccess to 0>>
<</if>>
<</widget>>

<<widget "athleticsdifficulty">>
<<set _athleticsdifficultymin to ($args[0] ? $args[0] : 1)>>
<<set _athleticsdifficultymax to ($args[1] ? $args[1] : 1000)>>
<<set _athletics to clone($athletics)>>
<<if $moorLuck gt 0>>
	<<set _athletics to Math.floor(_athletics * (1 + ($moorLuck / 100)))>>
<</if>>
<<if $sexStats.vagina.pregnancy.bellySize gte 10>>
	<<switch $pregnancyStats.mother>>
		<<case 0>><<set _pregnancyModifier to 30>>
		<<case 1>><<set _pregnancyModifier to 40>>
		<<case 2>><<set _pregnancyModifier to 50>>
		<<case 3>><<set _pregnancyModifier to 65>>
		<<case 4>><<set _pregnancyModifier to 100>>
	<</switch>>
	<<set _athletics to Math.floor(_athletics * (1 - ($sexStats.vagina.pregnancy.bellySize / _pregnancyModifier)))>>
<</if>>
<<switch $location>>
	<<case "forest" "moor" "farm">>
		<<if $worn.feet.type.includes("heels")>>
			<<set _athletics to Math.floor(_athletics * (1 - ($worn.feet.reveal / 5000)))>>
		<</if>>
		<<if $worn.feet.type.includes("rugged")>>
			<<set _athletics to Math.floor(_athletics * (1 + ($feetskill / 10000)))>>
		<</if>>
<</switch>>
<<if $worn.feet.type.includes("shackle")>>
	<<set _athletics to 0>>
<</if>>
<<if $args[2] is undefined>>
	<<if $checkstyle is "skillname">>
		| Athletics
	<<else>>
		| Athletics:
		<<set _difficulty to Math.round(Math.clamp(_athletics - _athleticsdifficultymin, 0, _athleticsdifficultymax) / (_athleticsdifficultymax - _athleticsdifficultymin) * 100)>>
		<<if _difficulty gt 100>>
			<<set _difficulty to 100>>
		<</if>>
		<<skillDifficultyText _difficulty>>
	<</if>>
<</if>>
<<if _athletics gte random(_athleticsdifficultymin, _athleticsdifficultymax)>>
	<<set $athleticsSuccess to 1>>
<<else>>
	<<set $athleticsSuccess to 0>>
<</if>>
<</widget>>

<<widget "willpowerdifficulty">>
<<set _willpowerdifficultymin to ($args[0] ? $args[0] : 1)>>
<<set _willpowerdifficultymax to ($args[1] ? $args[1] : $willpowermax)>>
<<set _willpower to clone($willpower)>>
<<if $moorLuck gt 0>>
	<<set _willpower to Math.floor(_willpower * (1 + ($moorLuck / 100)))>>
<</if>>
<<if $parasite.left_ear.name is "slime" and $parasite.right_ear.name is "slime">>
	<<set _willpower to Math.floor(_willpower * 0.9)>>
<</if>>
<<if $args[2] is undefined>>
	<<if $checkstyle is "skillname">>
		| Willpower
	<<else>>
		| Willpower:
		<<set _difficulty to Math.round(Math.clamp(_willpower - _willpowerdifficultymin, 0, _willpowerdifficultymax) / (_willpowerdifficultymax - _willpowerdifficultymin) * 100)>>
		<<if _difficulty gt 100>>
			<<set _difficulty to 100>>
		<</if>>
		<<skillDifficultyText _difficulty>>
	<</if>>
<<elseif $args[2] is "combat">>
	<<if $checkstyle is "skillname">>
	<<elseif _difficulty gte 100>>
		(Very Easy)
	<<elseif _difficulty gte 80>>
		(Easy)
	<<elseif _difficulty gte 60>>
		(Medium)
	<<elseif _difficulty gte 40>>
		(Challenging)
	<<elseif _difficulty gte 20>>
		(Hard)
	<<elseif _difficulty gte 1>>
		(Very Hard)
	<<else>>
		(Impossible)
	<</if>>
<</if>>
<<if _willpower gte random(_willpowerdifficultymin, _willpowerdifficultymax)>>
	<<set $willpowerSuccess to 1>>
<<else>>
	<<set $willpowerSuccess to 0>>
<</if>>
<</widget>>

<<widget "tendingdifficulty">>
<<set _tendingdifficultymin to ($args[0] ? $args[0] : 1)>>
<<set _tendingdifficultymax to ($args[1] ? $args[1] : 1000)>>
<<if $args[2] is undefined>>
	<<if $checkstyle is "skillname">>
		| Tending
	<<else>>
		| Tending:
		<<set _difficulty to Math.round(Math.clamp(currentSkillValue('tending') - _tendingdifficultymin, 0, _tendingdifficultymax) / (_tendingdifficultymax - _tendingdifficultymin) * 100)>>
		<<if _difficulty gt 100>>
			<<set _difficulty to 100>>
		<</if>>
		<<skillDifficultyText _difficulty>>
	<</if>>
<</if>>
<<if currentSkillValue('tending') gte random(_tendingdifficultymin, _tendingdifficultymax)>>
	<<set $tendingSuccess to 1>>
<<else>>
	<<set $tendingSuccess to 0>>
<</if>>
<</widget>>

<<widget "difficulty">>
<<if $args[0]>>
 | Success Chance:
	<<if $args[0] gte 100>>
		<<print $args[0]>>%
	<<elseif $args[0] gte 80>>
		<<print $args[0]>>%
	<<elseif $args[0] gte 60>>
		<<print $args[0]>>%
	<<elseif $args[0] gte 40>>
		<<print $args[0]>>%
	<<elseif $args[0] gte 20>>
		<<print $args[0]>>%
	<<elseif $args[0] gte 1>>
		<<print $args[0]>>%
	<<else>>
		<<print $args[0]>>%
	<</if>>
<</if>>
<</widget>>

<<widget "englishdifficulty">>
<<set _englishdifficultymin to ($args[0] ? $args[0] : 1)>>
<<set _englishdifficultymax to ($args[1] ? $args[1] : 1000)>>
<<set _english to clone($english)>>
<<if $moorLuck gt 0>>
	<<set _english to Math.floor(_english * (1 + ($moorLuck / 100)))>>
<</if>>
<<if $args[2] is undefined>>
	<<if $checkstyle is "skillname">>
		| English
	<<else>>
		| English:
		<<set _difficulty to Math.round(Math.clamp(_english - _englishdifficultymin, 0, _englishdifficultymax) / (_englishdifficultymax - _englishdifficultymin) * 100)>>
		<<if _difficulty gt 100>>
			<<set _difficulty to 100>>
		<</if>>
		<<skillDifficultyText _difficulty>>
	<</if>>
<</if>>
<<if _english gte random(_englishdifficultymin, _englishdifficultymax)>>
	<<set $englishSuccess to 1>>
<<else>>
	<<set $englishSuccess to 0>>
<</if>>
<</widget>>

<<widget "skill_difficulty">>
/*args[0]: skill to be checked.
args[1]: skill name to display.
args[2]: skill required to have a chance.
args[3]: skill required for 100% success rate
args[4]: hide the skill text.*/
<<set _skilldifficultymin to ($args[2] ? $args[2] : 1)>>
<<set _skilldifficultymax to ($args[3] ? $args[3] : 1000)>>
/* Note: willpower uses a different default value for skilldifficultymax */
<<if $args[4] is undefined>>
	<<if $checkstyle is "skillname">>
		| <<print $args[1]>>
	<<else>>
		| <<print $args[1]>>:
		<<print '<<set _difficulty to Math.round(Math.clamp($' + $args[0] + ' - _skilldifficultymin, 0, _skilldifficultymax) / (_skilldifficultymax - _skilldifficultymin) * 100)>>'>>
		<<if _difficulty gt 100>>
			<<set _difficulty to 100>>
		<</if>>
		<<skillDifficultyText _difficulty>>
	<</if>>
<</if>>
<</widget>>

<<widget "historyrequired">>
/* args[0] = historyTrait required
 */
History Grade required:
<<if $args[0] gte 1 and $args[0] lt 2>>
	C
<<elseif $args[0] gte 2 and $args[0] lt 3>>
	B
<<elseif $args[0] gte 3 and $args[0] lt 4>>
	A
<<elseif $args[0] gte 4>>
	A*
<</if>>
<</widget>>

<<widget "skillDifficultyText">>
	<<set $_difficulty to $args[0]>>
	<<if $_difficulty gte 100>>
		Simple <<if $checkstyle is "percentage">>$_difficulty%<</if>>
	<<elseif $_difficulty gte 80>>
		Easy <<if $checkstyle is "percentage">>$_difficulty%<</if>>
	<<elseif $_difficulty gte 60>>
		Reasonable <<if $checkstyle is "percentage">>$_difficulty%<</if>>
	<<elseif $_difficulty gte 40>>
		Challenging <<if $checkstyle is "percentage">>$_difficulty%<</if>>
	<<elseif $_difficulty gte 20>>
		Hard <<if $checkstyle is "percentage">>$_difficulty%<</if>>
	<<elseif $_difficulty gte 1>>
		Very Hard <<if $checkstyle is "percentage">>$_difficulty%<</if>>
	<<else>>
		Impossible <<if $checkstyle is "percentage">>$_difficulty%<</if>>
	<</if>>
<</widget>>


code:
:: Widgets skinColorWidget [widget]
<<widget "skinColorInit">>
	<<if $skinColor isnot undefined>>
		<<set _natural to $skinColor.natural>>
		<<set _init to $skinColor.init>>
		<<set _tanning to $skinColor.tanningEnabled>>
		<<set _enable to $skinColor.tanImgEnabled>>
	<<else>>
		<<set _natural to "light">>
		<<set _init to false>>
		<<set _tanning to false>>
		<<set _enable to "f">>
	<</if>>
	<<set $skinColor to {
		"tanLoc":["body", "breasts", "penis", "swimshorts", "swimsuitTop", "swimsuitBottom", "bikiniTop", "bikiniBottom", "tshirt"],
		"natural": _natural,
		"init": _init,
		"tanningEnabled": _tanning,
		"tanImgEnabled": _enable,
		"range": 0,
		"current": {
			"test": "",
			"body": "",
			"breasts": "",
			"penis": "",
			"swimshorts": "",
			"swimsuitTop": "",
			"swimsuitBottom": "",
			"bikiniTop": "",
			"bikiniBottom": "",
			"tshirt": "",
			"mouth": ""
		},
		"tanValues": [0,0,0,0,0,0,0,0,0],
		"overwriteEnable": false,
		"sunBlock": false,
		"overwrite": null,
		"overwriteValues": {
			"hStart": 45, "hEnd": 45,
			"sStart": 0.2, "sEnd": 0.4,
			"bStart": 4.5, "bEnd": 0.7,
		}
	}>>
	<<set $objectVersion.skinColor to 1>>
<</widget>>

<<widget "skinColorInitOldSave">>
	<<set $skinColor to {
		"tanLoc":["body", "breasts", "penis", "swimshorts", "swimsuitTop", "swimsuitBottom", "bikiniTop", "bikiniBottom", "tshirt"],
		"natural": null,
		"init": false,
		"tanningEnabled": false,
		"tanImgEnabled": "f",
		"range": 0,
		"current": {
			"test": "",
			"body": "",
			"breasts": "",
			"penis": "",
			"swimshorts": "",
			"swimsuitTop": "",
			"swimsuitBottom": "",
			"bikiniTop": "",
			"bikiniBottom": "",
			"tshirt": "",
			"mouth": ""
		},
		"tanValues": [0,0,0,0,0,0,0,0,0],
		"overwriteEnable": false,
		"sunBlock": false,
		"overwrite": null,
		"overwriteValues": {
			"hStart": 45, "hEnd": 45,
			"sStart": 0.2, "sEnd": 0.4,
			"bStart": 4.5, "bEnd": 0.7,
		}
	}>>

	<<set $objectVersion.skinColor to 1>>
<</widget>>

<<widget "setSkinColorBase">>
	<<if $skinColor isnot undefined>>
		<<if $skinColor.overwriteEnable is false>>
			<<set $skinColor.overwrite to setup.skinColor[$skinColor.natural]>>
		<<else>>
			<<set $skinColor.overwrite to $skinColor.overwriteValues>>
		<</if>>
		<<if $skinColor.init is false>>
			<<set $skinColor.init to true>>
			<<set $skinColor.tanValues to []>>

			<<for _i to 0; _i lt $skinColor.tanLoc.length; _i++>>
				<<set $skinColor.tanValues.push($skinColor.range)>>
				<<set $skinColor.current[$skinColor.tanLoc[_i]] to skinColor($skinColor.tanImgEnabled, $skinColor.range,$skinColor.overwrite)>>
			<</for>>
			<<set $skinColor.current.mouth to skinColor($skinColor.tanImgEnabled, $skinColor.range,$skinColor.overwrite)>>
		<</if>>
	<</if>>
<</widget>>

<<widget "SkinColorImgTest">>

<<if $skinColor.tanImgEnabled is "f">>
	<<set $skinColor.tanImgEnabled to "t">>
	<<set _skincolortemp to true>>
<</if>>
<<print '<img class="" src="img/bodyRed/baseReColorTest.png" style="filter:'+skinColor($skinColor.tanImgEnabled, $range,setup.skinColor[$naturalSkinColor])+'">'>>
<<if _skincolortemp is true>>
	<<set $skinColor.tanImgEnabled to "f">>
<</if>>

<</widget>>

<<widget "tanned">>
<<if $skinColor.tanningEnabled is true>>
	<<set _coverage to [0,0,0,0,0,0,0,0,0]>>
	<<if $args[1] is "ignoreCoverage">>
		<<set _coverage to [0,0,0,0,0,0,0,0,0]>>
	<<elseif $args[1] is "tanLines">>
		<<tannedCoverage>>
	<</if>>
	<<if $skinColor.sunBlock is true and $args[0] gt 0>>
		<<set _tanChange to 0>>
	<<else>>
		<<set _tanChange to $args[0] / 24>>
	<</if>>

	<<for _i to 0; _i lt $skinColor.tanLoc.length; _i++>>
		<<if _coverage[_i] is 0>>
			<<set _tanLoc to $skinColor.tanLoc[_i]>>
			<<set $skinColor.tanValues[_i] to Math.clamp(($skinColor.tanValues[_i] + _tanChange).toFixed(1), 0, 100)>>
			<<set $skinColor.current[_tanLoc] to skinColor($skinColor.tanImgEnabled, $skinColor.tanValues[_i],$skinColor.overwrite)>>
		<</if>>
	<</for>>
	<<set $skinColor.current.mouth to skinColor($skinColor.tanImgEnabled, $skinColor.tanValues[0],$skinColor.overwrite)>>
<</if>>
<<if $skinColor.tanningEnabled is false and $skinColor.tanImgEnabled is "f">>
	<<set $skinColor.current to {
		"test": "",
		"body": "",
		"breasts": "",
		"penis": "",
		"swimshorts": "",
		"swimsuitTop": "",
		"swimsuitBottom": "",
		"bikiniTop": "",
		"bikiniBottom": "",
		"tshirt": "",
		"mouth": ""
	}>>
<</if>>
<<if $skinColor.tanningEnabled is false and $skinColor.tanImgEnabled is "t">>
	<<for _s to 0; _s lt $skinColor.tanLoc.length; _s++>>
		<<set $skinColor.current[$skinColor.tanLoc[_s]] to skinColor($skinColor.tanImgEnabled, $skinColor.tanValues[_s],$skinColor.overwrite)>>
	<</for>>
	<<set $skinColor.current.mouth to skinColor($skinColor.tanImgEnabled, $skinColor.tanValues[0],$skinColor.overwrite)>>
<</if>>
<</widget>>

<<widget "tannedCoverage">>
<<if $worn.over_upper.name isnot "naked" or $worn.upper.name isnot "naked">>
<<else>>
	<<switch $worn.under_upper.name>>
	<<case "bikini top">>
		<<set _coverage[$skinColor.tanLoc.indexOf("bikiniTop")] to 1>>
		<<set _coverage[$skinColor.tanLoc.indexOf("breasts")] to 1>>
	<<case "school swimsuit" "foreign school swimsuit">>
		<<set _coverage[$skinColor.tanLoc.indexOf("bikiniTop")] to 1>>
		<<set _coverage[$skinColor.tanLoc.indexOf("swimsuitTop")] to 1>>
		<<set _coverage[$skinColor.tanLoc.indexOf("breasts")] to 1>>
	<</switch>>
<</if>>
<<if $worn.over_lower.name isnot "naked" or $worn.lower.name isnot "naked">>
<<else>>
	<<switch $worn.under_lower.name>>
	<<case "bikini bottoms">>
		<<set _coverage[$skinColor.tanLoc.indexOf("bikiniBottom")] to 1>>
		<<set _coverage[$skinColor.tanLoc.indexOf("swimsuitBottom")] to 1>>
		<<set _coverage[$skinColor.tanLoc.indexOf("penis")] to 1>>
	<<case "school swimsuit bottom" "foreign school swimsuit bottom">>
		<<set _coverage[$skinColor.tanLoc.indexOf("swimsuitBottom")] to 1>>
		<<set _coverage[$skinColor.tanLoc.indexOf("bikiniBottom")] to 1>>
		<<set _coverage[$skinColor.tanLoc.indexOf("penis")] to 1>>
	<<case "school swim shorts">>
		<<set _coverage[$skinColor.tanLoc.indexOf("swimshorts")] to 1>>
		<<set _coverage[$skinColor.tanLoc.indexOf("bikiniBottom")] to 1>>
		<<set _coverage[$skinColor.tanLoc.indexOf("penis")] to 1>>
	<</switch>>
<</if>>
<</widget>>


code:
:: Widgets Sleep [widget]

<<widget "sleep">>
	<<sleephour>>
<</widget>>

<<widget "sleephour">>
	<<set $sleepHoursTotal to 0>>
	<<set _equip to ["over_upper", "over_lower", "upper", "lower", "over_head", "head", "face", "neck", "hands", "legs", "feet"]>>
	<<set _sleepTraitEffect to 10>>
	<<if $worn.upper.type.includes("sleep") or $worn.lower.type.includes("sleep")>>
		<<set _sleepTraitEffect += 5>>
	<</if>>
	<<if $robinbed is 1 or $kylarbed is 1 or $wolfbed is 1>>
		<<set _sleepTraitEffect += 5>>
	<</if>>
	<<for $_i to 0; $_i lt _equip.length; $_i++>>
		<<if $worn[_equip[$_i]].type.includes("naked") or $worn[_equip[$_i]].type.includes("sleep") or $worn[_equip[$_i]].type.includes("eerie")>>
			<<continue>>
		<</if>>
		<<set _sleepTraitEffect to 0>>
		<<break>>
	<</for>>
	<<for $sleephour gte 1 or $sleephour lte -1>><<set $sleephour -= 1>><<set $sleepStat++>>
		<<effectstime>>
		<<if $location is "asylum">>
			<<asylumeffects>>
		<</if>>
		<<if $robinromance is 1 and $NPCName[$NPCNameList.indexOf("Robin")].lust gte 20 and $robinbed isnot 1 and $location is "home" and $robinwakeday isnot 1 and $kylarbed isnot 1>>
			<<if $hour gte 18 or $hour lte 6>>
				<<set $schoolwake to 1>>
				<<set $NPCName[$NPCNameList.indexOf("Robin")].lovewake to 1>>
				<<set $robinwakeday to 1>>
			<</if>>
		<<elseif $NPCName[$NPCNameList.indexOf("Robin")].love gte 100 and $robindebtknown isnot 1 and $location is "home" and $kylarbed isnot 1>>
			<<if $hour gte 18 or $hour lte 6>>
				<<set $schoolwake to 1>>
				<<set $robindebtwake to 1>>
			<</if>>
		<<elseif $wraith and $wraith.state isnot "" and $wraith.nightmare is 1 and ($moonstate is "evening" and $hour gte 21 or $moonstate is "morning" and $hour lt 5)>>
			<<if $location is "home" or $location is "cabin" or $location is "wolf_cave" or ($location is "tower" and $bird and $bird.mirror is 1) or $location is "alex_cottage">>
				<<set $schoolwake to 1>>
				<<set $wraith.nightmare to 2>>
				<<set $sleepHoursTotal to 1>>
				<<if $sleeptrouble is 1 and $controlled is 0>>
					<<set $tiredness -= 200>>
				<<else>>
					<<set $tiredness -= 250>>
				<</if>>
				<<if _sleepTraitEffect>>
					<<set $tiredness -= _sleepTraitEffect>>
				<</if>>
				<<if $location isnot "tower">>
					<<pass 1 hour>>
				<<else>>
					<<bird_pass 60>>
				<</if>>
				<<if ($sleephour lte -1 and $tiredness lte 0) or $sleephour lte (-1 - 10)>>
					<<set $sleephour to 0>>
				<</if>>
				<<set $wraith.hunt to 0>>
				<<set $foresthunt to 0>>
			<</if>>
		<<elseif $baileydefeatedchain gte 1 and $location is "home" and ($rng * 100) gte (9900 - ($allure / 5))>>
			<<set $schoolwake to 1>>
			<<set $baileyrapewake to 1>>
		<<elseif $christmas is 1 and $monthday is 25 and $location is "home" and $hour lte 6 and $christmas_kylar is undefined and $NPCName[$NPCNameList.indexOf("Kylar")].state is "active">>
			<<set $schoolwake to 1>>
			<<set $christmas_kylar to 1>>
		<<elseif $hour is 6 and $location is "asylum" or $asylumstate is "firsttreatment" and $asylumfirsttreatment isnot 1 and $location is "asylum" or $asylumstate is "secondtreatment" and $asylumsecondtreatment isnot 1 and $location is "asylum" or $asylumstate is "assessment" and $asylumassessment isnot 1 and $location is "asylum">>
			<<set $schoolwake to 1>>
		<<elseif $location is "asylum" and $suspicion gte 80 and random(1, 10) gte 10>>
			<<set $schoolwake to 1>>
			<<set $rapewake to 1>>
		<<elseif $location is "prison" and $hour is 6>>
			<<set $schoolwake to 1>>
			<<set $prisonwake to 1>>
		<<elseif $location is "alex_cottage" and ($hour gte 21 or $hour lte 5) and $NPCName[$NPCNameList.indexOf("Alex")].lust gte 10 and $alexwake isnot 1>>
			<<set $alexwake to 1>>
			<<set $schoolwake to 1>>
		<<elseif $location is "alex_cottage" and $farm_attack_timer is 0 and $hour gte 21>>
			<<set $remywake to 1>>
			<<set $schoolwake to 1>>
		<<elseif $schoolday is 1 and $hour is 7 and $location is "home" and !$bailey_wake_day>>
			<<set $schoolwake to 1>>
			<<set $bailey_wake_day to true>>
		<<elseif $hour lte 6 and $location is "cabin" and $NPCName[$NPCNameList.indexOf("Eden")].lust gte 26 and $edenwake isnot 1>>
			<<set $edenwake to 1>>
			<<set $schoolwake to 1>>
		<<elseif $location is "forest" and $wolfpackferocity gte 10 and $wolfwake isnot 1>>
			<<set $schoolwake to 1>>
			<<set $wolfwake to 1>>
		<<elseif $location is "tower" and $bird.state is "hunting" and $bird.timer lte 0>>
			<<set $schoolwake to 1>>
		<<elseif $location is "tower" and $bird.state is "home" and $bird.satisfied isnot true and random(1, 10) is 10>>
			<<set $schoolwake to 1>>
		<<elseif $location is "home" and $corruption_slime gte ($willpower / 20) and random(0,100) lt 3 and $daystate is "night" and $slimeSleepEvent is 0 and $kylarbed isnot 1>>
			<<set $slimeWake to 1>>
			<<break>>
		<</if>>
		<<if $schoolwake isnot 1>>
			<<set $sleepHoursTotal += 1>>
			<<if $sleeptrouble is 1 and $controlled is 0>>
				<<set $tiredness -= 200>>
			<<else>>
				<<set $tiredness -= 250>>
			<</if>>
			<<if _sleepTraitEffect>>
				<<set $tiredness -= _sleepTraitEffect>>
			<</if>>
			<<if $location isnot "tower">>
				<<pass 1 hour>>
			<<else>>
				<<bird_pass 60>>
			<</if>>
			<<if $nightmares gte 1 and $controlled is 0>>
				<<stress 6>>
			<</if>>
			<<if ($sleephour lte -1 and $tiredness lte 0) or $sleephour lte (-1 - 10)>>
				<<set $sleephour to 0>>
			<</if>>
		<<else>>
			<<break>>
		<</if>>
	<</for>>
<</widget>>
<<widget "sleepeffects">>
	<<if $sleeptransform is 1>>
		<<if $wolfgirl is 0 and $wolfbuild gte 5>>
			<<set $wolfgirl to 1>>
			You have a strange toothache.

		<<elseif $wolfgirl is 1 and $wolfbuild gte 10>>
			<<set $wolfgirl to 2>>
			Your mouth feels different. You explore your mouth and wince as your tongue presses against your new fangs.

		<<elseif $wolfgirl is 1 and $wolfbuild lt 5>>
			<<set $wolfgirl to 0>>
			Your toothache has stopped.

		<<elseif $wolfgirl is 2 and $wolfbuild gte 15>>
			<<set $wolfgirl to 3>>
			Your scalp itches.

		<<elseif $wolfgirl is 2 and $wolfbuild lt 10>>
			<<set $wolfgirl to 1>>
			Your fangs have turned into regular teeth.

		<<elseif $wolfgirl is 3 and $wolfbuild gte 20>>
			<<set $wolfgirl to 4>>
			You feel something on your head. You reach up and tug, but it hurts. You have a new pair of wolf ears.

		<<elseif $wolfgirl is 3 and $wolfbuild lt 15>>
			<<set $wolfgirl to 2>>
			Your scalp no longer itches.

		<<elseif $wolfgirl is 4 and $wolfbuild gte 25>>
			<<set $wolfgirl to 5>>
			Your lower back itches.

		<<elseif $wolfgirl is 4 and $wolfbuild lte 20>>
			<<set $wolfgirl to 3>>
			Your wolf ears have disappeared.

		<<elseif $wolfgirl is 5 and $wolfbuild gte 30>>
			<<set $wolfgirl to 6>>
			You turn away from your bed and somehow knock your pillow to the floor. You reach behind you and feel your new wolf tail.

		<<elseif $wolfgirl is 5 and $wolfbuild lt 25>>
			<<set $wolfgirl to 4>>
			Your lower back has stopped itching.

		<<elseif $wolfgirl is 6 and $wolfbuild lt 30>>
			Your balance feels different. Your wolf tail has disappeared.
			<<set $wolfgirl to 5>>

		<</if>>
	<</if>>
	<<if $stress gte $stressmax>>
		<<set $stress -= 2000>>
		<<trauma 10>>
		Your stress level reached a peak while you slept and has since subsided, but at cost to your mental health.
		<<lstress>><<gtrauma>>

	<</if>>
	<<if $scienceproject is "ongoing" and $sciencephallusknown isnot 1 and $promiscuity gte 35>>
		<<set $sciencephallusknown to 1>>
		A lewd thought comes to you as you wake up. You've conceived the "local phalli" science project. Check your journal for details.

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

<<widget "bedclotheson">>
	<<switch $args[0]>>
		<<case "bed" "Bed">>
			<<set $_storeLocation to "bed">>
			<<set $wardrobe_location to "wardrobe">>
		<<case "Farm Bed">>
			<<set $_storeLocation to "Farm Bed">>
			<<set $wardrobe_location to "alexFarm">>
		<<case "prison bed">>
			<<set $_storeLocation to "prison bed">>
			<<set $wardrobe_location to "prison">>
		<<case "cult bed">>
			<<set $_storeLocation to "cult bed">>
			<<set $wardrobe_location to "Cult Wardrobe">>
		<<default>>
			Something went wrong with the "bedclotheson" widget, please report
			<<run console.log('Something went wrong with the "bedclotheson" widget, please report')>>
	<</switch>>
	<<wardrobeSelection true>>
	<<updateWornClothingLocation $wardrobe_location>>
	<<if $wear_outfit is "clotheson">>
		/*Was causing some wierdness when getting out of bed*/
		/*<<undress $wardrobe_location>>*/
		<<storeon $_storeLocation>>
	<<elseif $wear_outfit isnot "none">>
		<<storeon $_storeLocation>>
		<<undress $wardrobe_location>>
		<<wearoutfit>>
	<</if>>
	<<updateWornClothingLocation $wardrobe_location>>
	<<set $wear_outfit to "none">>
<</widget>>

<<widget "slimeNoSleep">>
	<<if $corruption_slime gte 80>>
		<<set _eventsList to ["have sex with someone or something", "only sleep naked from now on"]>>

		<<if $alwaysSleepNaked is true>>
			<<set _eventsList.delete("only sleep naked from now on")>>
		<</if>>
	<<else>>
		<<set _eventsList to ["have sex with someone", "go running or swimming for an hour"]>>
	<</if>>
	<<if $skulduggery gt 200>>
		<<set _eventsList.push("steal something")>>
	<</if>>
	<<if $exhibitionism gt 35>>
		<<set _eventsList.push("go running or swimming naked for an hour")>>
	<</if>>

	<<set _maxEvents to _eventsList.length - 1>>
	<<set $slimeEvent to _eventsList[random(0,_maxEvents)]>>

	You feel the slime in your head command you to <<print $slimeEvent>> before it allows you to sleep. It promises rewards if you comply, and threatens consequences if you do not.

	<<link [[Obey|SleepSlimeEventObey]]>><<corruption 1>><<pain -4>><<stress -6>><<trauma -12>><<set $submissive += 1>><</link>><<gcorruption>><<lpain>><<lltrauma>><<lstress>>

	<<link [[Defy|SleepSlimeEventDefy]]>><<corruption -1>><<pain 8>><<stress 6>><<trauma 6>><<set $submissive -= 1>><</link>><<lcorruption>><<ggpain>><<ggtrauma>><<ggstress>>

<</widget>>

<<widget "slimeEventResult">>
	<<if $slimeEvent is "go running or swimming naked for an hour" or "go running or swimming for an hour">>
		<<set $slimeEventLength to 2>>
	<</if>>
	<<if $slimeEvent is "only sleep naked from now on">>
		<<strip>>
		<<set $alwaysSleepNaked to true>>
		<<unset $slimeEvent>>
		You strip before getting into bed.

		<<link [[Next|Bed]]>><</link>>
	<<else>>
		You move away from your bed to do the task given to you.

		<<link [[Next|Bedroom]]>><</link>>
	<</if>>
<</widget>>

<<widget "slimeEventEnd">>
<<switch $slimeEvent>>
	<<case "go running or swimming naked for an hour">>
		<<if $slimeEventLength is 1 and $exposed is 2>>
			<<unset $slimeEvent>>
			<<unset $slimeEventLength>>
		<<elseif $exposed is 2>>
			<<set $slimeEventLength -= 1>>
		<</if>>
	<<case "go running or swimming for an hour">>
		<<if $slimeEventLength is 1>>
			<<unset $slimeEvent>>
			<<unset $slimeEventLength>>
		<<else>>
			<<set $slimeEventLength -= 1>>
		<</if>>
	<<default>>
		<<unset $slimeEvent>>
<</switch>>
<</widget>>

:: SleepSlimeEventObey
	You obey the slime's demand.
	<<slimeEventResult>>

:: SleepSlimeEventDefy
<<if $corruption_slime gte ($willpower / 10)>>
	The slime is able to force you to comply with its demand.
	<<slimeEventResult>>

<<else>>
	You are able to defy what the slime is demanding and get into bed without listening any further.
	<<unset $slimeEvent>>

	<<link [[Next|Bed]]>><</link>>
<</if>>