code:
:: School Library
<<set $outside to 0>><<set $location to "school">><<schooleffects>><<effects>><<set $bus to "schoollibrary">>
You are in the school library.
<<if $schoolday is 1>>
	/* indev - double
 replaced with single */
	<<if $schoolstate is "early">>
		The library is devoid of people, it being so early in the day.

	<<elseif $schoolstate is "late">>
		The library is devoid of people, students and teachers having gone home for the day.

	<<elseif $schoolstate is "lunch">>
		The room is packed with students using their lunch break to catch up with homework.

	<<else>>
		Several students are present, working at the desks and searching among the bookshelves.

	<</if>>
<<elseif $schoolday isnot 1>>
	The library is devoid of people.

<</if>>
/*indev - Extra library description*/
A large desk sits near the back of the library, with a sign reading "Book Rental + Clothing" hanging above.

There are several shelves with typical academic literature. You see books on engineering, biology, social sciences and language learning. Everything that is useful in catching up.

Next to it is a small basket with returned and not yet sorted books.
<<if ($month is "november" and $monthday gte 24) or $month is "december">>
	You notice a strange, olive-coloured book tucked amidst the rest.
<</if>>
<<if $english lt 200>>
	You wonder if there may be something more interesting here if you were one of those bookworms.
<</if>>

/* Just some hints and tips for the player */
<<if $schoolday is 1 and $schoolstate isnot "early" and $schoolstate isnot "late" and random(1, 3) is 1>>

	You overhear some students talking to each other.

	<<if $rng gte 96>>
		"Did you know that some nerds sneak into the library at night in order to study?"

		"Don't be ridiculous, as if someone would be such a dork."
	<<elseif $rng gte 91>>
		"It's awful! I just know that I totally failed the exam."

		"I told you to study properly!"
	<<elseif $rng gte 86>>
		"I couldn't concentrate at all at the exam since my anxiety always goes through the roof..."

		"I usually just rub one out at the toilets beforehand in order to relax."

		"Weirdo."
	<<elseif $rng gte 81>>
		"How do you manage to get good grades but still have so much free time left?"

		"That's easy! I study each day for a short period of time. You see, the human brain can't handle too much information at once so it's more effective to spread out your study time."

		"I always work through the night before a test..."
	<<elseif $rng gte 76>>
		"Winter once mentioned that there is a secret path connecting the school toilets to the sewer."

		"I wouldn't know. I never pay attention in class."
	<<elseif $rng gte 71>>
		"Do you know that girl who went missing for a month?"

		"The one living at the orphanage?"

		"Yeah, that one. I have no idea what happened to her, but she changed completely. Sometimes she screams in terror for no apparent reason. Some even think she can see things others don't."

		"Like ghosts? Do you believe that, too?"

		"Of course not! Ghosts only exist in movies or games."
	<<elseif $rng gte 66>>
		"Did you know that you learn more when you're naked?"

		"For the last time, I will never take off my clothes when we study together."
	<<elseif $rng gte 61>>
		"What's with those dorky glasses?"

		"They help me to focus in class."

		"How would that even work? Do you even need to wear them?"

		"No, but whenever I wear them, I feel like a nerd and subconsciously act like one thereby paying more attention to the teacher."

		"Have you tried feeling more like a normal person?"
	<<elseif $rng gte 56>>
		"Why in the world do we have to pay to take books home? We'd all do so much better with easier access to the material."

		"I don't know, but you'd better make sure to return them on time. The librarian's assistant is a terror."

		"I heard about <<nnpc_him "Sydney">>. Isn't <<nnpc_he "Sydney">> one of the teachers' kids?"

		"Apparently. Last time I returned a book late, I couldn't get the marker off my skin for days..."
	<<elseif $rng gte 51>>
		"You ever try reading that red book? The one with the lovers?"

		"What?"

		"I tried a few pages, and ended up reading the whole thing. I swear it felt like a spiritual experience. I can't stop thinking about it."

		"...What?"
	<<elseif $rng gte 31>>
		"<<print either("If you think about it, neither of us are really here.","Hey, listen. You hear that? It's nothing.","Don't knock it 'till you try it. Jazz metal just works.","Winter's actually kinda hot, in a fossil kinda way.","I'd let a wolf knot me, to be honest.","If quizzes are quizzical, then what are tests?","You. Me. That bookshelf. Library dodgeball. You in?","I haven't seen a single recycling bin in this school. Unbelievable.","The canteen food is actually pretty good. It's a guilty pleasure of mine.","Oh, to be a caterpillar, unaware of the woes of the world.", "Someone said they saw a whale that had, like, tentacles, like a squid. Think squids and whales finally put their differences aside and got busy?","Have you seen the masked figure in the meadow? They say there's a whole secret society out there. Do you think they get good wifi?")>>"

		"<<print either ("Why am I friends with you?","I told you to stop hanging out with me.","What the fuck?","I'm out of here.","Can we please have a normal conversation for once?","...What?","Pretty sure you're not supposed to come to school drunk.","I'm calling the police.","I gotta get that restraining order. For real, this time.","Can I peg you?","Can you make like a tree and die for the winter?")>>"

		They're just chattering. Nothing useful.
	<<else>>
		But they're too far for you to hear them properly.
	<</if>>
<</if>>

<<if $exposed gte 1>>
	<<if $schoolday is 1 and $schoolstate isnot "early" and $schoolstate isnot "late">>
		You hide between the bookshelves, doing your best to conceal your <<nudity>>.

	<<else>>
		<<exhibitionclassroom>>
	<</if>>
<</if>>
<<sydneySchedule>>
<<if $stress gte $stressmax>>
	<<link [[Everything fades to black...|School Passout]]>><</link>>
<<elseif _sydney_location is "library" and ($sydneyLeightonConfront is 1 or $leightonAssaulted is 1) and $exposed lte 0 and $NPCName[$NPCNameList.indexOf("Leighton")].init is 1 and $pillory_tenant.special.name isnot "Leighton" and !$sydneyLeightonConfrontTimer>>
	<<unset $sydneyLeightonConfront>><<set $sydneyLeightonConfrontTimer to 7>><<set $corruptionEvent to 1>>
	<<if ($bookStolenKnown isnot undefined and $bookStolenKnown gte 3) or $libraryMoneyStolen gte 1000 or $leightonAssaulted is 1>>
		<<if $leightonAssaulted is 1>>
			<<set $leightonAssaulted to 2>>
		<</if>>
		<<npc "Sydney">><<person1>>
		You hear footsteps behind you, and feel a hand on your shoulder. "Perfect timing." It's Leighton. "It seems you just can't learn your lesson. I should get the police involved with how often you've been stealing from us, but I'll settle for a more... homely punishment instead."

		<<nnpc_He "Leighton">> begins to lead you towards the rental counter. "Your friend will be sharing in your punishment.<<if $studyBooks.stolen isnot "none">><<set $studyBooks.stolen to "none">><<unset $sydneyStolenKnown>> Oh, and I'll be taking that stolen book back.<</if>>"

		The door has been locked behind you. You only now realise that the library is empty, save for the three of you.

		<<link [[Next|Sydney Leighton Spank]]>><<set $phase to 4>><</link>>

	<<else>>
		You see Leighton stood in front of Sydney's counter. <<nnpc_He "Leighton">> seems to be harshly scolding <<nnpc_him "Sydney">> for something. After a moment, Leighton grabs <<nnpc_his "Sydney">> arm and begins to raise <<nnpc_his "Leighton">> voice.

		<<link [[Intervene|Sydney Leighton Intervene]]>><<npcincr Sydney love 1>><</link>><<glove>>

		<<link [[Ignore|Sydney Leighton Ignore]]>><<stress 12>><<npcincr Sydney love -10>><<npcincr Sydney purity -5>><</link>><<ggstress>><<llllove>><<llspurity>><<sydneyWarning>>

	<</if>>
<<else>>
	<<if $arousal gte $arousalmax>>
		<<orgasmLocation "library">>
	<</if>>
	<<if $exposed gte 1 and $schoolday is 1 and $schoolstate isnot "early" and $schoolstate isnot "late">>
	<<else>>
		<<if $exposed lte 0>>
			<<if _sydney_location is "library" and ($sydneySeen is undefined or !$sydneySeen.includes("library"))>>
				<<if $sydneySeen>>Sydney<<else>>A student<</if>> sits at the rental counter, shuffling papers and stamping cards.

				<<link [[Counter|Sydney Library Intro]]>><</link>>

			<<elseif _sydney_location isnot "library">>
				<<link [[Counter|Library Rental Counter]]>><<set $counterApproach to 1>><</link>>

			<<elseif _sydney_location is "library">>
				Sydney sits at the desk of the rental counter, shuffling papers and stamping cards.

				<<link [[Approach Sydney|Library Rental Counter]]>><<set $counterApproach to 1>><</link>>

			<</if>>
		<</if>>
		<<projectoptions>>
		<<if $exposed lte 0 and $schoolday is 1 and ($schoolstate is "morning" or $schoolstate is "afternoon" or $schoolstate is "lunch") and $mathsproject is "ongoing" and $mathslibrarystudent isnot 1 and $mathslibraryknown isnot 1>>
			You see a student working on a solution for the maths competition.

			<<link [[Approach|Maths Library Student]]>><</link>>

		<</if>>
		<<if $exposed lte 0 and $NPCName[$NPCNameList.indexOf("Kylar")].state is "active" and ($weather is "rain" or $weather is "snow") and $schoolstate is "lunch" and $luncheaten is 1>>
			Kylar sits at a desk, scribbling something.

			<<link [[Approach Kylar|Kylar Library]]>><<set $kylar_text_trigger to true>><</link>>

		<</if>>
		<<if $exposed gte 1>>
			<<scienceicon>><<link [[Study science (0:20)|Library Study Exposed]]>><<pass 20>><<set $phase to 1>><</link>><<gscience>>

			<<mathicon>><<link [[Study maths (0:20)|Library Study Exposed]]>><<pass 20>><<set $phase to 2>><</link>><<gmaths>>

			<<englishicon>><<link [[Study English (0:20)|Library Study Exposed]]>><<pass 20>><<set $phase to 3>><</link>><<genglish>>

			<<historyicon>><<link [[Study history (0:20)|Library Study Exposed]]>><<pass 20>><<set $phase to 4>><</link>><<ghistory>>

		<<else>>
			<<scienceicon>><<link [[Study science (0:20)|Library Study]]>><<pass 20>><<set $phase to 1>><</link>><<gscience>>

			<<mathicon>><<link [[Study maths (0:20)|Library Study]]>><<pass 20>><<set $phase to 2>><</link>><<gmaths>>

			<<englishicon>><<link [[Study English (0:20)|Library Study]]>><<pass 20>><<set $phase to 3>><</link>><<genglish>>

			<<historyicon>><<link [[Study history (0:20)|Library Study]]>><<pass 20>><<set $phase to 4>><</link>><<ghistory>>

		<</if>>
		/*indev - scarlet book possible to be taken. English 200+ required*/
		<<if $english gte 300>>
			<<scarleticon>><<link [[Take "Raul and Janet" from the basket (0:01)|ScarletBook1]]>><<pass 1>><<set $scarletExitPassage to "School Library">><</link>>

		<<elseif $english gte 200>>
			<<scarleticon>><<link [[Take the medium-sized scarlet book from the basket (0:01)|ScarletBook1]]>><<pass 1>><</link>>

		<</if>>
		<<if ($month is "november" and $monthday gte 24) or $month is "december">>
			<<oliveicon>><<link [[Take the olive-coloured book from the basket (0:01)|Olive Book 1]]>><<set $oliveExitPassage to "School Library">><<pass 1>><</link>>

		<</if>>

	<</if>>
<<link [[Leave the library (0:01)|Hallways]]>><<pass 1>><</link>>

<</if>>

:: Library Study
<<set $outside to 0>><<set $location to "school">><<schooleffects>><<effects>><<sydneySchedule>><<rngWraith 1>>

<<if $phase is 1>><<scienceskill>>
	You settle down at a desk with a science textbook and read through the material.
<<elseif $phase is 2>><<mathsskill>>
	You settle down at a desk with a maths textbook and read through the material.
<<elseif $phase is 3>><<englishskill>>
	You settle down at a desk with an English textbook and read through the material.
<<elseif $phase is 4>><<historyskill>>
	You settle down at a desk with a history textbook and read through the material.
<</if>>

<<set $danger to random(1, 10000)>><<set $dangerevent to 0>>
<<if $danger gte (9900 - $allure) and $schoolday is 1 and $schoolstate isnot "early" and $schoolstate isnot "late">>
	<<if $rng gte 51>>
		<<generatey1>><<generatey2>>While you are minding your own business, a <<person1>><<person>> and <<person2>><<person>> start harassing you.

		<<link [[Ignore them|School Library Harass]]>><<set $phase to 0>><<trauma 2>><<stress 2>><</link>><<gtrauma>><<gstress>>

		<<link [[Ask the librarian for help|School Library Harass]]>><<set $phase to 1>><<status -10>><</link>><<lcool>>

		<<if $NPCName[$NPCNameList.indexOf("Sydney")].init is 1 and $sydneySeen.includes("library") and _sydney_location is "library">>
			<<link [[Ask Sydney for help|School Library Harass]]>><<set $phase to 2>><</link>>

		<</if>>
	<<elseif _wraithEvent>>
		After some time, you begin to feel anxious. You move to replace your textbook in the bookshelf.

		You catch a brief glimpse of a pale face through the gaps on the other side. <<stress 12>><<ggstress>><<trauma 4>><<gtrauma>>

		<<link [[Next|School Library]]>><</link>>

	<<else>>
		<<if !$worn.over_lower.type.includes("naked")>>
			<<set $worn.over_lower.integrity -= 10>>
			<<if $worn.over_lower.integrity lte 0>>
				As you rise from the chair, you hear a tear. Your $worn.over_lower.name <<overlowerplural>> caught on the desk. You try to free them, but <<overloweritis>> torn clean off your body<<if !$worn.lower.type.includes("naked")>>, exposing your <<undies>><</if>>.
				<<overlowerruined>><<trauma 3>>

			<<elseif $worn.over_lower.integrity gte 0>>
				As you rise from the seat, you hear a tear. Your $worn.over_lower.name <<overlowerplural>> caught on the desk.

			<</if>>
		<<else>>
			<<set $worn.lower.integrity -= 10>>
			<<if $worn.lower.integrity lte 0>>
				As you rise from the chair, you hear a tear. Your $worn.lower.name <<lowerplural>> caught on the desk. You try to free them, but <<loweritis>> torn clean off your body, exposing your <<undies>>.
				<<lowerruined>><<trauma 3>>

			<<elseif $worn.lower.integrity gte 0>>
				As you rise from the seat, you hear a tear. Your $worn.lower.name <<lowerplural>> caught on the desk.

			<</if>>
		<</if>>
		<<link [[Next|School Library]]>><</link>>

	<</if>>
<<else>>
	<<link [[Next|School Library]]>><</link>>

<</if>>

:: Library Study Exposed
<<set $outside to 0>><<set $location to "school">><<schooleffects>><<effects>><<rngWraith 1>>

<<if $phase is 1>>
	You settle down at a desk with a science textbook and read through the material. Being sat here in the school library with your <<lewdness>> on display feels naughty, even with no one around. It keeps you alert and focused.
	<<gscience>><<scienceskill>><<garousal>><<arousal 300>>
<<elseif $phase is 2>>
	You settle down at a desk with a maths textbook and read through the material. Being sat here in the school library with your <<lewdness>> on display feels naughty, even with no one around. It keeps you alert and focused.
	<<gmaths>><<mathsskill>><<garousal>><<arousal 300>>
<<elseif $phase is 3>>
	You settle down at a desk with an English textbook and read through the material. Being sat here in the school library with your <<lewdness>> on display feels naughty, even with no one around. It keeps you alert and focused.
	<<genglish>><<englishskill>><<garousal>><<arousal 300>>
<<elseif $phase is 4>>
	You settle down at a desk with a history textbook and read through the material. Being sat here in the school library with your <<lewdness>> on display feels naughty, even with no one around. It keeps you alert and focused.
	<<ghistory>><<historyskill>><<garousal>><<arousal 300>>
<</if>>

<<set $danger to random(1, 10000)>><<set $dangerevent to 0>>
<<if $danger gte (9900 - ($allure / 2))>>
	<<if $rng gte 51>>
		<<generate1>><<person1>>You fumble the book as you try to place it on its shelf. It thumps against the floor. "That better not be another cat," a voice responds from the corridor outside. You take cover behind the shelf and peek between the books. A <<person>> wearing a security uniform enters. "Who's there?"

		<<if $exposed gte 2>>
			<<if $exhibitionism gte 75>>
				<<link [[Show yourself|Library Study Show]]>><<set $phase to 0>><</link>><<exhibitionist5>>

			<</if>>
		<<elseif $exposed is 1>>
			<<if $exhibitionism gte 15>>
				<<link [[Show yourself|Library Study Show]]>><<set $phase to 1>><</link>><<exhibitionist2>>

			<</if>>
		<</if>>
		<<link [[Stay hidden (0:10)|Library Study Hide]]>><<stress 3>><<pass 10>><</link>><<gstress>>

	<<elseif _wraithEvent>>
		After some time, you begin to feel anxious. You move to replace your textbook in the bookshelf.

		You catch a brief glimpse of a pale face through the gaps on the other side. <<stress 12>><<ggstress>><<trauma 4>><<gtrauma>>

		<<link [[Next|School Library]]>><</link>>

	<<else>>
		<<generate1>><<generate2>><<person1>>A <<person>> and <<person2>><<person>> walk along the street outside the window. They will see you if they look through.

		<<link [[Risk it|Library Study Risk]]>><</link>>

		<<link [[Hide (0:20)|Library Study Pair Hide]]>><<pass 20>><</link>>

	<</if>>
<<else>>
	<<link [[Next|School Library]]>><</link>>

<</if>>

:: Library Study Risk
<<set $outside to 0>><<set $location to "school">><<schooleffects>><<effects>>

<<if $rng gte 81>>
	You ignore the pair, and keep studying. The <<person1>><<person>> glances over <<his>> shoulder and spots you. <<He>> grabs the <<person2>><<persons>> arm and they both grin at you through the glass. <<covered>> You feel your face flush.
	<<gstress>><<garousal>><<stress 3>><<arousal 600>><<fameexhibitionism 2>>

	They move on, still smiling.

<<else>>
	You ignore the pair, and keep studying. They don't notice you.

<</if>>

<<endevent>>
<<link [[Next|School Library]]>><</link>>

:: Library Study Pair Hide
<<set $outside to 0>><<set $location to "school">><<schooleffects>><<effects>>

You take cover in the darkness behind the librarian's desk. The pair stop by the window, turn and start to chat. You wait until they move on.

<<endevent>>
<<link [[Next|School Library]]>><</link>>

:: Library Study Hide
<<set $outside to 0>><<set $location to "school">><<schooleffects>><<effects>>

You remain hidden. <<He>> patrols through the library, but you're able to avoid <<him>>. <<He>> frowns over <<his>> shoulder as <<he>> leaves the room.

<<endevent>>
<<link [[Next|School Library]]>><</link>>

:: Library Study Show
<<set $outside to 0>><<set $location to "school">><<schooleffects>><<effects>>

You step out from your hiding place. The <<persons>> jaw drops when <<he>> sees you.
<<if $phase is 0>>
	<<exhibitionism5>>
<<else>>
	<<exhibitionism2>>
<</if>>

<<if $rng gte 51>>
	"Y-you aren't supposed to be here," <<he>> stammers. "Y-you need to come with me."

	<<link [[Comply|Library Study Comply]]>><</link>>

	<<link [[Refuse (0:20)|Library Study Refuse]]>><<pass 20>><</link>>

<<else>>
	"What a treat," <<he>> says. <<He>> thumbs <<his>> baton as <<he>> steps closer, then lunges for you.

	<<link [[Next|Library Exposed Molestation]]>><<set $molestationstart to 1>><</link>>

<</if>>

:: Library Exposed Molestation
<<if $molestationstart is 1>>
	<<set $molestationstart to 0>>
	<<controlloss>>
	<<violence 1>>
	<<neutral 1>>
	<<molested>>

	<<maninit>>
<</if>>

<<effects>>

<<effectsman>><<man>>

<<stateman>>

<<actionsman>>

<<if $enemyhealth lte 0>>
	<<link [[Next|Library Exposed Molestation Finish]]>><</link>><<nexttext>>
<<elseif $enemyarousal gte $enemyarousalmax>>
	<<link [[Next|Library Exposed Molestation Finish]]>><</link>><<nexttext>>
<<else>>
	<<link [[Next|Library Exposed Molestation]]>><</link>><<nexttext>>
<</if>>

:: Library Exposed Molestation Finish
<<effects>>
<<if $enemyarousal gte $enemyarousalmax>>
	<<ejaculation>>

	"You're lucky I don't turn you in," <<he>> says. "They'd eat a <<girl>> like you alive." <<He>> whistles as <<he>> leaves the library.

	<<tearful>> you struggle to your feet.

	<<clotheson>>
	<<endcombat>>

	<<link [[Next|School Library]]>><</link>>/*Point links wherever you want the player to end up*/
<<elseif $enemyhealth lte 0>>
	<<He>> stumbles away from you and fumbles for <<his>> baton. It slips from <<his>> fingers. "Fuck," <<he>> says, then runs from the library.

	<<tearful>> you listen to <<his>> footsteps fade.

	<<clotheson>>
	<<endcombat>>

	<<link [[Next|School Library]]>><</link>>
<</if>>

:: Library Study Comply
<<set $outside to 0>><<set $location to "school">><<schooleffects>><<effects>>

You nod and walk to the <<persons>> side with nary a care. <<He>> blushes and looks away. "I-I'll escort you from the premises," <<he>> says. "P-please."

You follow <<him>> down the corridor toward the entrance. "H-here," <<he>> says at the school gates. <<He>> hands you some towels. "You'll catch a cold." <<He>> locks the gate behind you.

<<towelup>>
<<endevent>>
<<link [[Next|Oxford Street]]>><</link>>

:: Library Study Refuse
<<set $outside to 0>><<set $location to "school">><<schooleffects>><<effects>>

<<He>> chases you down the aisles. You avoid <<him>> with ease. <<He>> seems afraid of touching you, lest <<he>> come in contact with something <<he>> shouldn't. After some time <<he>> stops, panting. "I-if anyone asks," <<he>> says. "I never saw you." <<He>> leaves the room.

<<endevent>>
<<link [[Next|School Library]]>><</link>>

:: School Library Harass
<<set $outside to 0>><<set $location to "school">><<schooleffects>><<effects>>

<<if $phase is 0>>
	<<if $rng gte 81>>
		The <<person1>><<person>> looks at the <<person2>><<person>> and smiles. "<<pShe>> thinks <<pshe>> can ignore us." <<person1>><<He>> gags you with <<his>> hand.

		<<link [[Next|School Library Molestation]]>><<set $molestationstart to 1>><</link>>

	<<else>>
		You ignore their pestering until they tire and leave you alone.

		<<link [[Next|School Library]]>><<endevent>><</link>>
	<</if>>
<<elseif $phase is 1>>
	<<generate3>><<person3>>You shout for help. Several people arrive to investigate, including the librarian. <<He>> glares at the pair. "You two again. Out."

	<<person2>>The <<person>> looks indignant. "We're just play-"

	The librarian interrupts. "I said OUT." The pair comply, leaving you in peace.

	<<person3>>The librarian asks if you're okay, and you nod. Assured that you're fine, <<he>> returns to <<his>> duties.

	<<link [[Next|School Library]]>><<endevent>><</link>>
<<elseif $phase is 2>>
	<<NPCStatusCheck "Sydney">>
	You shout for Sydney. The <<person2>><<person>> sneers. "Oh no, not Sydney, <<nnpc_he "Sydney">>'s gonna write on us, whatever will we do?" The two begin to laugh.

	However, they're cut off by the thwap of a ruler against skin. The <<person1>><<person>> cries out in pain. You turn to see Sydney's furious gaze, just in time for a second ruler to bounce off of the <<person2>><<persons>> head.

	"That fucking hurt! I'm telling."

	<<if _sydneyStatus.includes("corrupt")>>
		Sydney grins. "Oh, really? Who do you think the <<nnpc_title "Leighton">> will believe? Get out. Now."
	<<else>>
		Sydney glares. "You're causing a fuss in a library. You're the one at fault. Leave immediately."
	<</if>>

	The pair grumble, leaving the library while nursing their fresh bruises. You manage to overhear "Fucking teacher's pet religious shitstain" from the <<person1>><<person>>.

	<<if $sydneyromance is 1>>
		<<if _sydneyStatus.includes("corrupt")>>
			As you turn, Sydney grabs you behind the head, pulling you into a kiss. <<takeKissVirginity "Sydney" `($sydneyromance is 1?"loveInterest":"romantic")`>>

			<<nnpc_He "Sydney">> pulls away after a moment.
		<<else>>
			You feel Sydney's arms wrap around you.
		<</if>>
		"I hope they didn't hurt you." You spend some time reassuring <<nnpc_him "Sydney">>, but <<nnpc_he "Sydney">> still seems hesitant to leave your side. After some time, <<nnpc_he "Sydney">> returns to the rental counter, looking back over <<nnpc_his "Sydney">> shoulder a few times.

	<<else>>
		"Are you alright?" Sydney puts a hand on your shoulder. You nod, but Sydney seems hesitant to leave your side. After a moment, <<nnpc_he "Sydney">> returns to the rental counter, looking back over <<nnpc_his "Sydney">> shoulder a few times.

	<</if>>

	<<link [[Next|School Library]]>><<endevent>><</link>>
<</if>>

:: School Library Molestation
<<if $molestationstart is 1>>
	<<set $molestationstart to 0>>
	<<controlloss>>
	<<violence 1>>
	<<neutral 1>>
	<<molested>>

	<<maninit>><<npcidlegenitals>><<hand_gag 0 left>>
	<<if $delinquency lt 400>><<enable_rescue>><</if>>
	<<set $timer to 20>>
<</if>>

<<effects>>

<<if $alarm is 1 and $rescue is 0>>
	<<set $alarm to 0>>
	No one comes to your aid, likely due to your reputation as a delinquent.

<</if>>

<<effectsman>><<man>>

<<stateman>>

<<actionsman>>

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

:: School Library Molestation Finish
<<if $enemyhealth lte 0>>
	They recoil in pain, a glint of fear in their eyes. "Fucking psycho!" They leave you in peace. <<tearful>> you gather yourself.

	<<clotheson>>
	<<endcombat>>

	<<link [[Next|School Library]]>><</link>>
<<elseif $enemyarousal gte $enemyarousalmax>>
	<<ejaculation>>

	<<person1>>The <<person>> looks at the <<person2>><<person>>. "I came first, pay up!"

	The <<person>> shakes <<his>> head. "No way, I started shuddering before you."

	They leave you slumped over the desk. They're still arguing as their voices fade. <<tearful>> you gather yourself.

	<<clotheson>>
	<<endcombat>>

	<<link [[Next|School Library]]>><</link>>
<<elseif $alarm is 1 and $rescue is 1>>
	<<set $rescued += 1>>

	<<endevent>>

	The librarian, startled by your cries, arrives to investigate.

	The pair cease their assault and flee between the bookshelves, as the librarian rushes over to you.

	<<clotheson>>
	<<endcombat>>
	<<exposure>>
	<<generate1>><<person1>>
	<<if $exposed gte 1>>
		<<He>> gives you some towels to cover up with.<<towelup>>
	<</if>>
	"Are you OK?" <<he>> asks.
	<<if $stress gte $stressmax>>
		Your consciousness is already slipping away, however.

		<<endevent>>
		/*ToDo: Pregnancy, remove $pregnancyTesting to properly enable*/
		<<if $sexStats.vagina.pregnancy.waterBreaking is true and $pregnancyTesting>>
			<<pregnancyWatersBrokenPassout "schoolLibrarian">>
		<<else>>
			<<ambulance>>
		<</if>>
	<<elseif $pain gte 100 and $willpowerpain is 0>>
		You try to speak, but instead burst into tears. You feel the librarian's arms around you as you pass out.

		<<endevent>>
		/*ToDo: Pregnancy, remove $pregnancyTesting to properly enable*/
		<<if $sexStats.vagina.pregnancy.waterBreaking is true and $pregnancyTesting>>
			<<pregnancyWatersBrokenPassout "schoolLibrarian">>
		<<else>>
			<<ambulance>>
		<</if>>
	<<elseif $pain gte 20>>
		<<tearful>> you nod and smile at the librarian through your tears. Once assured that you're unhurt, <<he>> returns to <<his>> duties.
		<<endevent>>

		<<link [[Next|School Library]]>><</link>>
	<<else>>
		<<tearful>> you nod and smile at the blushing librarian. Once assured that you're unhurt, <<he>> returns to <<his>> duties.

		<<endevent>>
		<<link [[Next|School Library]]>><</link>>
	<</if>>
<<elseif $timer lte 0>>
	Seeming to grow bored, the pair leave you alone. <<tearful>> you gather yourself.

	<<clotheson>>
	<<endcombat>>

	<<link [[Next|School Library]]>><</link>>
<</if>>

:: Library Rental Counter
<<set $outside to 0>><<set $location to "school">><<schooleffects>><<effects>>
<<sydneySchedule>>
<<if $counterApproach is 1>>
	<<unset $counterApproach>>
	<<set _counterApproach to 1>>
	You approach the rental counter.
<<elseif $schoolShopAction is undefined>>
	You are at the library's rental counter.
<</if>>
<<switch _sydney_location>>
	<<case "library">>
		<<sydneyLibrary>>
	<<case "science">>
		A sign hangs from the front. "In class".

		<<link [[Leave|School Library]]>><<endevent>><<set $eventskip to 1>><</link>>

	<<case "canteen">>
		A sign hangs from the front. "At canteen".

		<<link [[Leave|School Library]]>><<endevent>><<set $eventskip to 1>><</link>>

	<<case "class">>
		A sign hangs from the front. "In class".

		<<link [[Leave|School Library]]>><<endevent>><<set $eventskip to 1>><</link>>

	<<default>>
		<<if $schoolday is 1 and $schoolstate isnot "early" and $schoolstate isnot "late" and _counterApproach is 1>>
			No one's there. You ring the bell. No one responds.
			<<if $hour lt 8 and $sydneyLate is 1 and $sydneySeen and $sydneySeen.includes("library")>>
				It seems Sydney is late<<if $sydneySeen.includes("science")>> again<</if>>.
			<</if>>
		<</if>>
		<<if ($schoolday isnot 1 or $schoolstate is "early" or $schoolstate is "late")>>

			<<bookRentalOptions>>
		<</if>>
		<<if $schoollibrarymoneytheft isnot 1>>

			<<link [[Examine the cash register|School Library Register]]>><</link>>

		<</if>>

		<<link [[Leave|School Library]]>><<endevent>><<set $eventskip to 1>><</link>>

<</switch>>

:: Book Rental
<<set $outside to 0>><<set $location to "school">><<schooleffects>><<effects>>
<<sydneySchedule>><<NPCStatusCheck "Sydney">>
You
<<switch $bookRent>>
	<<case "return">>
		return the<<if $book_rent_timer lt 0>><<set $recentReturnTimer to 14>> overdue<</if>>
		<<switch $phase>>
			<<case 6>>
				<<if $per_npc.pinch isnot undefined>>
					copy of "How <<if $per_npc.pinch.pronoun is "m">>Mr<<else>>Ms<</if>>. Pinch Groped Christmas"
					<<clearNPC pinch>>
				<<else>>
					olive-coloured book.
				<</if>>
			<<case 5>>
				copy of "Raul and Janet".
			<<default>>
				$studyBooks.rented textbook.
		<</switch>>
		<<set $studyBooks.rented to "none">>
		<<if _sydney_location is "library">>
			<<if $book_rent_timer lt 0>>
				<<if $NPCName[$NPCNameList.indexOf("Sydney")].love lt 10>>
					"Late. But at least it isn't damaged. Please try to be more punctual on returns." Sydney writes something down, frowning. <<bookCriminal>>
				<<elseif $sydneyromance is 1>>
					<<if _sydneyStatus.includes("corrupt")>>
						"I wish you'd stay on top of your rentals as well as you stay on top of me," <<he>> says while blushing. <<bookCriminal>>
					<<else>>
						"I wish I could make exceptions for you, but... <<nnpc_Title "Leighton">> Leighton scares me." <<bookCriminal>>
					<</if>>
				<<else>>
					"Late." Sydney looks up. "I know you know better." <<bookCriminal>>
				<</if>>
			<<elseif $book_rent_timer is 14>>
				"That was... fast." Sydney fumbles around with the register for a moment, before handing you <<moneyGain 15>>.
			<<elseif $book_rent_timer gt 7>>
				"Done early?" Sydney fumbles around with the register for a moment, before handing you <<moneyGain 10>>.
			<<else>>
				"Thanks for being punctual!" Sydney happily takes the book from you, before returning it to its place.
			<</if>>
			<<unset $bookOverdue>>
			<<set $book_rent_timer to 0>>

			<<sydneyOptions>>
		<<else>>
			<<set $bookReturnedAbsent to 1>>
			<<set $book_rent_timer to 0>>

			<<bookRentalOptions>>

			<<link [[Leave|School Library]]>><<endevent>><<set $eventskip to 1>><</link>>

		<</if>>
	<<case "rent">>
		rent
		<<if $phase is 6>>
			the strange, olive-coloured book.
			<<switch _sydneyStatus>>
				<<case "corrupt" "corruptLust">>
					Sydney snickers. "I thought this book was for kids. Dunno what it's doing here. But hey, knock yourself out."
				<<default>>
					Sydney smiles. "Oh, I love this old book! <<nnpc_Brother "Jordan">> Jordan used to read it to me every year around Christmastime."
			<</switch>>

			<<He>> slides the book towards you, but stops, staring down at the cover with a frown. "That's weird..." <<He>> starts to thumb through the pages, before shaking <<his>> head and handing it to you. "Enjoy."
		<<elseif $phase is 5>>
			a copy of "Raul and Janet".
			<<switch _sydneyStatus>>
				<<case "pure">>
					<<if $sydneyromance is 1>>
						Sydney smiles at you. "Romance on your mind? I wish it had a happier ending." <<He>> looks down, face flushed. "Do.... do you think we'll get a happy ending?"
					<<else>>
						Sydney looks down at the book and frowns. "A good love story, but I never really got what they were doing near the end. Why did they have to-" <<he>> cuts <<himself>> off. "Oh! Sorry, don't want to spoil it. Enjoy!"
					<</if>>
				<<case "pureLust">>
					Sydney's cheeks turn red. "An... interesting read!<<if $sydneyromance is 1>> Maybe... maybe you can read it to me, sometime.<</if>>" <<He>> slides the book back to you, avoiding eye contact.
				<<case "corrupt">>
					Sydney looks down at the book and grins. "Such a sinful read. Don't have too much fun, now."
				<<case "corruptLust">>
					Sydney looks down at the book and grins. "Such a sinful read. Don't have too much fun, now." <<He>> hands the book back to you<<if $sydneyromance is 1>>, and gently places <<his>> hand on yours when you reach for it. "Maybe we can re-enact Act 3 Scene V sometime." <<arousal 1000>><<garousal>><<else>>.<</if>>
				<<default>>
					Sydney looks down at the book and frowns. "A story full of love and sin." <<if $temple_rank>><<He>> leans in and whispers. "Jordan's actually a big fan of this book, but don't tell <<nnpc_him "Jordan">> I told you! <<nnpc_He "Jordan">> says it's a good cautionary tale of the consequences of lust."<</if>> <<He>> hands the book back to you. "Enjoy."
			<</switch>>
		<<else>>
			a $studyBooks.rented textbook.
			<<if $sydneyromance is 1>>
				Sydney smiles at you. "Look at you, putting the extra work in! I'm proud of you."
			<<else>>
				Sydney smiles. "Thanks for your rental!"
			<</if>>
		<</if>>
		<<set $book_rent_timer to 14>>

		<<sydneyOptions>>
	<<case "renew">>
		renew your rented
		<<if $studyBooks.rented is "Raul and Janet">>
			copy of "Raul and Janet".
		<<elseif $studyBooks.rented is "Pinch">>
			olive-coloured book.
		<<else>>
			$studyBooks.rented textbook.
		<</if>>
		<<set $book_rent_timer to 14>>
		Sydney smiles. "Thanks for staying on top of this.<<if $sydneyromance is 1 and _sydneyStatus.includes("corrupt")>> Now if only you'd stay on top of me.<</if>>"

		<<sydneyOptions>>
	<<case "steal">>
		steal
		<<if $phase is 6>>
			an olive-coloured book.
		<<elseif $phase is 5>>
			a copy of "Raul and Janet".
		<<else>>
			a $studyBooks.stolen textbook.
		<</if>>
		<<set $bookStolen to 1>>

		<<bookRentalOptions>>

		<<link [[Leave|School Library]]>><<endevent>><<set $eventskip to 1>><</link>>

	<<default>>
<</switch>>

:: Book Rental Return Stolen
<<set $outside to 0>><<set $location to "school">><<schooleffects>><<effects>>
<<sydneySchedule>><<NPCStatusCheck "Sydney">>
You return the stolen
<<if $phase is 6>>
	<<if $per_npc.pinch isnot undefined>>
		copy of "How <<if $per_npc.pinch.pronoun is "m">>Mr<<else>>Ms<</if>>. Pinch Groped Christmas"
		<<clearNPC pinch>>
	<<else>>
		olive-coloured book.
	<</if>>
<<elseif $phase is 5>>
	copy of "Raul and Janet".
<<else>>
	$studyBooks.stolen textbook.
<</if>>
<<if _sydney_location is "library">>
	<<if $bookStolenKnown isnot undefined>>
		<<switch $bookStolenKnown>>
			<<case 1>>
				"That's...!" Sydney looks aghast as you hand the book over. "You found it!" Before you can interject, Sydney pulls you into a hug from over the counter.
				"I was so afraid of being punished by <<nnpc_Title "Leighton">> Leighton. You've really saved my <<if _sydneyStatus.includes("corrupt")>>ass<<else>>skin<</if>>." <<npcincr Sydney love 5>><<gglove>>
			<<case 2>>
				<<set $recentReturnTimer to 14>>
				"That book is in the record as stolen. This is the second time you've returned one of those..." Sydney stands up with a look of sudden understanding and frowns at you. "I'm disappointed. But thank you for returning it and being honest." <<bookCriminal>>
			<<default>>
				<<set $recentReturnTimer to 14>>
				Sydney looks to be on the verge of tears. "Why do you keep doing this?! You understand that the <<nnpc_title "Leighton">> will hold me responsible for all this, right?" <<npcincr Sydney love -10>><<lllove>>
		<</switch>>
		<<set $bookStolenKnown += 1>>
		<<unset $sydneyStolenKnown>>
	<<else>>
		Sydney looks at you, confused. "That book was never checked out. Did you just find it laying around?"
	<</if>>
	<<set $studyBooks.stolen to "none">>

	<<sydneyOptions>>
<<else>>
	<<set $bookStolenAbsent to 1>>
	<<set $studyBooks.stolen to "none">>
	<<unset $sydneyStolenKnown>>

	<<bookRentalOptions>>

	<<link [[Leave|School Library]]>><<endevent>><<set $eventskip to 1>><</link>>

<</if>>

repo_name: Area/degrees

license: mit


code:
:: School Lockers
<<set $outside to 0>><<schooleffects>><<effects>><<set $lock to 0>>

The school lockers are notoriously easy to break into.

<<if $schoolstate isnot "early" and $schoolstate isnot "late" and $schoolstate isnot "earlynoschool" and $schoolstate isnot "latenoschool" and $schoolstate isnot "daynoschool">>

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

		<<link [[Break into them (0:30)|School Lockers Sneak]]>><<pass 30>><<crimeup 30>><</link>><<crime>>

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

	<</if>>

<<else>>
	During school there may be valuables left inside them.

<</if>>

<<link [[Leave (0:01)|Hallways]]>><<pass 1>><</link>>

:: School Lockers Sneak
<<set $outside to 0>><<set $location to "school">><<schooleffects>><<effects>>

<<if $rng gte 81>>
	You successfully pick the locks.

	<<if $skulduggery lt 100>>
		<<skulduggeryskilluse>><<set $skulduggery += 5>>
	<<else>>
		There's nothing more you can learn from locks this simple.
	<</if>>

	You find <<moneyGainDisplay 6 true true>> worth of coins scattered around. Probably meant for bus fare.

	<<link [[Take it|School Lockers]]>><<crimeup 1>><<set $money += _money_gain>><</link>><<crime>>

	<<link [[Leave|School Lockers]]>><</link>>

<<elseif $rng gte 61>>
	You successfully pick the locks.

	<<if $skulduggery lt 100>>
		<<skulduggeryskilluse>><<set $skulduggery += 5>>
	<<else>>
		There's nothing more you can learn from locks this simple.
	<</if>>

	There's nothing of interest inside the lockers. Just some pens and pencils strewn around.

	<<link [[Leave|School Lockers]]>><</link>>

<<elseif $rng gte 41>>
	You successfully pick the locks.

	<<if $skulduggery lt 100>>
		<<skulduggeryskilluse>><<set $skulduggery += 5>>
	<<else>>
		There's nothing more you can learn from locks this simple.
	<</if>>

	A bit of rummaging uncovers <<moneyGainDisplay 30 true true>>.

	<<link [[Take it|School Lockers]]>><<crimeup 5>><<set $money += _money_gain>><</link>><<crime>>

	<<link [[Leave|School Lockers]]>><</link>>

<<elseif $rng gte 21>>
	You successfully pick the locks.

	<<if $skulduggery lt 100>>
		<<skulduggeryskilluse>><<set $skulduggery += 5>>
	<<else>>
		There's nothing more you can learn from locks this simple.
	<</if>>

	You rummage through the belongings, but find nothing of value.

	<<link [[Leave|School Lockers]]>><</link>>

<<else>>
	You successfully pick the locks.

	<<if $skulduggery lt 100>>
		<<skulduggeryskilluse>><<set $skulduggery += 5>>
	<<else>>
		There's nothing more you can learn from locks this simple.
	<</if>>

	<<if $schoolstate isnot "early" and $schoolstate isnot "late" and $schoolstate isnot "earlynoschool" and $schoolstate isnot "latenoschool" and $schoolstate isnot "daynoschool">>
		<<generatey1>>You are rummaging through some belongings when you hear a voice behind you. "Hey, that's my locker!" The voice belongs to a <<person1>><<person>>, who looks angry at your intrusion.

		<<link [[Apologise|School Lockers Apology]]>><<status -10>><</link>><<lcool>>

		<<link [[Lie|School Lockers Lie]]>><<detention 3>><</link>><<gdelinquency>>

		<<link [[Fight|School Lockers Fight]]>><<set $fightstart to 1>><</link>>

	<<else>>
		There's nothing of interest inside the lockers. Just some pens and pencils strewn around.

		<<link [[Leave|School Lockers]]>><</link>>

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

:: School Lockers Apology
<<set $outside to 0>><<set $location to "school">><<schooleffects>><<effects>>

You look down at your feet in shame. "S-sorry. I just wanted a look."

The <<person>> is not impressed, but doesn't seem as angry. "Just piss off," <<he>> says, looking through <<his>> belongings. Probably checking if anything is missing.

<<link [[Next|School Lockers]]>><<endevent>><</link>>

:: School Lockers Lie
<<set $outside to 0>><<set $location to "school">><<schooleffects>><<effects>>

You feign confusion. "Your locker? I thought this was mine. Silly me."

"Your locker is nowhere near here, I'm not stupid," <<he>> says, looking through <<his>> belongings. Probably checking if anything is missing.

<<link [[Next|School Lockers]]>><<endevent>><</link>>

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

	<<neutral 1>>

	<<maninit>>
	<<set $enemytrust -= 100>>
	<<set $enemyhealthmax -= 100>>
	<<set $enemyhealth -= 100>>
	<<set $enemyanger += 100>>
	<<npcidlegenitals>>
	"Oh yeah," you say. "What are you gonna do about it?" <<He>> runs and collides with you, sending you both tumbling to the ground.

	<<set $timer to 10>>
<</if>>

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

<<stateman>>

<<actionsman>>

<<if $timer lte 0>>
	<<link [[Next|School Lockers Fight Finish]]>><</link>><<nexttext>>
<<elseif $enemyhealth lte 0>>
	<<link [[Next|School Lockers Fight Finish]]>><</link>><<nexttext>>
<<elseif $enemyarousal gte $enemyarousalmax>>
	<<link [[Next|School Lockers Fight Finish]]>><</link>><<nexttext>>
<<else>>
	<<link [[Next|School Lockers Fight]]>><</link>><<nexttext>>
<</if>>

:: School Lockers Fight Finish
<<set $outside to 0>><<set $location to "school">><<schooleffects>><<effects>>

<<if $enemyarousal gte $enemyarousalmax>>
	<<ejaculation>>

	The climax seems to have robbed <<him>> of <<his>> remaining anger. "Just don't do it again," <<he>> says, looking sheepish. <<tearful>> you rise to your feet as <<he>> closes <<his>> locker and walks away.

	<<clotheson>>
	<<endcombat>>
<<elseif $enemyhealth lte 0>>
	"N-no more! You win," <<he>> says tearfully as <<he>> flees the scene. <<tearful>> you stand tall and triumphant.
	<<ltrauma>><<lstress>><<gcool>><<trauma -6>><<stress -12>><<status 1>>

	<<clotheson>>
	<<endcombat>>
<<elseif $timer lte 0>>
	<<endevent>>

	<<npc Leighton>><<person1>>Leighton storms onto the scene, and physically separates the two of you. "This is completely unacceptable," <<he>> says, looking at you. "I'll see you in my office after school, perhaps I can teach you how to act civil."
	<<gdelinquency>><<detention 4>>

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

<<link [[Next|School Lockers]]>><</link>>