code:
:: Nude Masturbation

<<effects>>
<<if $masturbationstart is 1>>
	<<set $masturbationstart to 0>>
	<<set $masturbationstat += 1>>
	<<masturbationstart>>
	<<set $timer to $rng>>
<</if>>
<<masturbationeffects>>
<<masturbationactions>>
<<if $timer is 1>>
	<<link [[Continue|Nude Cat]]>><</link>><<nexttext>>

	<<link [[Stop|Nude Masturbation Finish]]>><<set $finish to 1>><</link>>
<<else>>
	<<link [[Continue|Nude Masturbation]]>><</link>><<nexttext>>

	<<if $corruptionMasturbation isnot true and random(0,3) gt $orgasmcurrent and $corruption_slime gt ($willpower / 10)>>
		<<link [[Stop|$passage]]>><<set $corruptionMasturbation to true>><</link>>
	<<elseif $corruptionMasturbation isnot true>>
		<<link [[Stop|Nude Masturbation Finish]]>><<set $finish to 1>><</link>>
	<<else>>
		The slime in your ear will not allow you to stop.
	<</if>>
<</if>>

:: Nude Masturbation Finish

<<effects>>
You lie back on the grass, panting.

<<endmasturbation>>
<<endcombat>>
<<link [[Next|Nude Bask]]>><</link>>

:: Bath Masturbation

<<effects>>
<<if $masturbationstart is 1>>
	<<set $masturbationstart to 0>>
	<<set $masturbationstat += 1>>
	<<masturbationstart>>
<</if>>
<<masturbationeffects>>
<<masturbationactions>>
<<link [[Continue|Bath Masturbation]]>><</link>><<nexttext>>

<<if $corruptionMasturbation isnot true and random(0,3) gt $orgasmcurrent and $corruption_slime gt ($willpower / 10)>>
	<<link [[Stop|$passage]]>><<set $corruptionMasturbation to true>><</link>>
<<elseif $corruptionMasturbation isnot true>>
	<<link [[Stop|Bath Masturbation Finish]]>><<set $finish to 1>><</link>>
<<else>>
	The slime in your ear will not allow you to stop.
<</if>>

:: Bath Masturbation Finish

<<effects>>
Doing this here means you can wash away the evidence.<<wash>>

<<endmasturbation>>
<<endcombat>>

<<wash>>You climb from the bath.

<<link [[Next|Bath Finish]]>><</link>>

:: Men's Toilets Masturbation
<<effects>>

<<if $masturbationstart is 1>>
	<<set $masturbationstart to 0>>
	<<set $masturbationstat += 1>>
	<<masturbationstart>>
	You feel safer doing this here than at the orphanage. Bailey isn't going to be barging the door down.

<</if>>

<<masturbationeffects>>
<<masturbationactions>>

<<link [[Continue|Men's Toilets Masturbation]]>><</link>><<nexttext>>

<<if $corruptionMasturbation isnot true and random(0,3) gt $orgasmcurrent and $corruption_slime gt ($willpower / 10)>>
	<<link [[Stop|$passage]]>><<set $corruptionMasturbation to true>><</link>>
<<elseif $corruptionMasturbation isnot true>>
	<<link [[Stop|Men's Toilets Masturbation Finish]]>><<set $finish to 1>><</link>>
<<else>>
	The slime in your ear will not allow you to stop.
<</if>>

:: Men's Toilets Masturbation Finish
<<effects>>

<<if $worn.genitals.type.includes("chastity")>>
	You try to keep the noise down as you are afraid of being caught.

<</if>>

<<endmasturbation>>
<<clotheson>>
<<endcombat>>

<<link [[Next|Men's Toilets]]>><</link>>

:: Women's Toilets Masturbation
<<effects>>

<<if $masturbationstart is 1>>
	<<set $masturbationstart to 0>>
	<<set $masturbationstat += 1>>
	<<masturbationstart>>
	You feel safer doing this here than at the orphanage. Bailey isn't going to be barging the door down.

<</if>>

<<masturbationeffects>>
<<masturbationactions>>

<<link [[Continue|Women's Toilets Masturbation]]>><</link>><<nexttext>>

<<if $corruptionMasturbation isnot true and random(0,3) gt $orgasmcurrent and $corruption_slime gt ($willpower / 10)>>
	<<link [[Stop|$passage]]>><<set $corruptionMasturbation to true>><</link>>
<<elseif $corruptionMasturbation isnot true>>
	<<link [[Stop|Women's Toilets Masturbation Finish]]>><<set $finish to 1>><</link>>
<<else>>
	The slime in your ear will not allow you to stop.
<</if>>

:: Women's Toilets Masturbation Finish
<<effects>>

<<if $worn.genitals.type.includes("chastity")>>
	You try to keep the noise down as you are afraid of being caught.

<</if>>

<<endmasturbation>>
<<clotheson>>
<<endcombat>>

<<link [[Next|Women's Toilets]]>><</link>>

:: School Boy's Toilets Masturbation
<<effects>>

<<if $masturbationstart is 1>>
	<<set $masturbationstart to 0>>
	<<set $masturbationstat += 1>>
	<<masturbationstart>>
	You wonder what the other students would think of you if you were caught.

<</if>>

<<masturbationeffects>>
<<masturbationactions>>

<<link [[Continue|School Boy's Toilets Masturbation]]>><</link>><<nexttext>>

<<if $corruptionMasturbation isnot true and random(0,3) gt $orgasmcurrent and $corruption_slime gt ($willpower / 10)>>
	<<link [[Stop|$passage]]>><<set $corruptionMasturbation to true>><</link>>
<<elseif $corruptionMasturbation isnot true>>
	<<link [[Stop|School Boy's Toilets Masturbation Finish]]>><<set $finish to 1>><</link>>
<<else>>
	The slime in your ear will not allow you to stop.
<</if>>

:: School Boy's Toilets Masturbation Finish
<<effects>>

You listen out in case anyone snuck in while you were distracted. You don't hear anything.

<<endmasturbation>>
<<clotheson>>
<<endcombat>>

<<link [[Next|School Boy's Toilets]]>><</link>>

:: School Girl's Toilets Masturbation
<<effects>>

<<if $masturbationstart is 1>>
	<<set $masturbationstart to 0>>
	<<set $masturbationstat += 1>>
	<<masturbationstart>>
	You wonder what the other students would think of you if you were caught.

<</if>>

<<masturbationeffects>>
<<masturbationactions>>

<<link [[Continue|School Girl's Toilets Masturbation]]>><</link>><<nexttext>>

<<if $corruptionMasturbation isnot true and random(0,3) gt $orgasmcurrent and $corruption_slime gt ($willpower / 10)>>
	<<link [[Stop|$passage]]>><<set $corruptionMasturbation to true>><</link>>
<<elseif $corruptionMasturbation isnot true>>
	<<link [[Stop|School Girl's Toilets Masturbation Finish]]>><<set $finish to 1>><</link>>
<<else>>
	The slime in your ear will not allow you to stop.
<</if>>

:: School Girl's Toilets Masturbation Finish
<<effects>>

You listen out in case anyone snuck in while you were distracted. You don't hear anything.

<<endmasturbation>>
<<clotheson>>
<<endcombat>>

<<link [[Next|School Girl's Toilets]]>><</link>>

:: Clearing Spring Masturbation
<<effects>>

<<if $masturbationstart is 1>>
	<<set $masturbationstart to 0>>
	<<set $masturbationstat += 1>>
	<<masturbationstart>>
	You lie back and allow your hands to wander.

<</if>>

<<set $danger to random(1, 10000)>><<set $dangerevent to 0>>

<<if $edenpush is 1>>
	<<masturbationeffects>>
	<<masturbationactions>>

	<<link [[Continue|Clearing Spring Masturbation]]>><</link>><<nexttext>>

	<<if $corruptionMasturbation isnot true and random(0,3) gt $orgasmcurrent and $corruption_slime gt ($willpower / 10)>>
		<<link [[Stop|$passage]]>><<set $corruptionMasturbation to true>><</link>>
	<<elseif $corruptionMasturbation isnot true>>
		<<link [[Stop|Clearing Spring Masturbation Finish]]>><<set $finish to 1>><</link>>
	<<else>>
		The slime in your ear will not allow you to stop.

	<</if>>

<<elseif !$edenpush and $danger gte (9900 - $allure) and (($hour gt 6 and $hour lt 11) or $hour gt 14)>>

	<<npc Eden>><<person1>>Out of nowhere, you feel your hands being grabbed by someone else's.

	<<if $NPCName[$NPCNameList.indexOf("Eden")].dom gte 75>>
		Let me," Eden says, as <<he>> guides your arms out of the way and
		<<if $player.penisExist>>
			grabs your <<penis>> in <<his>> hand.
		<<elseif $player.vaginaExist>>
			rubs <<his>> fingers over your <<clit>>.
		<</if>>
	<<else>>
		"Let me," Eden says, as <<he>> guides your arms out of the way and slides <<his>> hand up your thigh.
	<</if>>

	<<link [[Push away|Clearing Spring Masturbation Push]]>><<npcincr Eden love -1>><<npcincr Eden dom -1>><</link>>

	<<link [[Lean into Eden|Clearing Spring Masturbation Sex]]>><<set $sexstart to 1>><<npcincr Eden love 1>><<npcincr Eden dom 1>><</link>><<promiscuous1>>

<<else>>

	<<masturbationeffects>>
	<<masturbationactions>>

	<<link [[Continue|Clearing Spring Masturbation]]>><</link>><<nexttext>>

	<<if $corruptionMasturbation isnot true and random(0,3) gt $orgasmcurrent and $corruption_slime gt ($willpower / 10)>>
		<<link [[Stop|$passage]]>><<set $corruptionMasturbation to true>><</link>>
	<<elseif $corruptionMasturbation isnot true>>
		<<link [[Stop|Clearing Spring Masturbation Finish]]>><<set $finish to 1>><</link>>
	<<else>>
		The slime in your ear will not allow you to stop.
	<</if>>
<</if>>

:: Clearing Spring Masturbation Push
<<effects>>
<<set $edenpush to 1>>
<<npc Eden>><<person1>> You gently push Eden away from you. <<He>> raises <<his>> eyebrows and shoots you an incredulous look, before shrugging and walking away from the spring.

<<link [[Continue|Clearing Spring Masturbation]]>><</link>><<nexttext>>

<<if $corruptionMasturbation isnot true and random(0,3) gt $orgasmcurrent and $corruption_slime gt ($willpower / 10)>>
	<<link [[Stop|$passage]]>><<set $corruptionMasturbation to true>><</link>>
<<elseif $corruptionMasturbation isnot true>>
	<<link [[Stop|Clearing Spring Masturbation Finish]]>><<set $finish to 1>><</link>>
<<else>>
	The slime in your ear will not allow you to stop.
<</if>>

:: Clearing Spring Masturbation Finish
<<effects>>

The gentle waters caress you as you open your eyes.

<<endmasturbation>>
<<clotheson>>
<<endcombat>>

<<link [[Stay in the spring (0:30)|Clearing Spring]]>><<endevent>><<pass 30>><<stress -6>><<set $phase to 1>><</link>><<lstress>>

<<link [[Get out|Eden Clearing]]>><<clotheson>><</link>>

:: Maths Lesson Masturbate
<<effects>>

<<if $masturbationstart is 1>>
	<<set $masturbationstart to 0>>
	<<set $masturbationstat += 1>>

	You want to touch yourself, here in the middle of your maths lesson. You look around. Everyone's distracted.
	<<if $whitneymaths is "seat">>
		Only Whitney would notice.<<exhibitionism5>>
	<<else>>
		No one would notice.<<exhibitionism4>>
	<</if>>

	<<masturbationstart>>
	<<set $timer to 20>>
	<<set $mouth to "disabled">>
<</if>>

<<if $whitneymaths is "seat">>
	You fondle yourself. Whitney watches with a smirk, interested in seeing how far you go.<<garousal>><<genitalarousal 100>>
<<else>>
	You fondle yourself. The other students are so near, they could so easily see what you're doing.<<garousal>><<genitalarousal 100>>
<</if>>

<<masturbationeffects>>
<<masturbationactions>>

<<if $timer lte 0>>
	<<link [[Continue|Maths Lesson Masturbate Finish]]>><</link>><<nexttext>>

<<else>>
	<<link [[Continue|Maths Lesson Masturbate]]>><</link>><<nexttext>>

<</if>>
<<if $corruptionMasturbation isnot true and random(0,3) gt $orgasmcurrent and $corruption_slime gt ($willpower / 10)>>
	<<link [[Stop|$passage]]>><<set $corruptionMasturbation to true>><</link>>
<<elseif $corruptionMasturbation isnot true>>
	<<link [[Stop|Maths Lesson Masturbate Finish]]>><<set $finish to 1>><</link>>
<<else>>
	The slime in your ear will not allow you to stop.
<</if>>

:: Maths Lesson Masturbate Finish
<<set $outside to 0>><<set $location to "school">><<effects>>

<<if $timer lte 0 and $orgasmdown gte 1>>
	<<npc River>><<person1>>You hear River marching towards you mid-climax! You try to rearrange your clothing and sit upright, but you can't stop the spasms. When <<he>> realises what you're doing, <<his>> eyes widen and face drains of colour. "You... D-Deten..." <<His>> eyes roll backwards and <<he>> crumples into a heap.
	<<gdelinquency>><<detention 6>>

	<<endmasturbation>>
	<<endcombat>>

	<<if $whitneymaths is "seat">>
		<<npc Whitney>><<person1>>
		"Fucking nice," Whitney says, grabbing your arm and pushing you over the desk. Unsure what just happened, the rest of the class watch as Whitney climbs on top of you.

		<<link [[Next|Maths Whitney Sex]]>><<set $sexstart to 1>><</link>>

	<<else>>
		<<if $promiscuity gte 75>>
			<<link [[Goad the class into a gang bang|Maths Lesson Gang Bang]]>><<endevent>><<set $sexstart to 1>><</link>><<promiscuous5>>

		<</if>>
		<<link [[Feign innocence|Maths Lesson Feign]]>><<clotheson>><<endevent>><</link>>

	<</if>>

<<else>>
	<<if $timer lte 0>>
		You hear River marching towards you! You quickly rearrange your clothing and sit upright. River stops beside you. "You're looking rather flushed," the teacher says. "You should see the nurse after class." You exhale as River walks away.

		<<if $whitneymaths is "seat">>
			"Don't worry," Whitney grins. "Your secret's safe with me, <<slut>>."
		<</if>>
	<<else>>
		Not wanting to risk it further, you rearrange your clothing and sit upright. You don't think anyone noticed.

	<</if>>

	<<endmasturbation>>
	<<clotheson>>
	<<endcombat>>
	<<towelup>>
	Touching yourself in front of so many unaware people feels fantastic. It takes a while for your racing heart and flushed face to return to normal.

	<<advancelesson>>

	<<if $phase is 1>>
		<<set $phase to 0>>
		The bell rings, signifying the end of the lesson. You leave the classroom.

		<<link [[Next|Hallways]]>><</link>>
	<<else>>
		<<set $danger to random(1, 10000)>><<set $dangerevent to 0>>
		<<if $danger gte (8900 - $allure)>>
			<<eventsmaths>>
		<<else>>
			<<eventsmathssafe>>
		<</if>>
	<</if>>
<</if>>

:: Science Lesson Masturbate

<<effects>>

<<if $masturbationstart is 1>>
	<<set $masturbationstart to 0>>
	<<set $masturbationstat += 1>>

	You want to touch yourself, here in the middle of your science lesson. You look around. Everyone's distracted. No one would notice.
	<<exhibitionism4>>

	<<masturbationstart>>
	<<set $timer to 20>>
	<<set $mouth to "disabled">>
<</if>>

You fondle yourself. The other students are so near, they could so easily see what you're doing.
<<garousal>><<genitalarousal 100>>

<<masturbationeffects>>
<<masturbationactions>>

<<if $timer lte 0>>
	<<link [[Continue|Science Lesson Masturbate Finish]]>><</link>><<nexttext>>
<<else>>
	<<link [[Continue|Science Lesson Masturbate]]>><</link>><<nexttext>>
<</if>>

<<if $corruptionMasturbation isnot true and random(0,3) gt $orgasmcurrent and $corruption_slime gt ($willpower / 10)>>
	<<link [[Stop|$passage]]>><<set $corruptionMasturbation to true>><</link>>
<<elseif $corruptionMasturbation isnot true>>
	<<link [[Stop|Science Lesson Masturbate Finish]]>><<set $finish to 1>><</link>>
<<else>>
	The slime in your ear will not allow you to stop.
<</if>>

:: Science Lesson Masturbate Finish
<<set $outside to 0>><<set $location to "school">><<effects>>

<<if $timer lte 0 and $orgasmdown gte 1>>
	A loud bang sounds right behind you, mid-climax. Someone mixed something they shouldn't have, and it's drawing attention your way. You try to rearrange your clothing and act natural, but you can't stop the spasms. You find yourself the centre of attention, with everyone wondering what's wrong with you.

	<<npc Sirris>><<person1>>Sirris rushes over to you, completely unaware of what you were doing. <<He>> looks at the <<generates2>><<person2>><<person>> behind you. "What were you mixing? Did you get any on <<phim>> or anything?" <<person1>><<he>> says. "Answer me!"

	<<person2>>The <<person>> stares at Sirris, mouth agape. <<person1>>"Everyone, listen," the teacher says. "Your classmate may have something dangerous on <<phim>>. You, get the hose ready. Quick! I'm going to strip <<phim>>, then we need to wash <<phim>> down before the chemicals do any more damage!"

	You try to protest, but the thought of being stripped renews your orgasm, sending you into another twitching fit. Sirris tugs your $worn.upper.name, pulling it up your chest and off your body. The class watches, astounded by the spectacle. Some are clearly eyeing up your <<breasts>>.

	Sirris goes for your $worn.lower.name next, revealing your <<undies>> to the whole room.
	<<if $worn.under_lower.type.includes("naked")>>
		The class gasp as you're exposed in front of them.
	<<elseif $worn.genitals.type.includes("chastity")>>
		<<He>> looks at your $worn.under_lower.name in bewilderment. "What is this?" <<he>> tugs. "It won't come off. There's no time, we'll make do."
	<<else>>
		<<He>> doesn't waste time and tugs your $worn.under_lower.name down your thighs. The class gasp as your <<genitals_are>> exposed to them.
	<</if>>
	<<upperruined>><<lowerruined>><<underruined>><<exposure>>
	<<covered>>

	"Done. Now the hose. Everyone stand back." <<He>> blasts you with cold water, knocking you off your seat. "I said stand back!" <<He>> continues to hose you down as the class watches, those at the back craning their necks to see.

	<<wash>>

	"Turn off the hose please," <<he>> says at last. The hose ceases its discharge and Sirris kneels beside you. <<He>> covers you with towels. "How are you feeling?" You can't find the words.
	<<gtrauma>><<gstress>><<trauma 6>><<stress 6>><<gpain>><<set $pain += 20>>

	<<link [[Next|Science Lesson Masturbate Hose]]>><</link>>

<<else>>
	<<if $timer lte 0>>
		A loud bang sounds right behind you. Someone mixed something they shouldn't have, and it's drawing attention your way. You quickly rearrange your clothing and hope your flushed and dishevelled look is put down to shock.
	<<else>>
		Not wanting to risk it further, you rearrange your clothing and sit upright. You don't think anyone noticed.
	<</if>>

	<<endmasturbation>>
	<<clotheson>>
	<<endcombat>>

	<<towelup>>

	Touching yourself in front of so many unaware people feels fantastic. It takes a while for your racing heart and flushed face to return to normal.

	<<advancelesson>>

	<<if $phase is 1>>
		<<set $phase to 0>>
		The bell rings, signifying the end of the lesson. You leave the classroom.

		<<link [[Next|Hallways]]>><</link>>
	<<else>>
		<<set $danger to random(1, 10000)>><<set $dangerevent to 0>>
		<<if $danger gte (8900 - $allure)>>
			<<eventsscience>>
		<<else>>
			<<eventssciencesafe>>
		<</if>>
	<</if>>
<</if>>

:: English Lesson Masturbate
<<effects>>

<<if $masturbationstart is 1>>
	<<set $masturbationstart to 0>>
	<<set $masturbationstat += 1>>

	<<if $kylarenglishstate is "active">>
		You want to touch yourself, here in the middle of your English lesson. You look around. Everyone's distracted. No one would notice. Except Kylar.
		<<exhibitionism5>>
	<<else>>
		You want to touch yourself, here in the middle of your English lesson. You look around. Everyone's distracted. No one would notice.
		<<exhibitionism4>>
	<</if>>

	<<masturbationstart>>
	<<set $timer to 20>>
	<<set $mouth to "disabled">>
<</if>>

<<if $kylarenglishstate is "active">>
	You fondle yourself. The other students are so near, they could so easily see what you're doing. Kylar watches, completely enthralled.
	<<garousal>><<genitalarousal 100>>
<<else>>
	You fondle yourself. The other students are so near, they could so easily see what you're doing.
	<<garousal>><<genitalarousal 100>>
<</if>>

<<if $orgasmdown gte 1 and $kylarenglishstate is "active">>
	Kylar watches your climax with awe.
	<<glust>><<npcincr Kylar lust 5>>
<</if>>

<<masturbationeffects>>
<<masturbationactions>>

<<if $timer lte 0>>
	<<link [[Continue|English Lesson Masturbate Finish]]>><</link>><<nexttext>>

<<else>>
	<<link [[Continue|English Lesson Masturbate]]>><</link>><<nexttext>>

<</if>>

<<if $corruptionMasturbation isnot true and random(0,3) gt $orgasmcurrent and $corruption_slime gt ($willpower / 10)>>
	<<link [[Stop|$passage]]>><<set $corruptionMasturbation to true>><</link>>
<<elseif $corruptionMasturbation isnot true>>
	<<link [[Stop|English Lesson Masturbate Finish]]>><<set $finish to 1>><</link>>
<<else>>
	The slime in your ear will not allow you to stop.
<</if>>

:: English Lesson Masturbate Finish
<<set $outside to 0>>
<<set $location to "school">>
<<effects>>

<<if $kylarenglishstate is "active" and $worn.under_lower.exposed gte 1 and $worn.lower.exposed gte 2 and $worn.genitals.type.includes("hidden")>>
	<<set $genderknown.pushUnique("Kylar")>>
<</if>>

<<if $timer lte 0 and $orgasmdown gte 1>>

	<<if $kylarenglishstate is "active">>
		<<npc Kylar>><<generates2>><<person2>>A <<person>> leans over your desk to chat across the room. You try to stop touching yourself, but you can't control your spasms. <<He>> sees what you're doing. <<His>> mouth gapes for a moment, then <<he>> smiles. "Wow, you're a real pervert," <<he>> whispers. "I should let everyone know. Unless," <<He>> shunts <<his>> desk closer to yours. "Unless you-"

		<<Hes>> interrupted. Kylar lunges over your desk and drags <<him>> to the ground. <<person1>><<He>> straddles the <<person2>><<person>>, with one hand around <<his>> throat and the other clutching a knife. Someone screams.

		"<<pShes>> mine," Kylar says, moving the knife closer to the <<persons>> face. "Mine."

		Doren leaps over the table and grabs Kylar by the waist and wrist, hauling <<person1>><<him>> off the <<person2>><<person>>. <<person1>><<He>> is pulled backwards towards the exit. <<person1>><<He>> doesn't struggle.

		The <<person2>><<person>> whimpers on the floor. <<His>> friends form a protective ring and shoot you evil looks. The rest of the class whisper amongst themselves until Doren's return. Kylar isn't with <<endevent>><<npc Doren>><<person1>><<him>>.
		<<set $kylarenglishstate to "absent">>
		<<clotheson>>
		<<endmasturbation>>
		<<endcombat>>

		<<link [[Next|English Lesson Daydream]]>><</link>>

	<<else>>

		<<generates1>><<person1>>A <<person>> leans over your desk to chat across the room. You try to stop touching yourself, but you can't control your spasms. <<He>> sees what you're doing. <<His>> mouth gapes for a moment, then <<he>> smiles. "Wow, you're a real pervert," <<he>> whispers. "I should let everyone know. Unless," <<He>> shunts <<his>> desk closer to yours. "Unless you wanna be nice to me." <<He>> grabs your wrist and places your hand on <<his>> crotch.

		<<link [[Rub|English Rub]]>><<trauma 6>><<stress 6>><<set $submissive += 1>><</link>><<gtrauma>><<gstress>>

		<<if $promiscuity gte 55>>
			<<link [[Punish|English Punish]]>><<set $submissive -= 1>><</link>><<promiscuous4>>

		<</if>>
		<<link [[Refuse|English Rub Refuse]]>><<trauma 6>><<stress 6>><<detention 3>><<status -10>><</link>><<lcool>><<gdelinquency>><<gtrauma>><<gstress>>

	<</if>>
<<else>>

	<<if $timer lte 0>>
		Another student leans over your desk and starts chatting across the room. You cover yourself and look away. You hope no one noticed.
		<<if $kylarenglishstate is "active">>
			"Y-you're so lewd," Kylar gulps. "And brave."
		<</if>>
	<<else>>
		<<if $kylarenglishstate is "active">>
			Not wanting to risk it further, you rearrange your clothing and sit upright. "Y-you're so lewd," Kylar gulps. "And brave."
		<<else>>
			Not wanting to risk it further, you rearrange your clothing and sit upright. You don't think anyone noticed.
		<</if>>
	<</if>>

	<<endmasturbation>>
	<<clotheson>>
	<<endcombat>>

	<<towelup>>

	Touching yourself in front of so many unaware people feels fantastic. It takes a while for your racing heart and flushed face to return to normal.

	<<advancelesson>>

	<<if $phase is 1>>
		<<set $phase to 0>>
		The bell rings, signifying the end of the lesson. You leave the classroom.

		<<link [[Next|Hallways]]>><</link>>
	<<else>>
		<<set $danger to random(1, 10000)>><<set $dangerevent to 0>>
		<<if $danger gte (8900 - $allure)>>
			<<eventsenglish>>
		<<else>>
			<<eventsenglishsafe>>
		<</if>>
	<</if>>
<</if>>

:: History Lesson Masturbate Robin
<<effects>>

You fondle yourself. Robin glances at you, then swats your hands away from your body. "You can't do that here." <<nnpc_he Robin>> says, <<nnpc_his Robin>> voice stern. "Only in private". <<nnpc_He Robin>> looks back to the front of the class.

<<nnpc_He Robin>> attracted too much attention. You won't be able to get away with it now.

<<link [[Next|History Lesson Daydream]]>><</link>>

:: History Lesson Masturbate
<<effects>>

<<if $masturbationstart is 1>>
	<<set $masturbationstart to 0>>
	<<set $masturbationstat += 1>>

	You want to touch yourself, here in the middle of your history lesson. You look around. Everyone's distracted. No one would notice.
	<<if $robinhistory is "seat">>
		Except for Robin.
		<<exhibitionism5>>
	<<else>>
		<<exhibitionism4>>
	<</if>>

	<<masturbationstart>>
	<<set $timer to 20>>
	<<set $mouth to "disabled">>
<</if>>

You continue to fondle yourself.

<<if $robinhistory is "seat">>
	<<if $timer is 20>>
		Robin glances at you, and blushes as <<nnpc_he Robin>> realises what you're up to. "You can't do that here!" <<nnpc_he Robin>> says.

		"Eye's front," Winter interjects. Robin jolts upright, startled.
	<<elseif $rng gte 67>>
		Robin keeps a close eye on Winter.
	<<elseif $rng gte 33>>
		<<if $robinromance is 1>>
			Robin can't keep <<nnpc_his Robin>> eyes away.
		<<else>>
			Robin tries to keep <<nnpc_his Robin>> gaze away from you, but does a poor job.
		<</if>>
	<<else>>
		Robin blushes beside you.
	<</if>>
	<<if $orgasmdown gte 1>>
		<<glust>><<npcincr Robin lust 1>>
	<</if>>
<</if>>

The other students are so near, they could so easily see what you're doing.
<<garousal>><<genitalarousal 100>>

<<masturbationeffects>>
<<masturbationactions>>

<<if $timer lte 0>>
	<<link [[Continue|History Lesson Masturbate Finish]]>><</link>><<nexttext>>
<<else>>
	<<link [[Continue|History Lesson Masturbate]]>><</link>><<nexttext>>
<</if>>

<<if $corruptionMasturbation isnot true and random(0,3) gt $orgasmcurrent and $corruption_slime gt ($willpower / 10)>>
	<<link [[Stop|$passage]]>><<set $corruptionMasturbation to true>><</link>>
<<elseif $corruptionMasturbation isnot true>>
	<<link [[Stop|History Lesson Masturbate Finish]]>><<set $finish to 1>><</link>>
<<else>>
	The slime in your ear will not allow you to stop.
<</if>>

:: History Lesson Masturbate Finish
<<set $outside to 0>><<set $location to "school">><<effects>>

<<if $timer lte 0 and $orgasmdown gte 1>>
	<<npc Winter>><<person1>>Winter decides to stand by your desk while lecturing, right in the middle of your orgasm. <<He>> stands with <<his>> back to you. You don't think anyone noticed.

	<<endmasturbation>>
	<<clotheson>>
	<<endcombat>>

	<<npc Winter>><<person1>>Once your orgasm has subsided Winter turns and leans close. "So you like touching yourself," <<he>> whispers. "I know just what to do with dirty <<girls>> like you. Come with me."

	<<He>> stands upright. "Turn to page 117 please," <<he>> announces to the class. "I shan't be long." You follow <<him>> from the classroom, and into a storage room. It contains various antiques and props that you recognise from <<his>> lessons. <<He>> reaches into a wooden box and produces a metal chastity <<if $player.penisExist>>cage<<else>>belt<</if>>.

	"Strip," <<he>> commands. <<He>> blows dust off the device. "You clearly can't control yourself. This is for your own good."

	<<link [[Strip|History Masturbate Strip]]>><<set $submissive += 1>><<trauma 6>><<stress 6>><</link>><<gtrauma>><<gstress>>

	<<link [[Refuse|History Masturbate Refuse]]>><<set $submissive -= 1>><<detention 3>><</link>><<gdelinquency>>

<<else>>
	<<if $timer lte 0>>
		Winter decides to stand by your desk while lecturing. You almost decide to continue and hope no one is paying attention, but you think better of it.
	<<else>>
		Not wanting to risk it further, you rearrange your clothing and sit upright. You don't think anyone noticed.
	<</if>>
	<<if $robinhistory is "seat">>
		Robin looks relieved.
	<</if>>

	<<endmasturbation>>
	<<clotheson>>
	<<endcombat>>

	<<towelup>>

	Touching yourself in front of so many unaware people feels fantastic. It takes a while for your racing heart and flushed face to return to normal.

	<<advancelesson>>

	<<if $phase is 1>>
		<<set $phase to 0>>
		The bell rings, signifying the end of the lesson. You leave the classroom.

		<<link [[Next|Hallways]]>><</link>>
	<<else>>
		<<set $danger to random(1, 10000)>><<set $dangerevent to 0>>
		<<if $danger gte (8900 - $allure)>>
			<<eventshistory>>
		<<else>>
			<<eventshistorysafe>>
		<</if>>
	<</if>>
<</if>>

:: Swimming Lesson Masturbate
<<effects>>

<<if $masturbationstart is 1>>
	<<set $masturbationstart to 0>>
	<<set $masturbationstat += 1>>

	You want to touch yourself, here in the middle of the pool. You look around. Everyone's distracted. No one would notice what you're up to beneath the water.
	<<exhibitionism4>>

	<<masturbationstart>>
	<<set $timer to 20>>
	<<set $mouth to "disabled">>
<</if>>

You fondle yourself. The other students are so near, they could so easily see what you're doing.
<<garousal>><<genitalarousal 100>>

<<masturbationeffects>>
<<masturbationactions>>

<<if $timer lte 0>>
	<<link [[Continue|Swimming Lesson Masturbate Finish]]>><</link>><<nexttext>>
<<else>>
	<<link [[Continue|Swimming Lesson Masturbate]]>><</link>><<nexttext>>
<</if>>

<<if $corruptionMasturbation isnot true and random(0,3) gt $orgasmcurrent and $corruption_slime gt ($willpower / 10)>>
	<<link [[Stop|$passage]]>><<set $corruptionMasturbation to true>><</link>>
<<elseif $corruptionMasturbation isnot true>>
	<<link [[Stop|Swimming Lesson Masturbate Finish]]>><<set $finish to 1>><</link>>
<<else>>
	The slime in your ear will not allow you to stop.
<</if>>

:: Swimming Lesson Masturbate Finish
<<set $outside to 0>><<set $location to "pool">><<effects>>

<<if $timer lte 0 and $orgasmdown gte 1>>
	<<npc Mason>><<person1>>Mason asks the class to line up at one side of the pool. You're still shaking from your climax and struggle to keep up.

	<<clotheson>>

	Mason spots you shivering in the water. <<He>> dives in and shoots towards you, scooping you into <<his>> arms and onto the side of the pool. <<He>> clambers up after you and leans close. "Are you alright?" <<he>> asks.

	<<link [[Nod|Swimming Masturbate Nod]]>><</link>>

	<<if $promiscuity gte 15>>
		<<link [[Kiss|Swimming Masturbate Kiss]]>><<status 1>><<detention 2>><</link>><<promiscuous2>><<gdelinquency>><<gcool>>

	<</if>>
<<else>>
	<<if $timer lte 0>>
		Mason asks the class to line up at one side of the pool. You won't continue to get away with it while packed so close to the other students.
	<<else>>
		Not wanting to risk it further, you stop. You don't think anyone noticed.
	<</if>>

	<<endmasturbation>>
	<<clotheson>>
	<<endcombat>>

	Touching yourself in front of so many unaware people feels fantastic. It takes a while for your racing heart and flushed face to return to normal.

	<<water>>
	<<advancelesson>>

	<<if $phase is 1>>
		<<set $phase to 0>>
		The bell rings, signifying the end of the lesson. You leave the classroom.

		<<if $exposed lte 0>>
			<<maleicon>><<link [[Boys' changing room|School Boy Changing Room]]>><</link>>

			<<femaleicon>><<link [[Girls' changing room|School Girl Changing Room]]>><</link>>

		<<elseif $exposed gte 1>>
			<<link [[Grab some towels and enter the boys' changing room|School Boy Changing Room]]>><<towelupm>><</link>>

			<<link [[Grab some towels and enter the girls' changing room|School Girl Changing Room]]>><<towelup>><</link>>

		<</if>>
	<<else>>
		<<if $exposed gte 1>>
			<<set $danger to random(1, 10000)>><<set $dangerevent to 0>>
			<<if $danger gte (8900 - ($allure / 2))>>
				<<eventsswimming>>
			<<else>>
				<<eventsswimmingsafe>>
			<</if>>
		<<elseif $exposed lte 0>>
			<<set $danger to random(1, 10000)>><<set $dangerevent to 0>>
			<<if $danger gte (8900 - ($allure / 10))>>
				<<eventsswimming>>
			<<else>>
				<<eventsswimmingsafe>>
			<</if>>
		<</if>>
	<</if>>
<</if>>

:: Science Lesson Masturbate Hose
<<set $outside to 0>><<set $location to "school">><<effects>>

"I'll have to dispose of your clothes," Sirris says. "You'll need to see the head after class for some spares." <<He>> helps you to your seat, making sure the towels remain covering you.

Sirris sends the <<person2>><<person>> to the headteacher, and the class commences. You shiver.

<<towelup>>
<<endcombat>>

<<advancelesson>>

<<if $phase is 1>>
	<<set $phase to 0>>
	The bell rings, signifying the end of the lesson. You leave the classroom.

	<<link [[Next|Hallways]]>><</link>>
<<else>>
	<<set $danger to random(1, 10000)>><<set $dangerevent to 0>>
	<<if $danger gte (8900 - $allure)>>
		<<eventsscience>>
	<<else>>
		<<eventssciencesafe>>
	<</if>>
<</if>>

:: Maths Lesson Gang Bang
<<if $sexstart is 1>>
	<<set $sexstart to 0>>
	<<consensual>>
	<<set $consensual to 1>>
	<<neutral 1>>

	<<generates1>><<generates2>><<generates3>><<generates4>><<generates5>><<generates6>><<maninit>>
	<<set $enemytrust += 100>>

	Still flushed from your play, you sprawl yourself across your desk. You fix a <<person1>><<person>> with your gaze, knowing <<hes>> more curious than most. "The teacher is gone, we should make the most of it. Why don't you come over here," you say. "I need someone to scratch my itch."

	<<He>> walks over to you, you take <<his>> hand and place it on your <<breasts>>. <<Hes>> hesitant at first, but soon becomes more bold. You invite others to join, and soon a ring has formed around you. Other students remain seated, more embarrassed than aroused by your behaviour.<<famesex 30>><<promiscuity5>>

<</if>>

<<effects>>
<<effectsman>>
<<man>>

<<audience>>

<<stateman>>

<<actionsman>>

<<if $finish is 1>>
	<<link [[Next|Maths Lesson Gang Bang Finish]]>><</link>><<nexttext>>
<<elseif $enemyarousal gte $enemyarousalmax>>
	<<link [[Next|Maths Lesson Gang Bang Finish]]>><</link>><<nexttext>>
<<elseif $enemyhealth lte 0>>
	<<link [[Next|Maths Lesson Gang Bang Finish]]>><</link>><<nexttext>>
<<else>>
	<<link [[Next|Maths Lesson Gang Bang]]>><</link>><<nexttext>>
<</if>>

:: Maths Lesson Gang Bang Finish

<<effects>>
<<if $finish is 1>>
	The crowd backs away from you as you sit back up. You wonder if they might start doing things to each other, but they don't seem comfortable with the idea.

	<<clotheson>>
	<<endcombat>>
<<elseif $enemyarousal gte $enemyarousalmax>>
	<<ejaculation>>
	The other students lie around your desk in a satisfied pile.

	<<clotheson>>
	<<endcombat>>
<<elseif $enemyhealth lte 0>>
	You knock the students away from you. They get the hint, and cease pestering you.

	<<clotheson>>
	<<endcombat>>
<</if>>
<<npc River>><<person1>>
River soon comes to and looks around with bleary eyes. <<He>> fixes you with a gaze, but doesn't say anything. <<He>> climbs to <<his>> feet and continues the lesson as if nothing happened.

<<link [[Next|Maths Lesson Daydream]]>><<endevent>><</link>>

:: English Rub

<<set $outside to 0>><<set $location to "school">><<effects>>
<<if $pronoun is "m">>You unzip <<his>> fly<<else>>You lift up <<his>> skirt<</if>> and <<if $NPCList[0].penis isnot "none">>rub <<his>> penis.<<else>>rub <<his>> pussy.<</if>> <<He>> leans forward and faces <<his>> desk to conceal <<his>> reaction. <<He>> doesn't last long, and cums on your fingers before anyone notices.

You pull your hand away. "S-see," <<he>> gasps. "That wasn't so bad, was it? Don't worry pervert, your secret's safe with me."

<<clotheson>>
<<endmasturbation>>
<<endcombat>>
<<link [[Next|English Lesson Daydream]]>><</link>>

:: English Punish

<<set $outside to 0>><<set $location to "school">><<effects>>
<<if $pronoun is "m">>You unzip <<his>> fly<<else>>You lift up <<his>> skirt<</if>> and <<if $NPCList[0].penis isnot "none">>rub <<his>> penis.<<else>>rub <<his>> pussy.<</if>> <<He>> leans forward and faces <<his>> desk to conceal <<his>> reaction. <<He>> doesn't last long, and cums on your fingers before anyone notices.

"S-see," <<he>> gasps. "That wasn't so bad, was it? Don't worry pervert, your secret's safe with me."

<<He>> tries to pull <<his>> desk and chair away, but you grab <<his>> <<if $NPCList[0].penis isnot "none">>penis<<else>>pussy<</if>> and stop <<him>>. You lean closer, "I'm not done yet," you coo into <<his>> ear. You recommence rubbing.

<<He>> lasts a bit longer this time, but still cums pretty quickly. You keep teasing <<him>> through <<his>> orgasm, making <<him>> squirm. "Careful," you whisper. "You don't want people to see you like this, right?"

After a minute <<he>> cums again. "That was the third time," you say as <<he>> stops shaking. "Right in the middle of the classroom. Who's the pervert now?"

"P-please," <<he>> whimpers. "No more,"

Doren is getting close, so you pull away. The <<person>> shunts <<his>> chair far away from you. You think <<he>> learned <<his>> lesson.
<<promiscuity4>>

<<clotheson>>
<<endmasturbation>>
<<endcombat>>
<<link [[Next|English Lesson Daydream]]>><</link>>

:: English Rub Refuse

<<set $outside to 0>><<set $location to "school">><<effects>>
"Suit yourself," <<he>> says. "Hey everyone," <<he>> lifts your arm into the air as heads turn to look. "I caught this perv masturbating."

You try to protest, but your flushed face gives the truth away. <<if $exposed gte 1>>Not to mention your dishevelled clothing.<</if>> You wrench your arm away from the <<person>> as the class bursts into laughter.

<<fameexhibitionism 30>>
<<clotheson>>
<<endmasturbation>>
<<endcombat>>
<<npc Doren>><<person1>>Doren makes <<his>> way over and stands beside your desk. "I can't ignore this I'm afraid. Leighton will want to see you in detention." <<He>> looks concerned.

<<link [[Nod|English Lesson Daydream]]>><<endevent>><</link>>

<<link [[Stare down in shame|English Events Masturbation Stare]]>><<trauma 6>><<stress 6>><<status -10>><<npcincr Doren love 1>><</link>><<gtrauma>><<gstress>><<lcool>>

:: English Events Masturbation Stare

<<set $outside to 0>><<set $location to "school">><<effects>>
Doren looks around the classroom. "Be quiet!" <<he>> bellows. The class falls silent.

<<if $dorenhonest isnot 1>>
	<<person1>>Doren looks back at you. "I'd like to speak to you outside. Come on." You follow <<him>> from the classroom, keeping your head bowed and knowing everyone must be staring at you.

	<<He>> shuts the door behind you and speaks in an uncharacteristically quiet tone. "Is everything alright <<lass>>, or is there something you want to tell me about?"

	<<link [[Be honest|English Events Honest]]>><<npcincr Doren love 1>><<stress 6>><<trauma -6>><</link>><<gstress>><<ltrauma>>

	<<link [[Say you're fine|English Events Masturbation Fine]]>><</link>>

<<else>>
	<<endevent>>
	<<link [[Next|English Lesson Daydream]]>><</link>>

<</if>>

:: English Events Masturbation Fine

<<set $outside to 0>><<set $location to "school">><<effects>>
You put on a brave face and tell <<him>> you're fine. "Okay. If you say so," <<he>> says. "Now let's get back to class before they break a window."

<<endevent>>
<<link [[Next|English Lesson Daydream]]>><</link>>

:: History Masturbate Strip

<<set $outside to 0>><<set $location to "school">><<effects>>
<<if $player.penisExist and $worn.genitals.name is "chastity cage" and $worn.genitals.origin is "Winter">>
	<<if $worn.under_lower.type.includes("naked")>>
		You <<nervously>> remove your $worn.lower.name while trying to keep your <<genitals>> concealed from the teacher. "I'll overlook your lack of underwear, this time," <<he>> says.
	<<else>>
		You <<nervously>> remove your $worn.lower.name and $worn.under_lower.name while trying to keep your <<genitals>> concealed from the teacher.
		<<underlowerstrip>>
	<</if>>
	As Winter moves your hands <<his>> eyes widen. "Oh," <<he>> says. "You're already locked up, and it wasn't enough?" <<He>> thinks for a moment. "I found the key to the chastity cage you're wearing, lets take this a step further." <<He>> pulls a key from <<his>> pocket and unlocks the cage from around your penis.
	<<set $worn.genitals.type.push("broken")>>
	<<genitalsruined>>
	<<if $vaginalchastityparasite isnot 0>>
		With the chastity belt gone, the $vaginalchastityparasite fall out of your vagina.
		<<set $vaginalchastityparasite to 0>>
	<</if>>
	<<if $penilechastityparasite isnot 0>>
		With the chastity belt gone, the $penilechastityparasite fall off of your penis.
		<<set $penilechastityparasite to 0>>
	<</if>>

	<<genitalswear 1>>
	<<set $worn.genitals.origin to "Winter">>
	<<He>> wraps the belt around your waist. The lock shuts with a loud click. "There," <<he>> says. "No more temptation for you, I wouldn't let others see it if I were you."

	<<if $submissive gte 1150>>
		"Will you let me out?" you ask.
	<<elseif $submissive lte 850>>
		"This is humiliating." you say. "Where's the key?"
	<<else>>
		"When will you let me out?" you ask.
	<</if>>

	<<He>> shrugs. "The key to the belt is long lost. Hopefully by the time you get out you'll have developed some self control." <<He>> stands up. "Now let's get back to class."

	<<endevent>>
	<<link [[Next|History Lesson Daydream]]>><<clotheson>><</link>>

<<elseif $worn.genitals.type.includes("chastity")>>
	<<if $worn.under_lower.type.includes("naked")>>
		You <<nervously>> remove your $worn.lower.name while trying to keep your <<genitals>> concealed from the teacher. "I'll overlook your lack of underwear, this time," <<he>> says.
	<<else>>
		You <<nervously>> remove your $worn.lower.name and $worn.under_lower.name while trying to keep your <<genitals>> concealed from the teacher.
		<<underlowerstrip>>
	<</if>>
	As Winter moves your hands <<his>> eyes widen. "Oh," <<he>> says. "You're already locked up, and it wasn't enough?" <<He>> thinks for a moment. "There's only one thing for it." <<He>> sits on the box and bends you over <<his>> knee.
	<<lowerstrip>>

	<<link [[Next|History Masturbate Spank]]>><<set $molestationstart to 1>><</link>>

<<else>>
	<<if $worn.under_lower.type.includes("naked")>>
		You remove your $worn.lower.name while trying to keep your <<genitals>> concealed from the teacher. "I'll overlook your lack of underwear, this time," <<he>> says.
	<<else>>
		You remove your $worn.lower.name and $worn.under_lower.name while trying to keep your <<genitals>> concealed from the teacher.
		<<underlowerstrip>>
	<</if>>
	<<lowerstrip>>
	<<if $player.gender is "h">>
		If <<hes>> surprised by your unique genitalia, <<he>> gives no sign.
	<</if>>
	<<if $player.gender isnot "m">>
		<<genitalswear 1>>
	<<else>>
		<<genitalswear 2>>
	<</if>>
	<<set $worn.genitals.origin to "Winter">>
	<<set $genderknown.pushUnique("Winter")>>
	Once naked from the waist down, <<he>> wraps the <<if $player.penisExist>>cage<<else>>belt<</if>> around your waist. The lock shuts with a loud click. "There," <<he>> says. "No more temptation for you."

	<<if $submissive gte 1150>>
		"Will you let me out?" you ask.
	<<elseif $submissive lte 850>>
		"This is humiliating." you say. "Where's the key?"
	<<else>>
		"When will you let me out?" you ask.
	<</if>>

	<<if $player.penisExist>>
		<<He>> shrugs. "Maybe, not sure where the key is though.
	<<else>>
		<<He>> shrugs. "The key is long lost.
	<</if>>
	Hopefully by the time you get out you'll have developed some self control." <<He>> stands up. "Now let's get back to class."

	<<endevent>>
	<<link [[Next|History Lesson Daydream]]>><<clotheson>><</link>>
<</if>>

:: History Masturbate Refuse

<<set $outside to 0>><<set $location to "school">><<effects>>
<<if $submissive gte 1150>>
	"N-no," you say, unable to make eye contact.
<<elseif $submissive lte 850>>
	"Fuck off you old pervert," you say.
<<else>>
	"No," you say. "I don't want to wear it."
<</if>>

"I insist," <<he>> says, and lunges for you. You dodge out the way and flee the room. "We'll see how quick you are once Leighton is through with you," <<he>> shouts as you run down the corridor.
<<pass 10>>

<<endevent>>
<<link [[Next|Hallways]]>><</link>>

:: History Masturbate Spank

<<if $molestationstart is 1>>
	<<set $molestationstart to 0>>
	<<controlloss>>
	<<violence 1>>
	<<neutral 1>>
	<<molested>>

	<<maninit>><<npcspank>><<npcidlegenitals>>
	<<set $enemyanger += 150>>
<</if>>

<<effects>>

<<effectsman>><<man>>

<<stateman>>

<<actionsman>>

<<if $enemyhealth lte 0>>
	<<link [[Next|History Masturbate Spank Finish]]>><</link>><<nexttext>>
<<elseif $enemyarousal gte $enemyarousalmax>>
	<<link [[Next|History Masturbate Spank Finish]]>><</link>><<nexttext>>
<<elseif $enemyanger lte 20>>
	<<link [[Next|History Masturbate Spank Finish]]>><</link>><<nexttext>>
<<else>>
	<<link [[Next|History Masturbate Spank]]>><</link>><<nexttext>>
<</if>>

:: History Masturbate Spank Finish
<<set $outside to 0>><<set $location to "school">><<effects>>

<<if $enemyarousal gte $enemyarousalmax>>
	<<ejaculation>>
	"You're an energetic one," <<he>> pants. <<tearful>> you follow <<him>> back to class.

	<<clothesontowel>>
	<<endcombat>>

	<<link [[Next|History Lesson Daydream]]>><</link>>

<<elseif $enemyhealth lte 0>>
	<<He>> recoils in pain and you squirm from <<his>> grip. "You can't run from punishment forever," <<he>> shouts. <<tearful>> you run from the room and down the corridor.
	<<pass 10>>

	<<clotheson>>
	<<endcombat>>

	<<link [[Next|Hallways]]>><</link>>

<<else>>
	<<He>> releases you. "I hope you've learnt your lesson. Masturbation causes all sorts of health problems." <<tearful>> you follow <<him>> back to class.

	<<clothesontowel>>
	<<endcombat>>

	<<link [[Next|History Lesson Daydream]]>><</link>>

<</if>>

:: Swimming Masturbate Nod
<<set $outside to 0>><<set $location to "pool">><<effects>>

You nod. <<He>> still looks concerned. "If you're sure," <<he>> says. "Tell me if you start shivering like that again. It could be dangerous." <<He>> helps you back into the pool and continues the lesson.

<<endcombat>>

<<link [[Next|Swimming Lesson Daydream]]>><</link>>

:: Swimming Masturbate Kiss
<<set $outside to 0>><<set $location to "pool">><<effects>>

You plant a kiss on <<his>> lips. <<takeKissVirginity "Mason">><<He>> recoils with a mix of confusion and horror on <<his>> face. The other students laugh and cheer. <<His>> face turns red. "Okay then," <<he>> says. "Back in the pool." <<He>> avoids looking at you for the rest of the lesson.
<<promiscuity2>>

<<endcombat>>

<<link [[Next|Swimming Lesson Daydream]]>><</link>>

:: School Boy's Masturbation
<<effects>>

<<if $masturbationstart is 1>>
	<<set $masturbationstart to 0>>
	<<set $masturbationstat += 1>>
	<<masturbationstart>>
	Exposed yet hidden, you ogle the undressed boys. You think about what they'd do if they caught you, naked as you are. Your hands wander.
	<<exhibitionism3>>
	<<set $timer to random(1, 100)>>
	<<set $mouth to "disabled">>
<</if>>

<<masturbationeffects>>
<<masturbationactions>>

<<if $timer lte 1>>
	<<link [[Continue|School Boy's Masturbation Caught]]>><</link>><<nexttext>>

<<else>>
	<<link [[Continue|School Boy's Masturbation]]>><</link>><<nexttext>>

<</if>>

<<if $corruptionMasturbation isnot true and random(0,3) gt $orgasmcurrent and $corruption_slime gt ($willpower / 10)>>
	<<link [[Stop|$passage]]>><<set $corruptionMasturbation to true>><</link>>
<<elseif $corruptionMasturbation isnot true>>
	<<link [[Stop|School Boy's Masturbation Finish]]>><<set $finish to 1>><</link>>
<<else>>
	The slime in your ear will not allow you to stop.
<</if>>

:: School Boy's Masturbation Finish

<<effects>>
One of the boys glances in your direction. You back away from the door, your heart pounding.

<<endmasturbation>>
<<clotheson>>
<<endcombat>>
<<link [[Next|School Pool Entrance]]>><</link>>

:: School Boy's Masturbation Caught

<<effects>>
<<endmasturbation>>
<<endcombat>>
<<generatesm1>><<person1>>
<<if $rng gte 81>>
	You hear a thud from behind. A <<person>> stands gaping at you, <<his>> bag on the floor beside <<him>>. <<He>> blinks free of <<his>> shock and grins."Guys!" <<he>> shouts. "You have an audience." The changing room falls silent.

	<<if $exhibitionism gte 75>>
		<<link [[Enter|School Boy's Exhibitionism]]>><<detention 3>><</link>><<gdelinquency>><<exhibitionist5>>

	<</if>>
	<<link [[Run|School Boy's Run]]>><</link>>

<<else>>
	You hear a thud from behind. A <<person>> stands gaping at you, <<his>> bag on the floor beside <<him>>. Blushing, <<he>> grabs <<his>> bag and runs the way <<he>> came.
	<<gstress>><<stress 3>>

	<<clotheson>>
	<<link [[Next|School Pool Entrance]]>><</link>>

<</if>>

:: School Girl's Masturbation

<<effects>>
<<if $masturbationstart is 1>>
	<<set $masturbationstart to 0>>
	<<set $masturbationstat += 1>>
	<<masturbationstart>>
	Exposed yet hidden, you ogle the undressed girls. You think about what they'd do if they caught you, naked as you are. Your hands wander.
	<<exhibitionism3>>
	<<set $timer to random(1, 100)>>
	<<set $mouth to "disabled">>
<</if>>
<<masturbationeffects>>
<<masturbationactions>>
<<if $timer lte 1>>
	<<link [[Continue|School Girl's Masturbation Caught]]>><</link>><<nexttext>>

<<else>>
	<<link [[Continue|School Girl's Masturbation]]>><</link>><<nexttext>>

<</if>>
<<if $corruptionMasturbation isnot true and random(0,3) gt $orgasmcurrent and $corruption_slime gt ($willpower / 10)>>
	<<link [[Stop|$passage]]>><<set $corruptionMasturbation to true>><</link>>
<<elseif $corruptionMasturbation isnot true>>
	<<link [[Stop|School Girl's Masturbation Finish]]>><<set $finish to 1>><</link>>
<<else>>
	The slime in your ear will not allow you to stop.
<</if>>

:: School Girl's Masturbation Finish

<<effects>>
One of the girls glances in your direction. You back away from the door, your heart pounding.

<<endmasturbation>>
<<clotheson>>
<<endcombat>>
<<link [[Next|School Pool Entrance]]>><</link>>

:: School Girl's Masturbation Caught

<<effects>>
<<endmasturbation>>
<<endcombat>>
<<generatesf1>><<person1>>
<<if $rng gte 81>>
	You hear a thud from behind. A <<person>> stands gaping at you, <<his>> bag on the floor beside <<him>>. <<He>> blinks free of <<his>> shock and grins. "Girls!" <<he>> shouts. "You have an audience." The changing room falls silent.

	<<if $exhibitionism gte 75>>
		<<link [[Enter|School Girl's Exhibitionism]]>><<detention 3>><</link>><<gdelinquency>><<exhibitionist5>>

	<</if>>
	<<link [[Run|School Girl's Run]]>><</link>>

<<else>>
	You hear a thud from behind. A <<person>> stands gaping at you, <<his>> bag on the floor beside <<him>>. Blushing, <<he>> grabs <<his>> bag and runs the way <<he>> came.
	<<gstress>><<stress 3>>

	<<clotheson>>
	<<link [[Next|School Pool Entrance]]>><</link>>

<</if>>

:: Toilets Watched Masturbation
<<effects>>

<<if $masturbationstart is 1>>
	<<set $masturbationstart to 0>>
	<<set $masturbationstat += 1>>
	<<masturbationstart>>
	<<set $timer to random(5, 50)>>
<</if>>

You fondle yourself. <<if $phase2 is 1>>They watch<<else>>The <<person1>><<person>> watches<</if>> with great interest.
<<garousal>><<genitalarousal 50>>

<<if $orgasmdown gte 1>>
	<<set $timer -= 5>>
	<<if $phase2 is 1>>They watch<<else>>The <<person1>><<person>> watches<</if>> your climax with awe. "Look at <<pher>> go!"
<</if>>

<<masturbationeffects>>
<<masturbationactions>>

<<if $timer lte 0>>
	<<link [[Continue|Toilets Watched Masturbation Finish]]>><</link>><<nexttext>>

<<else>>
	<<link [[Continue|Toilets Watched Masturbation]]>><</link>><<nexttext>>

<</if>>
<<if $corruptionMasturbation isnot true and random(0,3) gt $orgasmcurrent and $corruption_slime gt ($willpower / 10)>>
	<<link [[Stop|$passage]]>><<set $corruptionMasturbation to true>><</link>>
<<elseif $corruptionMasturbation isnot true>>
	<<link [[Stop|Toilets Watched Masturbation Finish]]>><<set $finish to 1>><</link>>
<<else>>
	The slime in your ear will not allow you to stop.
<</if>>

:: Toilets Watched Masturbation Finish
<<effects>>

<<if $timer lte 0>>
	The <<person1>><<person>> steps forward. "I think <<if $phase2 is 1>>we<<else>>I<</if>>'ve seen enough. Time to get hands-on." You try to stop touching yourself, but you can't control your spasms. <<if $phase2 is 1>>They block<<else>><<He>> blocks<</if>> you in the stall.
	<<saveNPC 0 toilets_1>>
	<<if $phase2 is 1>>
		<<set _phasetemp to 1>>
		<<saveNPC 1 toilets_2>>
	<</if>>
	<<endmasturbation>>
	<<endcombat>>
	<<loadNPC 0 toilets_1>>
	<<if _phasetemp is 1>>
		<<set $phase2 to 1>>
		<<loadNPC 1 toilets_2>>
	<</if>>

	<<link [[Next|Toilets Molestation]]>><<set $molestationstart to 1>><</link>>
<<else>>
	You decide <<if $phase2 is 1>>they've<<else>><<hes>><</if>> seen enough.
	<<if $orgasmcurrent is 0>>
		<<saveNPC 0 toilets_1>>
		<<if $phase2 is 1>>
			<<set _phasetemp to 1>>
			<<saveNPC 1 toilets_2>>
		<</if>>
		<<endmasturbation>>
		<<endcombat>>
		<<loadNPC 0 toilets_1>>
		<<if _phasetemp is 1>>
			<<set $phase2 to 1>>
			<<loadNPC 1 toilets_2>>
		<</if>>
		"That was pretty pathetic, you didn't even finish!" <<if $phase2 is 1>>The <<person2>><<person>> nods in agreement.<</if>> "I think we need to punish you for teasing us." <<if $phase2 is 1>>They step to<<else>><<He>> steps<</if>> toward you, blocking you in the stall.

		<<link [[Next|Toilets Molestation]]>><<set $molestationstart to 1>><</link>>
	<<else>>
		<<endmasturbation>>
		You spread your legs wide, giving <<if $phase2 is 1>>them<<else>><<him>><</if>> a perfect view of the aftermath. <<if $phase2 is 1>>They stand<<else>><<He>> stands<</if>> stunned.

		You stand up, and make sure to rub right up against the <<person1>><<person>> as you exit the stall. <<flaunting>> <<if $phase2 is 1>>they eye<<else>><<he>> eyes<</if>> you closely as you
		<<storeon $bus "check">>
		<<if _store_check is 1>>
			<<storeon $bus>>
			retrieve your clothes, and slowly dress in front of <<if $phase2 is 1>>them<<else>><<him>><</if>>,
		<<else>>
			look at yourself in the mirror, giving <<if $phase2 is 1>>one of them<<else>><<him>><</if>> a wink and
		<</if>>giving your <<bottom>> a wiggle as you do so. They make no other moves towards you.
		<<clotheson>>
		<<endcombat>>
		<<link [[Leave|Park]]>><<set $eventskip to 1>><</link>>

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

:: Home Masturbation

<<effects>>
<<upperstrip>><<lowerstrip>>
<<if $masturbationstart is 1>>
	<<set $masturbationstart to 0>>
	<<set $masturbationstat += 1>>
	<<masturbationstart>>

	You take off your clothes, it's your home so there's no reason to be shy.

	You feel safer doing this here anyway, hopefully nobody is going to barge in.

	<<run getRobinLocation()>>
	<<if $rng gte 70 and $schoolday is 1 and $hour gte 15 and _robin_location is "orphanage" and $NPCName[$NPCNameList.indexOf("Robin")].lust gte 2 and $NPCName[$NPCNameList.indexOf("Robin")].love gte 50>>

		You are already naked and lying on the bed with exposed <<genitals>> when suddenly your door opens.

		"Oh.."

		That's all you hear from Robin as <<his>> eyes bulge out looking directly at your <<genitals>>.

		"S-Sorry, I-I didn't.."

		<<if $exhibitionism gte 35>>
			<<He>> is probably more embarrassed then you and you don't even try to cover your exposed parts.

		<<else>>
			<<He>> is just as embarrassed as you. You try to quickly cover your exposed parts.

		<</if>>

		"I-I'm sorry!" <<he>> stutters, face completely red. <<He>> turns around and closes your door in a hurry.

		<<npcincr Robin love 1>><<npcincr Robin lust 2>>

		<<link [[Continue|Home Masturbation]]>><</link>><<nexttext>>

		<<if $corruptionMasturbation isnot true and random(0,3) gt $orgasmcurrent and $corruption_slime gt ($willpower / 10)>>
			<<link [[Stop|$passage]]>><<set $corruptionMasturbation to true>><</link>>
		<<elseif $corruptionMasturbation isnot true>>
			<<link [[Stop|Home Masturbation Finish]]>><<set $finish to 1>><</link>>
		<<else>>
			The slime in your ear will not allow you to stop.
		<</if>>

	<</if>>

<</if>>
<<masturbationeffects>>
<<masturbationactions>>
<<link [[Continue|Home Masturbation]]>><</link>><<nexttext>>

<<if $corruptionMasturbation isnot true and random(0,3) gt $orgasmcurrent and $corruption_slime gt ($willpower / 10)>>
	<<link [[Stop|$passage]]>><<set $corruptionMasturbation to true>><</link>>
<<elseif $corruptionMasturbation isnot true>>
	<<link [[Stop|Home Masturbation Finish]]>><<set $finish to 1>><</link>>
<<else>>
	The slime in your ear will not allow you to stop.
<</if>>

:: Home Masturbation Finish

<<effects>>
There's not much of a thrill doing this here, but at least you feel refreshed.

<<endmasturbation>>
<<endcombat>>

<<link [[Next|Bathroom]]>><<clotheson>><</link>>

:: Farm Shower Masturbation

<<effects>>
<<if $masturbationstart is 1>>
	You wonder what Alex would say if <<nnpc_he "Alex">> caught you doing this.
	<<set $masturbationstart to 0>>
	<<set $masturbationstat += 1>>
	<<masturbationstart>>
<</if>>
<<masturbationeffects>>
<<masturbationactions>>
<<link [[Continue|$passage]]>><</link>><<nexttext>>

<<if $corruptionMasturbation isnot true and random(0,3) gt $orgasmcurrent and $corruption_slime gt ($willpower / 10)>>
	<<link [[Stop|$passage]]>><<set $corruptionMasturbation to true>><</link>>
<<elseif $corruptionMasturbation isnot true>>
	<<link [[Stop|Farm Shower Masturbation Finish]]>><<set $finish to 1>><</link>>
<<else>>
	The slime in your ear will not allow you to stop.
<</if>>

:: Farm Shower Masturbation Finish

<<effects>>
<<if random(0,100) gte Math.clamp(108 - ($masturbationorgasm * 4),60,100) and $daystate isnot "night">>
	<<endmasturbation>>
	<<endcombat>>
	<<npc Alex>><<person1>>As you get up, you notice the open door with a blushing Alex holding onto the handle.
	<<if $NPCName[$NPCNameList.indexOf("Alex")].dom gte 20>>
		<<He>> hesitates, then steps forward and closes the door behind <<him>>. "You sure looked like you were having fun there, may I join in?" <<he>> says, pushing you against the wall.

		<<if $promiscuity gte 15>>
			<<link [[Allow|Farm Shower Masturbation Sex]]>><<set $sexstart to 1>><<npcincr Alex dom 1>><<npcincr Alex love 1>><</link>><<gdom>><<glove>>

		<</if>>
		<<link [[Rush past|Farm Work]]>><<clotheson>><<npcincr Alex lust 5>><<endevent>><</link>><<gglust>>
	<<else>>
		<<He>> hesitates, then shuts the door. You get up and wash until you're squeaky clean again.<<wash>>

		<<link [[Next|Farm Work]]>><<clotheson>><<npcincr Alex lust 2>><<endevent>><</link>><<glust>>

	<</if>>
<<else>>
	<<endmasturbation>>
	<<endcombat>>
	You get up and wash until you're squeaky clean again.<<wash>>

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


code:
:: Widgets Masturbation Slime Control [widget]
<<widget "masturbationSlimeControl">>

<<if $leftaction is 0 or $leftaction is "mrest">>
	<<set $leftaction to "slime">>
<</if>>

<<if $rightaction is 0 or $rightaction is "mrest">>
	<<set $rightaction to "slime">>
<</if>>

<<if $leftaction is "mpenisstop" or $leftaction is "mvaginastop" or $leftaction is "manusstop">>
	The slime prevents you from moving your left hand away.
	<<set $leftaction to "slime">>
<</if>>

<<if $rightaction is "mpenisstop" or $rightaction is "mvaginastop" or $rightaction is "manusstop">>
	The slime prevents you from moving your right hand away.
	<<set $rightaction to "slime">>
<</if>>

It continues to force you to play with yourself.
<<unset _force>>
<<arousal 100>>

/*Left Arm*/

<<if $worn.over_lower.exposed is 0 and $leftaction is "slime">>
	<<set $leftaction to "moverlower">>
<<elseif $worn.lower.exposed is 0 and $leftaction is "slime">>
	<<set $leftaction to "mlower">>
<<elseif $worn.under_lower.exposed is 0 and $leftaction is "slime">>
	<<set $leftaction to "munder">>
<</if>>

<<if $leftarm is 0>>
	<<if ($player.penisExist and !$worn.genitals.type.includes("chastity") and $leftaction is "slime") or ($player.penisExist and !$worn.genitals.type.includes("chastity") and $leftaction is "mchest" and $rng gte 97)>>
		<<set $leftaction to "mpenisentrance">>
	<<elseif (random(0, 100) lt 25 and $worn.genitals.anal_shield isnot 1 and $leftaction is "slime") or ($leftaction is "mchest" and $worn.genitals.anal_shield isnot 1 and $rng gte 97)>>
		<<set $leftaction to "manusentrance">>
	<<elseif $leftaction is "slime">>
		<<set $leftaction to "mchest">>
	<</if>>
	<<set $delayLeft to 2>>
<</if>>

<<if $leftarm is "mpenisentrance" and $delayLeft is 0>>
	<<set $leftaction to "mpenisshaft">>
<</if>>

<<if $leftarm is "manusentrance" and $delayLeft is 0>>
	<<set $leftaction to "manus">>
	<<set $delayLeft to 2>>
<</if>>

<<if $leftarm is "manus" and $delayLeft is 0 and $player.penisExist>>
	<<set $leftaction to "manusprostate">>
<</if>>

/*Right Arm*/

<<if $worn.over_upper.exposed is 0 and $rightaction is "slime">>
	<<set $rightaction to "moverupper">>
<<elseif $worn.upper.exposed is 0 and $rightaction is "slime">>
	<<set $rightaction to "mupper">>
<<elseif $worn.upper.exposed is 0 and $rightaction is "slime">>
	<<set $rightaction to "munder_upper">>
<</if>>

<<if $rightarm is 0>>
	<<if ($player.vaginaExist and !$worn.genitals.type.includes("chastity") and $rightaction is "slime") or ($player.vaginaExist and !$worn.genitals.type.includes("chastity") and $rightaction is "mchest" and $rng lte 3)>>
		<<set $rightaction to "mvaginaentrance">>
	<<elseif (random(0, 100) lt 25 and $worn.genitals.anal_shield isnot 1 and $rightaction is "slime") or ($rightaction is "mchest" and $worn.genitals.anal_shield isnot 1 and $rng lte 3)>>
		<<set $rightaction to "manusentrance">>
	<<elseif $rightaction is "slime">>
		<<set $rightaction to "mchest">>
	<</if>>
	<<set $delayRight to 2>>
<</if>>

<<if $rightarm is "mvaginaentrance" and $delayRight is 0>>
	<<set $rightaction to "mvagina">>
<</if>>

<<if $rightarm is "manusentrance" and $delayRight is 0>>
	<<set $rightaction to "manus">>
	<<set $delayRight to 2>>
<</if>>

<<if $rightarm is "manus" and $delayRight is 0 and $player.penisExist>>
	<<set $rightaction to "manusprostate">>
<</if>>

<<if $delayLeft is not undefined>>
	<<if $delayLeft gt 0>>
		<<set $delayLeft -= 1>>
	<</if>>
<</if>>

<<if $delayRight is not undefined>>
	<<if $delayRight gt 0>>
		<<set $delayRight -= 1>>
	<</if>>
<</if>>

<</widget>>

repo_name: Area/degrees

license: mit


code:
:: Widgets Masturbation [widget]

<<widget "endmasturbation">>
	<<if $masturbationorgasm is 0>>
		<<if $purity gte 990 and $worn.genitals.type.includes("chastity")>>
			You didn't cum, but you feel guilty regardless.
		<<elseif $purity gte 900>>
			You didn't cum, but that's okay.
		<<else>>
			You didn't cum. You feel aggravated.
			<<gstress>><<stress 6>>
		<</if>>
	<<elseif $masturbationorgasm is 1>>
		You feel satisfied.
	<<elseif $masturbationorgasm is 2>>
		You came twice. You feel satisfied.
	<<elseif $masturbationorgasm lte 4>>
		You came <<number $masturbationorgasm>> times. You feel a warm glow.
	<<elseif $masturbationorgasm lte 6>>
		You came <<number $masturbationorgasm>> times. You pant.
	<<elseif $masturbationorgasm lte 10>>
		You came <<number $masturbationorgasm>> times. Your body is tired.
	<<elseif $masturbationorgasm lte 15>>
		You came <<number $masturbationorgasm>> times. You're quite the trooper.
	<<elseif $masturbationorgasm lte 20>>
		You came <<number $masturbationorgasm>> times. This is getting silly.
	<<elseif $masturbationorgasm lte 30>>
		You came <<number $masturbationorgasm>> times. Are you sure your body can handle it?
	<<elseif $masturbationorgasm lte 50>>
		You came <<number $masturbationorgasm>> times. There are other ways to cope with stress, you know.
	<<elseif $masturbationorgasm lte 100>>
		You came <<number $masturbationorgasm>> times. Tentacle monsters could learn a thing or two about endurance from you.
	<<else>>
		You came <<number $masturbationorgasm>> times. Are you insane or are you actually aiming to be a tentacle monster god?
	<</if>>
	<<if $masturbationorgasm gt 50>>
		<<earnFeat "Producer of Lewd Fluids">>
	<</if>>
	<<if $masturbationorgasm gt 100 or ($masturbation_bowl is 1 and Math.floor(($masturbation_fluid / 30)) gte 15)>>
		<<earnFeat "Literally Buckets">>
	<</if>>
	<<if $purity gte 990 and $worn.genitals.type.includes("chastity")>>
		Do other <<girls>> do this, or are you a freak?
	<</if>>

	<<if $masturbation_bowl is 1>>
		<<masturbationbowlimage>>
		<<set $masturbation_fluid to ($masturbation_semen + $masturbation_milk + $masturbation_vaginaFluid)>>
		<<if $masturbation_fluid gt $creamstat>>
			<<set $creamstat to $masturbation_fluid>>
		<</if>>
		<<if $masturbation_fluid gt 0>>
			<<set $_liquids to []>>
			<<if $masturbation_milk gt 0>><<set $_liquids.push("milk")>><</if>>
			<<if $masturbation_semen gt 0>><<set $_liquids.push("semen")>><</if>>
			<<if $masturbation_vaginaFluid gt 0>><<set $_liquids.push("lewd fluids")>><</if>>
			<<if $_liquids.length is 3>>
				You gathered <<print ($masturbation_fluid).toFixed(1)>> mL of milk, semen, and lewd fluids.
			<<else>>
				You gathered <<print ($masturbation_fluid).toFixed(1)>> mL of <<print $_liquids.join(" and ")>>.
			<</if>>
		<<else>>
			You've failed to produce any milk or other lewd fluids.
		<</if>>
	<</if>>
	<<set $masturbation_bowl to 0>>
	<<set $masturbation_semen to 0>>
	<<set $masturbation_milk to 0>>
	<<set $masturbation_vaginaFluid to 0>>
	<<set $leftactiondefault to 0>>
	<<set $rightactiondefault to 0>>
	<<set $leftaction to 0>>
	<<set $rightaction to 0>>
	<<set $mouthactiondefault to 0>>
	<<set $mouthaction to 0>>
	<<set $mouth to 0>>
	<<set $penisuse to 0>>
	<<set $vaginaactiondefault to 0>>
	<<set $vaginaaction to 0>>
	<<set $vaginause to 0>>
	<<set $anusactiondefault to 0>>
	<<set $anusaction to 0>>
	<<set $anususe to 0>>
	<<if $leftarm isnot "bound">>
		<<set $leftarm to 0>>
	<</if>>
	<<if $rightarm isnot "bound">>
		<<set $rightarm to 0>>
	<</if>>
	<<unset $delayLeft>>
	<<unset $delayRight>>
	<<unset $corruptionMasturbation>>
	<<unset $corruptionMasturbationCount>>
	<<unset $leftFingersSemen>>
	<<unset $rightFingersSemen>>
	<<set $masturbationorgasmsemen to 0>>
	<<if $semenInVagina is true>>
		<<recordVaginalSperm "pc" "pc" "human">>
		<<unset $semenInVagina>>
	<</if>>
	<<unset $ballsText>>
	<<unset $fingersInVagina>>
	<<unset $vaginaFingerLimit>>
	<<unset $selfsuckDepth>>
	<<unset $selfsuckLimit>>
	<<unset $penisHeight>>
	<<unset $canSelfSuckPenis>>
	<<unset $canSelfSuckVagina>>
<</widget>>

<<widget "masturbationstart">>
	<<if $leftarm isnot "bound">>
		<<set $leftarm to 0>>
		<<set $leftaction to 0>>
	<</if>>
	<<set $leftactiondefault to "mrest">>
	<<if $rightarm isnot "bound">>
		<<set $rightarm to 0>>
		<<set $rightaction to 0>>
	<</if>>
	<<set $rightactiondefault to "mrest">>
	<<set $mouth to 0>>
	<<set $mouthactiondefault to "mrest">>
	<<set $mouthaction to 0>>
	<<switch $player.gender>>
		<<case "f">>
			<<set $vaginause to 0>>
			<<set $penisuse to "none">>
		<<case "m">>
			<<set $penisuse to 0>>
			<<set $vaginause to "none">>
		<<case "h">>
			<<set $vaginause to 0>>
			<<set $penisuse to 0>>
	<</switch>>
	<<set $vaginaactiondefault to "mrest">>
	<<set $vaginaaction to 0>>
	<<set $anusactiondefault to "mrest">>
	<<set $anusaction to 0>>
	<<set $anususe to 0>>
	<<set $masturbationorgasmsemen to 0>>

	<<set $fingersInVagina to 0>>
	<<set $vaginaFingerLimit to 3>>
	<<if $player.virginity.vaginal is true and $sexStats.vagina.pregnancy.totalBirthEvents is 0>>
		<<set $vaginaFingerLimit -= 1>>
	<</if>>

	/* note: we're setting $ballssize here because the variable exists but isn't used anywhere else YET. when a true implementation is attempted, remove this. */
	<<set $ballssize to $penissize>>
	<<silently>>
		<<ballsize>><<set $ballsText to _text_output + " ">>
		<<testicles>><<set $ballsText += _text_output>>
	<</silently>>

	<<selfsuckchecks>>

	<<if !$worn.genitals.type.includes("chastity")>>
		You fondle your <<genitals 1>>.
		<<if $purity gte 990>>
			You know you'd feel guilty if you went further, but it feels so good.
		<<elseif $purity gte 900>>
			Would it be so bad if you went a bit further?
		<<else>>
			You feel it yearn to be touched.
		<</if>>
	<</if>>

<</widget>>

<<widget "masturbationbowl">>
	<<set $masturbation_fluid to ($masturbation_semen + $masturbation_milk + $masturbation_vaginaFluid)>>
	<<if $masturbation_fluid gt $creamstat>>
		<<set $creamstat to $masturbation_fluid>>
	<</if>>
	<<masturbationbowlimage>>
	You've gathered <<print ($masturbation_fluid).toFixed(1)>> mL of fluid.
<</widget>>

<<widget "masturbationbowlimage">>
	<<if $images is 1>>
		<<set _masturbation_temp to Math.floor(($masturbation_fluid / 30))>>

			<<if $masturbation_fluid gte 900>>

			<<elseif $masturbation_fluid gte 30>>

			<</if>>

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

/* these checks only determine if it could be possible. they do not check for current obstructions like clothing or hands. */
<<widget "selfsuckchecks">>
	<<if $worn.genitals.type.includes("chastity")>>
		<<set $canSelfSuckVagina to false>>
		<<set $canSelfSuckPenis to false>>
	<<else>>
		<<set $_danceSkillLimit to Math.clamp(Math.ceil((800 - $danceskill)/200), 0, 4)>>
		<<set $_catFlexLimit to (6 - $cat)>>
		<<if $player.penisExist>>
			/* <<set setup.penisHeightLevels to ["base", "waist", "midriff", "chest"]>> */
			/* the above comment is a reminder of how high the player's penis can reach. however, it's not useful in the code at the moment. */

			/* lower number means harder to reach; the player has to get their head lower down to reach it. */
			<<set $penisHeight to [0,0,0,1,1,2,3][$penissize + 2]>>
			<<set $canSelfSuckPenis to ($penisHeight gte $_danceSkillLimit) or ($penisHeight gte $_catFlexLimit)>>
			<<set $selfsuckLimit to $penisHeight - ($_danceSkillLimit lt $_catFlexLimit ? $_danceSkillLimit : $_catFlexLimit)>>
			<<set $selfsuckDepth to 0>>
		<</if>>
		<<if $player.vaginaExist>>
			<<set $canSelfSuckVagina to ((0 gte $_danceSkillLimit) or (0 gte $_catFlexLimit))>>
		<</if>>
	<</if>>
<</widget>>

<<widget "addVaginalWetness">>
	<<if $args[0] and $args[0] gt 0 and $player.vaginaExist>>

		<<set $_change to $args[0] * Math.pow(($arousal+6000)/10000, 2)>>

		<<set $_wetnessPercent to Math.clamp($vaginaArousalWetness / 100, 0, 1)>>
		<<set $_change to Math.floor($_change * (1 - $_wetnessPercent))>>

		<<set $vaginaArousalWetness += $_change>>
		<<set $vaginaArousalWetness to Math.clamp($vaginaArousalWetness, 0, 100)>>
	<</if>>
<</widget>>


code:
:: Test
<<location castle>><<effects>>
<<endcombat>>

:: Robin
<<set $NPCName[$NPCNameList.indexOf("Robin")].love to 50>>
<<if $NPCName[$NPCNameList.indexOf("Robin")].love gte 50>>
<</if>>

<<link [["Ask " + $NPCList[0].pronouns.him + " how " + $NPCList[0].pronouns.he + " gets in and out"|Prison Wren Ask 2]]>><</link>>

:: Sex

<<if $sexstart is 1>>
	<<set $sexstart to 0>>
	<<consensual>>
	<<set $consensual to 1>>
	<<neutral 1>>

	<<maninit>>
	<<set $enemytrust += 100>><<promiscuity5>>
<</if>>
<<effects>>
<<effectsman>><<man>>
<<stateman>>

<<actionsman>>
<<if $finish is 1>>
	<<link [[Next|Sex Finish]]>><</link>><<nexttext>>
<<elseif $enemyhealth lte 0>>
	<<link [[Next|Sex Finish]]>><</link>><<nexttext>>
<<elseif $enemyarousal gte $enemyarousalmax>>
	<<link [[Next|Sex Finish]]>><</link>><<nexttext>>
<<else>>
	<<link [[Next|Sex]]>><</link>><<nexttext>>
<</if>>

:: Sex Finish

<<set $outside to 0>><<effects>>
<<if $enemyarousal gte $enemyarousalmax>>
	<<ejaculation>>
	Text about the aftermath of them cumming.

	<<tearful>> you recover.

	<<clotheson>>
	<<endcombat>>
	<<link [[Next|Sex]]>><</link>>/*Point links wherever you want the player to end up*/
<<elseif $enemyhealth lte 0>>
	Text about escaping.

	<<tearful>> you recover.

	<<clotheson>>
	<<endcombat>>
	<<link [[Next|Sex]]>><</link>>
<<else>>
	Text about the encounter stopping because you ended it.

	<<tearful>> you recover.

	<<clotheson>>
	<<endcombat>>
	<<link [[Next|Sex]]>><</link>>
<</if>>

:: Rape

<<if $molestationstart is 1>>
	<<set $molestationstart to 0>>
	<<controlloss>>
	<<violence 1>>
	<<neutral 1>>
	<<molested>>

	<<maninit>>
	<<enable_rescue>>/*Remove line if rescue is impossible*/
<</if>>

<<effects>>

<<effectsman>><<man>>

<<stateman>>

<<actionsman>>

<<if $enemyhealth lte 0>>
	<<link [[Next|Rape Finish]]>><</link>><<nexttext>>
<<elseif $enemyarousal gte $enemyarousalmax>>
	<<link [[Next|Rape Finish]]>><</link>><<nexttext>>
<<elseif $alarm is 1 and $rescue is 1>>
	<<link [[Next|Rape Finish]]>><</link>><<nexttext>>
<<else>>
	<<link [[Next|Rape]]>><</link>><<nexttext>>
<</if>>

:: Rape Finish
<<effects>>
<<if $enemyarousal gte $enemyarousalmax>>
	<<ejaculation>>
	Text about the aftermath of them cumming.

	<<tearful>> you recover.

	<<clotheson>>
	<<endcombat>>
	<<link [[Next|Rape]]>><<set $molestationstart to 1>><</link>>/*Link points wherever you want the player to end up*/

<<elseif $enemyhealth lte 0>>
	Text about escaping.

	<<tearful>> you recover.

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

<<else>>
	<<set $rescued += 1>>/*Unnecessary if rescue is impossible*/
	Text about being rescued.

	<<tearful>> you recover.

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

<</if>>

:: Fight
<<if $fightstart is 1>>
	<<set $fightstart to 0>>

	<<neutral 1>>

	<<maninit>>
	<<set $enemytrust -= 100>>
	<<set $enemyanger += 200>>
	<<npcidlegenitals>>

<</if>>

<<effects>>
<<effectsman>><<man>>

<<stateman>>

<<actionsman>>

<<if $enemyhealth lte 0>>
	<<link [[Next|Fight Finish]]>><</link>><<nexttext>>
<<elseif $enemyarousal gte $enemyarousalmax>>
	<<link [[Next|Fight Finish]]>><</link>><<nexttext>>
<<elseif $pain gte 100 and $willpowerpain is 0>>
	<<link [[Next|Fight Finish]]>><</link>><<nexttext>>
<<else>>
	<<link [[Next|Fight]]>><</link>><<nexttext>>
<</if>>

:: Fight Finish
<<effects>>
<<if $enemyarousal gte $enemyarousalmax>>
	<<ejaculation>>
	Text about the aftermath of them cumming.

	<<tearful>> you recover.

	<<clotheson>>
	<<endcombat>>
	<<link [[Next|Fight]]>><</link>>/*Point links wherever you want the player to end up*/

<<elseif $enemyhealth lte 0>>
	Text about escaping.

	<<tearful>> you recover.

	<<clotheson>>
	<<endcombat>>
	<<link [[Next|Fight]]>><</link>>

<<else>>
	Text about being too hurt to fight.

	<<tearful>> you recover.

	<<clotheson>>
	<<endcombat>>
	<<link [[Next|Fight]]>><</link>>

<</if>>

:: Skulduggery
<<effects>>

<<set $skulduggerydifficulty to 200>>
<<link [[Next|Skulduggery 2]]>><</link>><<skulduggerydifficulty>>

:: Skulduggery 2
<<effects>>

Possible text describing your attempt.

<<skulduggerycheck>>
<<if $skulduggerysuccess is 1>>

	Text describing your success.

	<<if $skulduggery lte ($skulduggerydifficulty + 100)>>
		<<skulduggeryskilluse>>
	<<else>>
		That was too easy. You didn't learn anything.

	<</if>>

	<<link [[Next|Skulduggery]]>><</link>>

<<else>>

	Text describing your failure.

	<<if $skulduggery lte ($skulduggerydifficulty + 100)>>
		<<skulduggeryskilluse>>
	<<else>>
		That was too easy. You didn't learn anything.

	<</if>>

	<<link [[Next|Skulduggery]]>><</link>>

<</if>>

:: Beast Sex
<<if $sexstart is 1>>
	<<set $sexstart to 0>>
	<<consensual>>
	<<set $consensual to 1>>
	<<neutral 1>>

	<<beastNEWinit 1 dog>>/* - Delete if beasts are already generated*/
	<<beastCombatInit>>
	<<beastTrainGenerate>>/* - Delete if there aren't multiple beasts*/
<</if>>

<<effects>>
<<effectsman>>

<<beast $enemyno>>

<<stateman>>

<<actionsman>>

<<if $finish is 1>>
	<<link [[Next|Beast Sex Finish]]>><</link>><<nexttext>>
<<elseif $enemyarousal gte $enemyarousalmax>>
	<<link [[Next|Beast Sex Finish]]>><</link>><<nexttext>>
<<elseif $enemyhealth lte 0>>
	<<link [[Next|Beast Sex Finish]]>><</link>><<nexttext>>
<<else>>
	<<link [[Next|Beast Sex]]>><</link>><<nexttext>>
<</if>>

:: Beast Sex Finish
<<effects>>

<<if $enemyarousal gte $enemyarousalmax>>

	<<beastejaculation>>

	Insert text about the aftermath of the beast cumming.

	<<tearful>> you gather yourself.

	<<clotheson>>
	<<endcombat>>

	<<link [[Next|Beast Rape]]>><<set $eventskip to 1>><</link>>

<<elseif $enemyhealth lte 0>>

	Insert text about the beast running.

	<<tearful>> you gather yourself.

	<<clotheson>>
	<<endcombat>>

	<<link [[Next|Beast Rape]]>><<set $eventskip to 1>><</link>>

<<else>>

	Insert text about the beast stopping because you asked it to.

	<<tearful>> you gather yourself.

	<<clotheson>>
	<<endcombat>>

	<<link [[Next|Beast Rape]]>><<set $eventskip to 1>><</link>>

<</if>>

:: Beast Rape
<<if $molestationstart is 1>>
	<<set $molestationstart to 0>>
	<<controlloss>>
	<<violence 1>>
	<<neutral 1>>
	<<molested>>

	<<beastNEWinit 2 dog>>/* - Delete if beasts are already generated*/
	<<beastCombatInit>>
	<<beastTrainGenerate>>/* - Delete if there aren't multiple beasts*/
<</if>>

<<effects>>
<<effectsman>>

<<beast $enemyno>>

<<stateman>>

<<actionsman>>

<<if $enemyhealth lte 0>>
	<<link [[Next|Beast Rape Finish]]>><</link>><<nexttext>>
<<elseif $enemyarousal gte $enemyarousalmax>>
	<<link [[Next|Beast Rape Finish]]>><</link>><<nexttext>>
<<else>>
	<<link "Next">><><</link>><<nexttext>>
<</if>>

:: Beast Rape Finish
<<effects>>

<<if $enemyarousal gte $enemyarousalmax>>

	<<beastejaculation>>

	Insert text about the aftermath of the beast cumming.

	<<tearful>> you gather yourself.

	<<clotheson>>
	<<endcombat>>

	<<link [[Next|Beast Rape]]>><<set $eventskip to 1>><</link>>

<<elseif $enemyhealth lte 0>>

	Insert text about the beast running.

	<<tearful>> you gather yourself.

	<<clotheson>>
	<<endcombat>>

	<<link [[Next|Beast Rape]]>><<set $eventskip to 1>><</link>>

<<else>><<set $rescued += 1>>

	Insert text about being rescued.

	<<tearful>> you gather yourself.

	<<clotheson>>
	<<endcombat>>

	<<link [[Next|Beast Rape]]>><<set $eventskip to 1>><</link>>

<</if>>

:: Beast Gang
<<if $molestationstart is 1>>
	<<set $molestationstart to 0>>
	<<controlloss>>
	<<violence 1>>
	<<neutral 1>>
	<<molested>>

	<<beastNEWinit 1 wolf>>
	<<beastCombatInit>>
	<<beastTrainGenerate>>
	<<enable_rescue>>/*optional*/
<</if>>
<<effects>>
<<effectsman>>

<<beast $enemyno>>

<<stateman>>

<<actionsman>>
<<if $alarm is 1 and $rescue is 1>>
	<<link [[Next|Beast Gang End]]>><</link>><<nexttext>>
<<elseif $enemyarousal gte $enemyarousalmax>>
	<<link [[Next|Beast Gang End]]>><</link>><<nexttext>>
<<elseif $enemyhealth lte 0>>
	<<link [[Next|Beast Gang End]]>><</link>><<nexttext>>
<<else>>
	<<link [[Next|Beast Gang]]>><</link>><<nexttext>>
<</if>>

:: Beast Gang End
<<effects>>
<<if $enemyhealth lte 0>>
	<<beastwound>>
	<<if $combatTrain.length gt 0>>
		The <<beasttype>> recoils in pain and fear, but another is eager for a go.

		<<combatTrainAdvance>>

		[[Next|Beast Gang]]
	<<else>>
		The <<beasttype>> recoils in pain and fear.
		<<combatTrainAdvance>>

		<<link [[Next|Beast Gang End]]>><<set $finish to 1>><</link>>
	<</if>>
<<elseif $enemyarousal gte $enemyarousalmax>>
	<<beastejaculation>>
	<<if $combatTrain.length gt 0>>
		Satisfied, the <<beasttype>> moves and another takes its turn.

		<<combatTrainAdvance>>

		[[Next|Beast Gang]]
	<<else>>
		Satisfied, the <<beasttype>> moves away from you.
		<<combatTrainAdvance>>

		<<link [[Next|Beast Gang End]]>><<set $finish to 1>><</link>>
	<</if>>
<<elseif $finish is 1>>
	<<if $enemywounded is 1 and $enemyejaculated is 0>>
		The <<beasttype>> whimpers and flees.
	<<elseif $enemywounded is 0 and $enemyejaculated is 1>>
		Satisfied, the <<beasttype>> leaves.
	<<elseif $enemywounded gte 2 and $enemyejaculated is 0>>
		Feeling that you're more trouble than you're worth, the beasts flee.
	<<elseif $enemywounded is 0 and $enemyejaculated gte 2>>
		The beasts leave you spent and shivering.
	<<elseif $enemywounded gte 1 and $enemyejaculated gte 1>>
		The beasts leave you spent and shivering.
	<</if>>

	<<tearful>> you gather yourself.

	<<clotheson>>
	<<endcombat>>
	<<destinationeventend>>
<<elseif $alarm is 1 and $rescue is 1>>
	<<set $rescued += 1>>

	You are rescued.

	<<tearful>> you gather yourself.

	<<clotheson>>
	<<endcombat>>
	<<destinationeventend>>
<</if>>

:: Seduce
<<effects>>

<<set $seductiondifficulty to 6000>>
<<seductioncheck>>

<<if $seductionskill lt 1000>>
	You feel more confident in your powers of seduction.

<</if>>
<<seductionskilluse>>

Text detailing your seduction attempt.
<<promiscuity3>>

<<if $seductionrating gte $seductionrequired>>

	Text detailing your seduction success.

<<else>>

	Text detailing your seduction failure.

<</if>>

:: Lock

<<set $lock to 300>>

The door is locked tight.

	<<if $skulduggery gte $lock>>
	The lock looks easy to pick.

	<<link [[Break in (0:05)|Elk Compound Interior]]>><<pass 5>><<crimeup 1>><</link>><<crime>>

	<<else>>
	The lock looks beyond your ability to pick.<<skulduggeryrequired>>

	<</if>>

You successfully pick the lock and enter the building.
<<set $compoundcentre to 1>><<set $compoundalarm += 1>>

<<if $skulduggery lt 400>>
<<skulduggeryskilluse>>
<<else>>
There's nothing more you can learn from locks this simple.
<</if>>

:: Template for a widget that outputs text based on character's state

<<widget "widgetname">>
<<exposure>>/*Makes sure your clothing state is up to date*/
<<if $optionalvariable is "something">>
	<<if $trauma gte (($traumamax / 5) * 4)>>
		<<if $stress gte (($stressmax / 5) * 4)>>
			<<if $arousal gte (($arousalmax / 5) * 4)>>

			<<elseif $arousal gte (($arousalmax / 5) * 1)>>

			<<else>>

			<</if>>
		<<elseif $stress gte (($stressmax / 5) * 1)>>
			<<if $arousal gte (($arousalmax / 5) * 4)>>

			<<elseif $arousal gte (($arousalmax / 5) * 1)>>

			<<else>>

			<</if>>
		<<else>>
			<<if $arousal gte (($arousalmax / 5) * 4)>>

			<<elseif $arousal gte (($arousalmax / 5) * 1)>>

			<<else>>

			<</if>>
		<</if>>
	<<elseif $trauma gte (($traumamax / 5) * 1)>>
		<<if $stress gte (($stressmax / 5) * 4)>>
			<<if $arousal gte (($arousalmax / 5) * 4)>>

			<<elseif $arousal gte (($arousalmax / 5) * 1)>>

			<<else>>

			<</if>>
		<<elseif $stress gte (($stressmax / 5) * 1)>>
			<<if $arousal gte (($arousalmax / 5) * 4)>>

			<<elseif $arousal gte (($arousalmax / 5) * 1)>>

			<<else>>

			<</if>>
		<<else>>
			<<if $arousal gte (($arousalmax / 5) * 4)>>

			<<elseif $arousal gte (($arousalmax / 5) * 1)>>

			<<else>>

			<</if>>
		<</if>>
	<<else>>
		<<if $stress gte (($stressmax / 5) * 4)>>
			<<if $arousal gte (($arousalmax / 5) * 4)>>

			<<elseif $arousal gte (($arousalmax / 5) * 1)>>

			<<else>>

			<</if>>
		<<elseif $stress gte (($stressmax / 5) * 1)>>
			<<if $arousal gte (($arousalmax / 5) * 4)>>

			<<elseif $arousal gte (($arousalmax / 5) * 1)>>

			<<else>>

			<</if>>
		<<else>>
			<<if $arousal gte (($arousalmax / 5) * 4)>>

			<<elseif $arousal gte (($arousalmax / 5) * 1)>>

			<<else>>

			<</if>>
		<</if>>
	<</if>>
<<else>>
	<<if $trauma gte (($traumamax / 5) * 4)>>
		<<if $stress gte (($stressmax / 5) * 4)>>
			<<if $arousal gte (($arousalmax / 5) * 4)>>

			<<elseif $arousal gte (($arousalmax / 5) * 1)>>

			<<else>>

			<</if>>
		<<elseif $stress gte (($stressmax / 5) * 1)>>
			<<if $arousal gte (($arousalmax / 5) * 4)>>

			<<elseif $arousal gte (($arousalmax / 5) * 1)>>

			<<else>>

			<</if>>
		<<else>>
			<<if $arousal gte (($arousalmax / 5) * 4)>>

			<<elseif $arousal gte (($arousalmax / 5) * 1)>>

			<<else>>

			<</if>>
		<</if>>
	<<elseif $trauma gte (($traumamax / 5) * 1)>>
		<<if $stress gte (($stressmax / 5) * 4)>>
			<<if $arousal gte (($arousalmax / 5) * 4)>>

			<<elseif $arousal gte (($arousalmax / 5) * 1)>>

			<<else>>

			<</if>>
		<<elseif $stress gte (($stressmax / 5) * 1)>>
			<<if $arousal gte (($arousalmax / 5) * 4)>>

			<<elseif $arousal gte (($arousalmax / 5) * 1)>>

			<<else>>

			<</if>>
		<<else>>
			<<if $arousal gte (($arousalmax / 5) * 4)>>

			<<elseif $arousal gte (($arousalmax / 5) * 1)>>

			<<else>>

			<</if>>
		<</if>>
	<<else>>
		<<if $stress gte (($stressmax / 5) * 4)>>
			<<if $arousal gte (($arousalmax / 5) * 4)>>

			<<elseif $arousal gte (($arousalmax / 5) * 1)>>

			<<else>>

			<</if>>
		<<elseif $stress gte (($stressmax / 5) * 1)>>
			<<if $arousal gte (($arousalmax / 5) * 4)>>

			<<elseif $arousal gte (($arousalmax / 5) * 1)>>

			<<else>>

			<</if>>
		<<else>>
			<<if $arousal gte (($arousalmax / 5) * 4)>>

			<<elseif $arousal gte (($arousalmax / 5) * 1)>>

			<<else>>

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

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

	<<else>>

	<</if>>

<<if $test is "" or $test is undefined>><<set $test to "default">><</if>>
<<textbox "$test" $test>>

<<if $physique gte $rng * 100 + 6000>>

<</if>>

		<<if $npcspeechcycle is 0>>
		<<He>> speaks. ""
		<<elseif $npcspeechcycle is 1>>
		<<He>> speaks. ""
		<<elseif $npcspeechcycle is 2>>
		<<He>> speaks. ""
		<<elseif $npcspeechcycle is 3>>
		<<He>> speaks. ""
		<<elseif $npcspeechcycle is 4>>
		<<He>> speaks. ""
		<<elseif $npcspeechcycle is 5>>
		<<He>> speaks. ""
		<<else>>
		<<He>> speaks. ""
		<</if>>

:: Save and load NPC
<<generate1>><<generate2>>
<<saveNPC 0 "john">>
<<saveNPC 1 "jane">>
<<endevent>>

<<loadNPC 0 "john">><<person1>>
<<loadNPC 1 "jane">><<person2>>

<<endevent>>

<<if $per_npc.john isnot undefined>>
	<<loadNPC 0 "john">><<person1>>
	<<endevent>>
<</if>>
<<if $per_npc.jane isnot undefined>>
	<<loadNPC 0 "jane">><<person1>>
	<<endevent>>
<</if>>

<<clearNPC "john">>
<<clearNPC "jane">>

:: Misc

$NPCName[$NPCNameList.indexOf("Robin")].love
<<npcincr Robin love 1>>

<<for _i to 0; _i lt $NPCName.length; _i++>>
<</for>>

<<set $antiquemoney += 40>><<museumAntiqueStatus "antiqueforestdagger" "found">>

/*To capitalise the first letter of a string:*/
<<print $string.toLocaleUpperFirst()>>

/*Using .length with a generic object*/
<<set _skin_keys to Object.keys(setup.bodywriting)>>
<<for _s to 0; _s lt _skin_keys.length; _s++>>
	<<print setup.bodywriting[_skin_keys[_s]].writing>>

<</for>>

:: Tentacles
<<effects>>

<<if $molestationstart is 1>>
	<<set $molestationstart to 0>>
	<<set $combat to 1>>
	<<set $enemytype to "tentacles">>
	<<molested>>
	<<controlloss>>

	<<tentaclestart 8 15>>

<</if>>

<<statetentacles>>

<<effects>>
<<effectstentacles>>
<<tentacles>>
<<actionstentacles>>

<<if $tentacles.active lte ($tentacles.max / 2)>>
	<<link [[Next|Tentacles Finish]]>><</link>><<nexttext>>
<<else>>
	<<link [[Next|Tentacles]]>><</link>><<nexttext>>
<</if>>

:: Tentacles Finish
<<effects>>

Description of escaping/being left alone by the tentacles.

<<tearful>> you escape.

<<clotheson>>
<<endcombat>>

<<link [[Next|Tentacles]]>><</link>>

/*How to destroy a cursed item, replacing "face" with the slot in question:*/
<<set $worn.face.type.push("broken")>>
<<faceruined>>

<<if $exposed gte 2 and $exhibitionism lt 95 or $exposed gte 2 and $uncomfortable.nude is true>>

<<else>>

<</if>>

:: Masturbation

<<effects>>
<<if $masturbationstart is 1>>
	<<set $masturbationstart to 0>>
	<<set $masturbationstat += 1>>
	<<masturbationstart>>
<</if>>
<<masturbationeffects>>
<<masturbationactions>>
<<link [[Continue|Masturbation]]>><</link>><<nexttext>>

<<link [[Stop|Masturbation Finish]]>><<set $finish to 1>><</link>>

:: Masturbation Finish

<<effects>>
Optional text about finishing masturbating.

<<endmasturbation>>
<<endcombat>>

<<tearful>> you continue on your adventure.

<<link [[Next|Masturbation]]>><<clotheson>><</link>>

/*Splits text by NPC genitals and breastsize*/
<<if $NPCList[0].penis isnot "none">>
	<<if $NPCList[0].breastsize gte 3>>
		They have a penis and reasonably sized breasts.
	<<else>>
		They have a penis and small/no breasts.
	<</if>>
<<else>>
	<<if $NPCList[0].breastsize gte 3>>
		They have no penis and reasonably sized breasts.
	<<else>>
		They have no penis and small/no breasts.
	<</if>>
<</if>>

:: Physique Check

<<physiquedifficulty arg1 arg2>>/*On previous passage after link. Displays the difficulty. First argument is the physique required to have any chance of success. Second argument is the physique required to have a 100% chance of success. Argument 1 defaults to 1 if left blank. Argument 2 defaults to $physiquemax if left blank, which is 20000 as of 0.2.9.0. Argument 3 accepts true and prevents any text from showing in cases where there are multiple checks of the same time in the previous passage*/

/*<<physiquedifficulty arg1 arg2 true>>Optional check just before here when there are multiple checks*/
<<if $physiqueSuccess>>/*Replace 1 and $physiquemax with whatever numbers/variables used as arguments in <<physiquedifficulty>>*/

Text about passing the physique check.

<<else>>

Text about failing the physique check.

<</if>>

:: Encounter Movements

<<He>> positions <<his>> $NPCList[_n].penisdesc in front of your mouth.
<<neutral 5>><<set $mouthuse to "penis">><<set $NPCList[_n].penis to "mouthentrance">><<set $mouthstate to "entrance">><<set $speechmouthentrance to 1>><<set $mouthtarget to _n>>

<<He>> wraps <<his>> legs around your head and presses <<his>> pussy against your mouth.
<<submission 5>><<set $mouthuse to "othervagina">><<set $NPCList[_n].vagina to "mouth">><<set $mouthstate to "othervagina">><<violence 3>><<bruise face>><<set $speechvaginamouth to 1>><<set $mouthtarget to _n>>

<<He>> moves between your legs, positioning <<his>> $NPCList[_n].penisdesc in front of your <<pussy>>.
<<neutral 5>><<set $vaginause to "penis">><<set $NPCList[_n].penis to "vaginaentrance">><<set $vaginastate to "entrance">><<set $speechvaginaentrance to 1>><<set $vaginatarget to _n>>

<<set $penisuse to "othervagina">><<set $NPCList[_n].vagina to "penisentrance">><<set $penisstate to "entrance">><<set $penistarget to _n>>
<<He>> straddles you, <<his>> pussy hovering close to your <<penis>>.

<<He>> moves between your legs, positioning <<his>> $NPCList[_n].penisdesc in front of your <<bottom>>.
<<neutral 5>><<set $anususe to "penis">><<set $NPCList[_n].penis to "anusentrance">><<set $anusstate to "entrance">><<set $speechanusentrance to 1>><<set $anustarget to _n>>

:: Monster Selection

<<if ($monsterchance gte 1 and $hallucinations gte 1) or ($monsterchance gte 1 and $monsterhallucinations is "f")>>
	<<if $malechance lt random(1, 100)>>
		Monstergirl
	<<else>>
		Monsterboy
	<</if>>
<<else>>
	Beast
<</if>>

:: Reminder of how to impact plants outside tending

<<set _garden_location to "garden">>
<<for _i to 0; _i lt $plots[_garden_location].length; _i++>>
	<<set _tending_temp to _i>>
	<<set $plots[_garden_location][_tending_temp].water to 1>>
<</for>>

:: Reminder of how to give plants to the player outside planting

<<tending_harvest red_rose medium 3>>

:: Machine

<<if $molestationstart is 1>>
	<<set $molestationstart to 0>>
	<<controlloss>>
	<<violence 1>>
	<<neutral 1>>

	<<set $machine_health to 10>><<set $machine_ammo to 3>>/*Used by following widget. Must be set.*/
	<<machine_init tattoo vaginal anal arm_chains leg_chains>>/*Include each machine type you want present as an argument*/
	<<set $machine.tattoo.armed to 1>>/*Remove if there's no tattoo gun, or you don't want the tattoo gun to be able to remove tattoos*/
	<<set $machine.vaginal.armed to 1>>/*Remove if there's no vaginal sex machine, or you don't want the sex machine to be able to easily destroy clothes.*/
	<<set $machine.anal.armed to 1>>
	<<prop rails table milk neck_shackle>>/*Delete props as appropriate*/
	<<set $bodywriting_special to "dungeon">>/*Makes all tattoos appropriate for dungeon. Remove for a broader range of tattoos.*/
<</if>>

<<effects>>

<<machine_effects>><<machine_combat>>
<<machine_state>>

/*Debug info. Remove from playable events*/
Number of active machines: <<print $machine.number>>

<<if $machine.tattoo>>
	Tattoo gun use: <<print $machine.tattoo.use>>

	Tattoo gun state: <<print $machine.tattoo.state>>

	Tattoo gun health: <<print $machine.tattoo.health>>

	Tattoo gun hack: <<print $machine.tattoo.hack>>

<</if>>

<<if $machine.vaginal>>
	Phallic machine use: <<print $machine.vaginal.use>>

	Phallic machine state: <<print $machine.vaginal.state>>

	Phallic machine health: <<print $machine.vaginal.health>>

	Phallic machine hack: <<print $machine.vaginal.hack>>

<</if>>

<<if $machine.anal>>
	Small phallic machine use: <<print $machine.anal.use>>

	Small phallic machine state: <<print $machine.anal.state>>

	Small phallic machine health: <<print $machine.anal.health>>

	Small phallic machine hack: <<print $machine.anal.hack>>

<</if>>

<<if $machine.arm_chains>>
	Arm chains use: <<print $machine.arm_chains.use>>

	Arm chains state: <<print $machine.arm_chains.state>>

	Arm chains health: <<print $machine.arm_chains.health>>

	Arm chains hack: <<print $machine.arm_chains.hack>>

<</if>>

<<if $machine.leg_chains>>
	Leg chains use: <<print $machine.leg_chains.use>>

	Leg chains state: <<print $machine.leg_chains.state>>

	Leg chains health: <<print $machine.leg_chains.health>>

	Leg chains hack: <<print $machine.leg_chains.hack>>

<</if>>
/*Debug info end*/

<<machine_actions>>

<<if $machine.number lte 0 or $finish is 1>>
	<<link [[Next|Machine End]]>><</link>>
<<else>>
	<<link [[Next|Machine]]>><</link>>
<</if>>

<<link [[End|Machine End]]>><</link>>

:: Machine End
<<effects>>

<<machine_end>>
<<clotheson>>

<<link [[Machine]]>><<set $molestationstart to 1>><</link>>

:: Struggle
<<effects>>

<<if $struggle_start is 1>>
	<<struggle_init>>
	<<set $struggle.creature to "lurker">>/*Creature species*/
	<<struggle_creatures 5 2>>/*How many creatures will be involved, and their health.*/
	<<set $combat to 1>>
	<<controlloss>>
	<<violence 1>>
	<<molested>>
	<<set $struggle.mouth.creature to "lurker">><<set $mouthuse to "struggle">><<set $mouthstate to "struggle">><<set $struggle.enemy[0].location to "mouth">>/*Encounters can begin with a creature already attached to a body part. Optional.*/
	<<unset $struggle_start>>
<</if>>

<<if $condition is "met">>
	<<struggle_add 1 1>>/*Adds more creatures, with a specific health.*/
	Another creature attacks!

<</if>>

<<struggle>>

<<if $struggle.done gte $struggle.number>>
	<<link [[Next|Struggle End]]>><</link>>

<<else>>
	<<link [[Next|Struggle]]>><</link>>

<</if>>

:: Struggle End
<<effects>>

Stuff happens.

<<clotheson>>
<<endcombat>>

<<link [[Next|Struggle]]>><<set $struggle_start to 1>><</link>>

/*Farm stage reminders:
$farm_stage = 1: Alex met, farm work explained.
$farm_stage = 2: Farm work accepted. 1 field clear
$farm_stage = 3: Worked at the farm a little, harasser appeared.
$farm_stage = 4: 2 fields clear. Alex offered booze.
$farm_stage = 5: 3 fields clear. Remy threatened Alex.
$farm_stage = 6: 4 fields clear. Alex's parent visits.
$farm_stage = 7: Time passed since Alex's parent's visit. Bailey visits. Fields are now controlled by the player, steeds can be saddled, and Alex can be chosen as a love interest. Attacks begin. Wall can be upgraded.
$farm_stage = 8: 5 fields clear. More upgrades can be bought.
$farm_stage = 9: 6 fields clear. Lab unlocked. 1 phial available for PC to sell to compound.
$farm_stage = 10: 7 fields clear. "Hurl net" ability unlocked, and more phials can now be produced.
$farm_stage = 11: 8 fields clear. Strange flowers can now be grown.
$farm_stage = 12: 9 fields clear. Remy threatens again.
*/

:: Stalk

<<if $molestationstart is 1>>
	<<set $molestationstart to 0>>
	<<violence 1>>
	<<neutral 1>>

	<<maninit>>
	<<stalk_init>>
	<<if $daystate isnot "night">>
		<<enable_rescue>>/*Remove if rescue is impossible*/
	<</if>>
	<<set $location to "town">>
<</if>>

<<effects>>

<<effectsman>><<man>>

<<if $audience_active>>
	<<audience>>
<</if>>

<<stateman>>

<<actionsman>>

<<if $enemyhealth lte 0>>
	<<link [[Next|Stalk Finish]]>><</link>><<nexttext>>
<<elseif $enemyarousal gte $enemyarousalmax>>
	<<link [[Next|Stalk Finish]]>><</link>><<nexttext>>
<<elseif $alarm is 1 and $rescue is 1>>
	<<link [[Next|Stalk Finish]]>><</link>><<nexttext>>
<<elseif $stalk_end>>/*Not usually needed */
	<<link [[Next|Stalk Finish]]>><</link>><<nexttext>>
<<else>>
	<<link [[Next|Stalk]]>><</link>><<nexttext>>
<</if>>

:: Stalk Finish
<<effects>>
<<if $enemyarousal gte $enemyarousalmax>>
	<<ejaculation>>
	<<if $combat_end_text>>
		<<print $combat_end_text>>
	<<else>>
		Text about the aftermath of them cumming.
	<</if>>

	<<tearful>> you recover.

	<<clotheson>>
	<<endcombat>>
	<<link [[Next|Stalk]]>><<set $molestationstart to 1>><</link>>/*Link points wherever you want the player to end up*/

<<elseif $enemyhealth lte 0>>
	Text about escaping.

	<<tearful>> you recover.

	<<clotheson>>
	<<endcombat>>
	<<link [[Next|Stalk]]>><<set $molestationstart to 1>><</link>>
<<elseif $stalk_end is "escaped">>
	You slow to a walk. <<tearful>> you continue your journey.

	<<clotheson>>
	<<endcombat>>

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

<<elseif $stalk_end is "passed">>
	You take a deep breath. <<tearful>> you continue your journey.

	<<clotheson>>
	<<endcombat>>

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

<<elseif $stalk_end is "hide">>
	<<covered>> <<tearful>> you emerge from your hiding place. You continue your journey.

	<<set $stealtextskip to 1>>
	<<stealclothes>>
	<<clotheson>>
	<<endcombat>>

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

<<elseif $stalk_end is "outpaced">>/*Unnecessary if the PC can't become the pursuer */
	<<if $exposed gte 1>>
		<<switch $location>>
		<<case alley>>
			<<tearful>> you slow to a stop. <<covered>> There's no one around, but this is still a public place.
		<<case forest lake>>
			<<tearful>> you slow to a stop. <<covered>> There's no one around right now, but there's no knowing who you could meet in the woods.
		<<case moor>>
			<<tearful>> you slow to a stop. <<covered>> There's no one around, but being exposed in such an open place is frightening regardless.
		<<default>>
			<<covered>> <<tearful>> you dive down an alley, hoping to shield your body from any prying eyes.
		<</switch>>
	<<else>>
		<<tearful>> you slow to stop.
	<</if>>

	<<set $stealtextskip to 1>>
	<<stealclothes>>
	<<clotheson>>
	<<endcombat>>

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

<<else>>
	<<set $rescued += 1>>/*Unnecessary if rescue is impossible*/
	<<if $position is "stalk">>
		Text about being rescued while pursued.
	<<else>>
		Text about being rescued while assaulted.
	<</if>>

	<<tearful>> you recover.

	<<clotheson>>
	<<endcombat>>
	<<link [[Next|Stalk]]>><<set $molestationstart to 1>><</link>>

<</if>>

<<link [[Escape!|Domus Street]]>><<endevent>><</link>>