code:
:: Bully Detention [nobr]
<<effects>>
<<pass10>>

Whitney drags you along the corridor straight to Leighton's office. <<He>> barges the door open and enters, still clutching your collar. "Good, the perv isn't here yet." <<He>> shoves you beneath a desk and sits down. As soon as you've struggled to your knees <<he>> grabs the back of your hair and forces your face
<<if $pronoun is "m">>into <<his>> crotch. <<His>> fly is already open.
<<else>>up <<his>> skirt. <<Hes>> not wearing panties.
<</if>>

<<if $penis isnot "none">>
You feel <<his>> penis erect against your cheek.
<<else>>
<<His>> pussy is already wet.
<</if>>

<<endevent>><<leighton>><<person1>>

You hear someone enter the room. "You again," says Leighton. "What was it this time?"

<<endevent>><<whitney>><<person1>>

"I didn't do nothing," Whitney replies.

<<He>> yanks your hair beneath the desk and rubs your mouth against <<his>> <<if $penis isnot "none">>penis<<else>>pussy<</if>>.

<<click [[Lick grudgingly|Bully Detention Oral]]>><<set $phase to 0>><<gtrauma60>><<gstress60>><<set $whitneydom += 1>><<set $submissive += 1>><<set $molestationstart to 1>><</click>><<gtrauma>><<gstress>><<gdom>>

<<if $promiscuity gte 55>>
<<click [[Lick enthusiastically|Bully Detention Oral]]>><<set $phase to 1>><<set $whitneydom += 1>><<set $submissive += 1>><<set $sexstart to 1>><</click>><<promiscuous4>><<gdom>>

<</if>>
<<if $whitneyromance is 1>>
<<click [[Lick lovingly|Bully Detention Oral]]>><<set $phase to 2>><<gtrauma60>><<set $whitneydom += 1>><<set $whitneylove += 1>><<set $submissive += 1>><<set $sexstart to 1>><</click>><<promiscuous1>><<gtrauma>><<glove>><<gdom>>

<</if>>
<<click [[Refuse|Bully Detention Refuse]]>><<gstress60>><<detention40>><<set $whitneydom -= 1>><</click>><<gdelinquency>><<gstress>><<ldom>>

:: Bully Detention Oral [nobr]
<<if $molestationstart is 1>>
<<set $molestationstart to 0>>
<<controlloss>>
<<violence1>>
<<neutral1>>
<<molested>>
<<set $event to "molestationhome">>
<<man1init>>

<<set $enemyanger to 70>>
		<<if $penis isnot "none">>
		You try to get away with just licking the tip, but <<he>> shoves your lips against it.
		<<else>>
		You try to get away with some light licking, but <<he>> shoves your lips against <<his>> entrance.
		<</if>>

<<npcoral>><<set $lefthand to "hair">><<set $righthand to "none">><<set $head to "grappled">><<set $mouth to "none">><<set $enemyhealthmax to 10>><<set $enemyhealth to 10>>

<<set $rescue to 1>>
<<endif>>

<<if $sexstart is 1>>
<<set $sexstart to 0>>
<<consensual>>
<<set $consensual to 1>>
<<neutral1>>
<<set $event to "molestationhome">>
<<man1init>>

	<<if $phase is 0>><<set $enemyanger to 70>>
		<<if $penis isnot "none">>
		You try to get away with just licking the tip, but <<he>> shoves your lips against it.
		<<else>>
		You try to get away with some light licking, but <<he>> shoves your lips against <<his>> entrance.
		<</if>>
	<<elseif $phase is 1>><<set $enemyanger to 70>>
		<<if $penis isnot "none">>
		You tease the base of <<his>> glans with the tip of your tongue.<<promiscuity4>>
		<<else>>
		You tease <<his>> clit with the tip of your tongue.<<promiscuity4>>
		<</if>>
	<<elseif $phase is 2>><<set $enemyanger to 50>>
		<<if $penis isnot "none">>
		You kiss the base of <<his>> penis, and work your up the shaft. <<He>> eases <<his>> rough handling of your hair as you kiss <<his>> glans.<<promiscuity1>>
		<<else>>
		You plant quick kisses on <<his>> labia. <<He>> eases <<his>> rough handling of your hair as you kiss <<his>> clit.<<promiscuity1>>
		<</if>>
	<</if>>

<<npcoral>><<set $lefthand to "hair">><<set $righthand to "none">><<set $head to "grappled">><<set $mouth to "none">><<set $enemyhealthmax to 10>><<set $enemyhealth to 10>>

<<set $rescue to 1>>
<<endif>>

<<effects>>

<<effectsman>><<man>>

Leighton lectures Whitney, unaware of your presence or what you're up to beneath the desk.

<<stateman>>

<<if $phase is 2>>
<<set $enemyanger to 50>>
<<else>>
<<set $enemyanger to 70>>
<</if>>
<<set $enemyarousal += 20>>
<<actionsman>>

<<if $alarm is 1 and $rescue is 1>>
<<click [[Next|Bully Detention Oral Finish]]>><</click>><<nexttext>>
<<elseif $enemyhealth lte 0>>
<<click [[Next|Bully Detention Oral Finish]]>><</click>><<nexttext>>
<<elseif $enemyarousal gte $enemyarousalmax>>
<<click [[Next|Bully Detention Oral Finish]]>><</click>><<nexttext>>
<<elseif $finish is 1>>
<<click [[Next|Bully Detention Oral Finish]]>><</click>><<nexttext>>
<<else>>
<<click [[Next|Bully Detention Oral]]>><</click>><<nexttext>>
<</if>>

:: Bully Detention Refuse [nobr]
<<effects>>

You keep your mouth shut. Whitney tugs on your hair, making you wince in pain, but you don't relent. <<He>> rubs your face against <<himcomma>> but you endure. <<He>> soon becomes frustrated and shoves you out from under the desk with <<his>> foot. You land on your back, facing up at a shocked Leighton.

<<endevent>><<leighton>><<person1>>

"Well this is a surprise," the headteacher says. "If you're so keen on detention I can oblige. For now though, get out." <<He>> pushes you from the room.

<<endevent>>

<<click [[Next|Hallways]]>><<set $eventskip to 1>><</click>>

:: Bully Detention Oral Finish [nobr]
<<effects>>
<<if $enemyarousal gte $enemyarousalmax>>
<<ejaculation>><<set $whitneylust -= 20>>

	<<if $penis isnot "none">>
	<<He>> forces your face into <<his>> crotch, making sure you catch every last drop.
	<<else>>
	<<He>> forces your face into <<his>> crotch, making sure you can't breathe until <<hes>> done cumming.
	<</if>>

"Y-yes," <<he>> says. "Fuck, yes."

Leighton isn't amused. The desk above you shakes as the headteacher leans on it. "Keep that up and I'll keep you here all night."

"Yes," Whitney whispers as <<he>> continues to fill your face. It seems to satisfy Leighton.

"Good," the headteacher says, stepping towards the door. You hear it open, then slam shut.

Once alone, Whitney pulls your head up to face <<him>> and looks down at you. "You make a good sex toy," <<he>> says. <<He>> releases your hair and stands up. <<He>> leaves without looking back.<<llust>>

<<tearful>> you climb to your feet.

<<clotheson>>
<<endcombat>>

<<click [[Next|Hallways]]>><<set $eventskip to 1>><</click>>
<<elseif $enemyhealth lte 0>>

Whitney shouts in pain and kicks you out from under the desk. You land on your back, facing up at a shocked Leighton.

"Well this is a surprise," the headteacher says. "If you're so keen on detention I can oblige. For now though, get out." You're grabbed by the neck, pulled to your feet and shoved from the room.<<detention40>><<gdelinquency>>

<<tearful>> you climb to your feet.

<<clotheson>>
<<endcombat>>

<<click [[Next|Hallways]]>><<set $eventskip to 1>><</click>>
<<elseif $alarm is 1 and $rescue is 1>><<set $rescued += 1>>
A pair of hands grab your arms and pull you out from beneath the desk. You face up at a shocked Leighton.

"Well this is a surprise," the headteacher says. "If you're so keen on detention I can oblige. For now though, get out." You're grabbed by the neck, pulled to your feet and shoved from the room.<<detention40>><<gdelinquency>>

<<tearful>> you climb to your feet.

<<clotheson>>
<<endcombat>>

<<click [[Next|Hallways]]>><<set $eventskip to 1>><</click>>

<<else>>

Whitney kicks you out from beneath the desk. You face up at a shocked Leighton.

"Well this is a surprise," the headteacher says. "If you're so keen on detention I can oblige. For now though, get out." You're grabbed by the neck, pulled to your feet and shoved from the room.<<detention40>><<gdelinquency>>

<<tearful>> you climb to your feet.

<<clotheson>>
<<endcombat>>

<<click [[Next|Hallways]]>><<set $eventskip to 1>><</click>>

<</if>>

:: Bully Oral [nobr]
<<if $molestationstart is 1>>
<<set $molestationstart to 0>>
<<controlloss>>
<<violence1>>
<<neutral1>>
<<molested>>
<<set $event to "molestationhome">>
<<man1init>>
<<He>> forces you to your knees and <<if $pronoun is "m">>unzips <<his>> fly,<<else>>lifts <<his>> skirt,<</if>> revealing <<his>><<if $penis isnot "none">>penis<<else>>pussy<</if>>. "Open wide," <<he>> says. <<His>> friends cheer <<him>> on.

<<npcoral>><<set $lefthand to "hair">><<set $enemyanger to 70>>
<<set $rescue to 1>>
<<endif>>

<<if $sexstart is 1>>
<<set $sexstart to 0>>
<<consensual>>
<<set $consensual to 1>>
<<neutral1>>
<<set $event to "molestationhome">>
<<man1init>>
You drop to your knees as <<he>> <<if $pronoun is "m">>unzips <<his>> fly,<<else>>lifts <<his>> skirt,<</if>> revealing <<his>><<if $penis isnot "none">>penis<<else>>pussy<</if>>. "Open wide," <<he>> says. <<His>> friends cheer <<him>> on.<<promiscuity4>>

<<npcoral>><<set $lefthand to "hair">><<set $enemyanger to 70>>
<<set $rescue to 1>>
<<endif>>

<<effects>>

<<effectsman>><<man>>

<<audience>>

<<stateman>>

<<actionsman>>

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

:: Bully Oral Finish [nobr]
<<effects>>
<<if $enemyarousal gte $enemyarousalmax>>
<<ejaculation>><<set $whitneylust -= 20>>

<<His>> friends applaud <<himstop>> "See you later, slut," <<he>> sneers as <<he>> pulls a cigarette from <<his>> shirt pocket.<<llust>>

<<tearful>> you climb to your feet.

<<clotheson>>
<<endcombat>>

<<click [[Next|Hallways]]>><<set $eventskip to 1>><</click>>
<<elseif $enemyhealth lte 0>>

Whitney shouts in pain and staggers away from you.<<set $whitneydom -= 1>><<ldom>>

"I've had enough of you," Whitney says, a slight quiver in <<his>> voice. "What are you waiting for you fucks? This slut has wasted enough of our time."

<<tearful>> you climb to your feet.

<<clotheson>>
<<endcombat>>

<<click [[Next|Hallways]]>><<set $eventskip to 1>><</click>>
<<elseif $alarm is 1 and $rescue is 1>>
"Stop crying, slut," Whitney says. <<He>> shoves you to the ground. <<He>> starts kicking you, so you curl up and shield your body. The crowd jeers at you. You think some of them get kicks in of their own.<<gpain>><<set $pain += 40>>

You hazard a peek once the kicking stops, and see Whitney and <<his>> friends walking away.

<<tearful>> you climb to your feet.

<<clotheson>>
<<endcombat>>

<<click [[Next|Hallways]]>><<set $eventskip to 1>><</click>>

<<else>>

"Aww," Whitney says. "Has the baby had enough?" <<He>> shoves you to the ground. "Whatever. I was bored anyway." <<He>> and <<his>> friends leave. <<tearful>> you climb to your feet.

<<clotheson>>
<<endcombat>>

<<click [[Next|Hallways]]>><<set $eventskip to 1>><</click>>

<</if>>

:: Whitney Abduction [nobr]
<<set $outside to 0>><<set $location to "town">><<effects>>

<<set $leftarm to "bound">><<set $rightarm to "bound">>
<<whitney>><<person1>>You wake up to cold water drenching your face. Whitney stands above you, holding an empty bucket. Your arms are bound and you're lying in an unfamiliar alley.

"Wakey wakey," <<he>> says. "I knew if I followed you I'd get my chance." <<He>> bunches <<his>> fists. "They don't respect me any more thanks to you. But that won't be a problem now." A van stops at the end of the alley. Whitney drags you to your feet. "You're going to disappear. So I don't have to see your stupid face ever again. And I'm even going to make some money from it."

<<generate2>><<generate3>><<person2>>

A <<person2>><<person>> and <<person3>><<person>> climb out the van and walk towards you. "Here you go," <<person1>>Whitney says. "One slut, as promised." <<He>> shoves you to the ground in front of <<himstop>>

<<person2>>"Very nice," the <<person>> says, stepping over you. "You're just the boss' type."

<<person1>>"Let go of me!" Whitney protests as the <<person3>><<person>> grabs <<person1>><<his>> arms. "I'm not the <<girl>> you're getting. That's <<phim>> on the floor."

<<person2>>"How do I put this," the <<person>> says, before slapping Whitney's face. "Your days of making decisions are over."

The pair start dragging Whitney towards the van. <<person1>>Whitney struggles and screams. "I said let go. Stop. P-please stop." <<He>> start to sob.

<<click [[Intervene|Whitney Abduction Intervene]]>><</click>>

<<click [[Stay out of it|Whitney Abduction Stay]]>><</click>>

:: Whitney Abduction Intervene [nobr]
<<set $outside to 0>><<set $location to "town">><<effects>>

You scramble to your feet. Your arms are still tied, but you charge at the <<person2>><<personstop>> You run into <<himcomma>> catching <<him>> off guard and knocking <<him>> to the ground.

The <<person3>><<person>> stares dumbstruck. Whitney struggles free and together you run from the alley.

<<person1>>You feel safer once in public. Whitney leans against a wall and pants through <<his>> sobs. <<He>> looks at you with a conflicted expression on <<his>> face, then runs away.

<<set $whitneystate to "rescued">>
<<endevent>>
<<destinationeventend>>

:: Whitney Abduction Stay [nobr]
<<set $outside to 0>><<set $location to "town">><<effects>>

You lie still on the floor. They open the back of the van and shove the crying Whitney in. The <<person3>><<person>> climbs in after <<person1>> <<himstop>> The <<person2>><<person>> shuts the doors, cutting off the sound of Whitney's cries. <<He>> climbs in the front seat and drives away.

<<set $whitneystate to "dungeon">>
<<endevent>>
<<destinationeventend>>

:: Bully Pat [nobr]
<<effects>>

You let <<him>> continue. <<He>> adds <<his>> other hand and starts massaging your scalp. Your body reacts of its own accord, and you shiver with pleasure. <<He>> grips your hair and pulls your face close to <<his>> own, "Don't forget who owns you." <<He>> licks your cheek before shoving you to the ground.

<<tearful>> you climb to your feet. <<He>> leaves with <<his>> friends.

<<endevent>>

<<click [[Next|Hallways]]>><<set $eventskip to 1>><</click>>

:: Bully Shake [nobr]
<<effects>>

You shake <<him>> off. "Aww," <<he>> says. "The little <<girl>> is sensitive. Later loser." <<He>> leaves with <<his>> friends.

<<endevent>>

<<click [[Next|Hallways]]>><<set $eventskip to 1>><</click>>

:: Bully Top Flaunt [nobr]
<<effects>>

<<if $uppertype isnot "naked">>
You <<pullup>> your $upperclothes.
<<else>>
Whitney stands back to observe your exposed <<breastsstop>>
<</if>>

<<if $playergenderappearance is "m">>
"Nice," <<he>> says as you turn to give everyone a view of your chest. "You know how to give a show."
<<elseif $breastsize lte 2>>
"<<pShes>> so small!" <<he>> exclaims. You cover your nipples with your fingers, but turn to give everyone a good view of your <<breastsstop>>
<<elseif $breastsize lte 5>>
"You've got a nice pair," <<he>> says. You cover your nipples with your fingers, but turn to give everyone a good view of your <<breastsstop>>
<<else>>
"Look at the size of those things." <<he>> says. You cover your nipples with your fingers, but turn to give everyone a good view of your <<breastsstop>>
<</if>>
<<exhibitionism2>>

"It's good that you know your place. See you later, slut," <<he>> says before leaving you to cover yourself.<<set $whitneylust += 5>><<glust>>

<<click [[Next|Hallways]]>><<endevent>><<set $eventskip to 1>><</click>>

:: Bully Strip Flaunt [nobr]
<<effects>>

<<if $undertype is "naked" or $undertype is "chastity">>
	<<if $leftarm is "bound" and $rightarm is "bound">>
You shuffle out of your clothing. You turn to keep your <<genitals>> and <<breasts>> concealed while giving everyone a good look at your <<bottomstop>>
	<<else>>
You take off your clothing and keep your <<genitals>> and <<breasts>> barely concealed with your hands.
	<</if>>
<<exhibitionism5>>
<<else>>
	<<if $leftarm is "bound" and $rightarm is "bound">>
	You shuffle out of your clothing. You turn to keep your <<breasts>> concealed and give them a good look at your <<bottomstop>>
	<<else>>
	You take off your clothing and keep your <<undies>> and <<breasts>> barely concealed with your hands.
	<</if>>
<<exhibitionism4>>
<</if>>

<<uppernaked>>
<<lowernaked>>

<<if $bullyevent is 5>>

Whitney snatches your clothes away as the crowd gawks at you, taking in your bare skin. Whitney beholds you, savouring the feel of having control of your clothing. "Let's go for a walk," <<he>> says. "You don't have to, but I'll be taking your clothes with me."

<<click [[Go along with it|Bully Walk]]>><<gtrauma60>><<gstress60>><<lcool10>><<set $whitneydom += 1>><</click>><<lcool>><<gtrauma>><<gstress>><<gdom>>

	<<if $exhibitionism gte 75>>
<<click [[Flaunt|Bully Walk Flaunt]]>><<set $whitneydom += 1>><<set $whitneylove += 1>><</click>><<exhibitionist5>><<glove>><<gdom>>

	<</if>>
<<click [[Refuse|Bully Refuse]]>><</click>>

<<else>>

Whitney snatches your clothes away as the crowd gawks at you, taking in your bare skin. Whitney beholds you, savouring the feel of having control of your clothing. "Don't forget your place." <<He>> tosses your clothes on top of a locker, high enough that you'll need to stretch. You manage to reach them, but your <<breasts>> are exposed in the process, eliciting a cheer from the audience.

They lose interest once you're dressed, "Come on, we've wasted enough time with this loser." They leave you in peace. For now. <<set $whitneylust += 5>><<glust>>

<<click [[Next|Hallways]]>><<clotheson>><<endevent>><<set $eventskip to 1>><</click>>

<</if>>

:: Bully Walk Flaunt [nobr]
<<effects>>

You start walking with Whitney and <<his>> friends. They push you to the front, making sure you're exposed to anyone you meet. Whitney stands at your side, clutching your arm.

<<if $leftarm is "bound" and $rightarm is "bound">>
<<else>>
You cover yourself with your other hand.
<</if>>

You're steered round a corner and into a corridor full of <<peopleystop>> <<covered>> A nearby <<persony>> looks at you and gasps in shock. Others have a similar reaction. As the noise grows more turn to look, until everyone is watching you.

You march down the corridor like it was a catwalk. Some look away, going red in the face. Most though are keen to take in the sight of the <<if $undertype is "naked">>naked<<else>>nearly naked<</if>> <<girl>> marching down the center.

"Feel free to look," you announce. "There's no shame in it."<<exhibitionism5>>

Whitney and <<his>> friends follow behind you. When reach the end of the corridor you turn and face them. "You're shameless," <<he>> says. <<He>> throws your clothes at you. "I wish every slut was as keen as you." <<He>> leaves you to get dressed.<<set $whitneylust += 5>><<glust>>

<<fameexhibitionism50>>

<<click [[Next|Hallways]]>><<clotheson>><<endevent>><<set $eventskip to 1>><</click>>

:: Bully Theft [nobr]
<<set $outside to 1>><<set $location to "town">><<effects>>
<<pass20>>
Whitney drags you through the school gates. "We're going to Elk Street," <<he>> says. "You're gonna help us find something." Someone keeps jabbing at your waist throughout the journey.

You arrive beside a walled compound. There's a small hole at the base of the wall. "I'm out of fags," Whitney says. "Go get me some." <<He>> shoves you to your knees and kicks your <<bottom>> several times, pushing you into the hole.

You stand on the other side. You're in an open space behind a large building. There's a vehicle not far away. It's back doors are wide open, many large boxes of cigarettes. You walk over and pick up a couple.

As you turn back to the wall however, you hear a growl behind you. You run, and the growl becomes a bark.

You dive through the hole. Whitney takes the boxes from your hands. You try to crawl through but you're stuck.

	<<if $submissive gte 1150>>
	"H-help," you say.
	<<elseif $submissive lte 850>>
	"Don't just stand there," you say.
	<<else>>
	"Please help," you say.
	<</if>>

<<if $whitneyromance is 1>>

Whitney considers a moment, then grabs your arms. <<He>> pulls you through to safety. "Can't let that dog have its way with you. You'd smell all funny." <<He>> and <<his>> friends laugh. "See you later <<girlstop>> Thanks for the help."<<set $whitneylust += 5>><<glust>>

<<endevent>>

<<click [[Next|Elk Street]]>><<endevent>><</click>>

<<elseif $bestialitydisable is "f">>

Whitney laughs. "Nah, I'm not gonna be caught helping a thief. See you later slut."<<set $whitneylust += 5>><<glust>>

<<endevent>>

You feel the dog prod your behind.

<<click [[Next|Bully Theft Dog]]>><<set $molestationstart to 1>><</click>>

<<else>>

You wriggle and manage to get through the hole before the dog reaches you. The struggle hurt you and damaged your clothing.<<set $whitneylust += 5>><<glust>><<beastescape>>

<<endevent>>

<<click [[Next|Elk Street]]>><<endevent>><</click>>

<</if>>

:: Bully Outside Fight [nobr]
<<if $fightstart is 1>>
<<set $fightstart to 0>>

<<neutral1>>
<<set $event to "molestationhome">>
<<man1init>>
<<set $enemytrust to $enemytrust - 100>>
<<set $enemyanger += 200>>
<<npcidlegenitals>><<set $mouthuse to "lefthand">><<set $lefthand to "mouth">>
You shove Whitney away and try to escape, but <<he>> grabs you from behind and wraps <<his>> arm around your mouth.

<<if $delinquency lt 400>><<set $rescue to 1>><</if>>
<<endif>>

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

<<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>>

<<audience>>

<<stateman>>

<<actionsman>>

<<if $enemyhealth lte 0>>
<<click [[Next|Bully Outside Fight Finish]]>><</click>><<nexttext>>
<<elseif $enemyarousal gte $enemyarousalmax>>
<<click [[Next|Bully Outside Fight Finish]]>><</click>><<nexttext>>
<<elseif $alarm is 1 and $rescue is 1>>
<<click [[Next|Bully Outside Fight Finish]]>><</click>><<nexttext>>
<<elseif $pain gte 100>>
<<click [[Next|Bully Outside Fight Finish]]>><</click>><<nexttext>>
<<else>>
<<click [[Next|Bully Outside Fight]]>><</click>><<nexttext>>
<</if>>

:: Bully Outside Fight Finish [nobr]
<<if $enemyhealth lte 0>>

You push <<him>> to the ground, giving you a chance to escape. <<tearful>> you shove <<his>> friends aside and flee to safety.

<<clotheson>>
<<endcombat>>

<<set $eventskip to 1>>
<<playground>>

<<elseif $enemyarousal gte $enemyarousalmax>>
<<ejaculation>>

"You... stupid..." <<he>> pants, leaning against the wall. <<His>> friends are so bemused by <<his>> state that they don't notice you slip away. <<tearful>> you escape to safety.<<llust>><<set $whitneylust -= 20>>

<<clotheson>>
<<endcombat>>

<<set $eventskip to 1>>
<<playground>>

<<elseif $alarm is 1 and $rescue is 1>>

Your cries attract attention. "Crybaby," Whitney says. "We'll get you next time." <<He>> and <<his>> friends leave. <<tearful>> you struggle to your feet.

<<clotheson>>
<<endcombat>>

<<set $eventskip to 1>>
<<playground>>

<<else>>

You're too battered and bruised to resist.

<<endcombat>>

<<whitney>><<person1>>

	<<if $bullyeventoutside is 1>>
	<<click [[Next|Bully Theft]]>><</click>>
	<<elseif $bullyeventoutside is 2>>
	<<click [[Next|Bully Light]]>><</click>>
	<<elseif $bullyeventoutside is 3>>
	<<click [[Next|Bully Romance]]>><</click>>
	<<else>>
	<<click [[Next|Bully Whore]]>><</click>>
	<</if>>

<</if>>

:: Bully Theft Dog [nobr]
<<if $molestationstart is 1>>
<<set $molestationstart to 0>>
<<controlloss>>
<<violence1>>
<<neutral1>>
<<molested>>
<<set $event to "dogpack">>
<<beast1init>><<set $beasttype to "dog">><<set $enemytrust -= 40>><<set $position to "wall">><<set $leftarm to "bound">><<set $rightarm to "bound">><<set $head to "bound">>

<<endif>>

<<effects>>
<<effectsman>>
<<beast>>

<<stateman>>

<<actionsman>>

<<if $enemyarousal gte $enemyarousalmax>>
<<click [[Next|Bully Theft Dog Finish]]>><</click>><<nexttext>>
<<elseif $enemyhealth lte 0>>
<<click [[Next|Bully Theft Dog Finish]]>><</click>><<nexttext>>
<<else>>
<<click [[Next|Bully Theft Dog]]>><</click>><<nexttext>>
<</if>>

:: Bully Theft Dog Finish [nobr]
<<set $outside to 1>><<set $location to "forest">><<effects>>

<<if $enemyarousal gte $enemyarousalmax>>

<<beastejaculation>>

You hear the dog walk away from you, and manage to wriggle through the hole.

<<tearful>> you rise to your feet.

<<clotheson>>
<<endcombat>>

<<click [[Next|Elk Street]]>><<set $eventskip to 1>><</click>>

<<elseif $enemyhealth lte 0>>

You hear the dog yelp and run away. You manage to wriggle through the hole.

<<tearful>> you rise to your feet.

<<clotheson>>
<<endcombat>>

<<click [[Next|Elk Street]]>><<set $eventskip to 1>><</click>>

<</if>>

:: Bully Light [nobr]
<<set $outside to 1>><<set $location to "town">><<effects>>
<<pass20>>

You're dragged by the arm through the school gates. "The breeze from the sea is nice," <<he>> says. "I'll show you what I mean."

You journey to Mer Street. When you arrive Whitney steps up to the edge of the pier. "This is nice," <<he>> says. <<He>> points at a street light. <<His>> friends grasp your arms and drag you over to it. Someone ties your arms in place.

<<set $leftarm to "bound">><<set $rightarm to "bound">>
Whitney saunters over to you. "Think I'll leave you here awhile. You'll have company." <<He>> points at a fishing ship just landing. "Doesn't look like they caught much. They must be real frustrated. I know what'll cheer them up. A nice slut all tied and ready for them." <<He>> and <<his>> friends leave. You can't turn to tell if they're gone or watching from somewhere.

<<endevent>><<generate1>><<generate2>><<generate3>><<person1>>

A <<person>> on board the boat points at you. <<He>> comes ashore, followed by <<his>> crewmates.

<<set $rng to random(1, 100)>>
<<if $rng gte 81>>
"What do we have here," the <<person>> says as <<he>> draws close. "Now who'd tie you up like that. I bet you did something naughty to deserve it."

<<person2>>A <<person>> arrives at <<person1>><<his>> side. "We should probably help punish <<phimstop>> Civic duty and all that."

<<click [[Next|Bully Light Molestation]]>><<set $molestationstart to 1>><</click>>

<<else>>

<<click [[Next|Bully Light 2]]>><</click>>

<</if>>

:: Bully Light Molestation [nobr]
<<if $molestationstart is 1>>
<<set $molestationstart to 0>>
<<controlloss>>
<<violence1>>
<<neutral1>>
<<molested>>
<<set $event to "molestationhome">>
<<man1init>>
<<endif>>

<<effects>>

<<effectsman>><<man>>

<<stateman>>

<<actionsman>>

<<if $enemyhealth lte 0>>
<<click [[Next|Bully Light Molestation Finish]]>><</click>><<nexttext>>
<<elseif $enemyarousal gte $enemyarousalmax>>
<<click [[Next|Bully Light Molestation Finish]]>><</click>><<nexttext>>
<<else>>
<<click [[Next|Bully Light Molestation]]>><</click>><<nexttext>>
<</if>>

:: Bully Light Molestation Finish [nobr]
<<effects>>
<<if $enemyarousal gte $enemyarousalmax>>
<<ejaculation>>

They laugh and joke with each other as they head back to their boat.

<<endcombat>>

<<whitney>><<person1>>
You hear Whitney's voice behind you. "I bet you made their day." Your hands come free. "Don't forget who owns your ass. If I want you servicing sailors twenty-four hours a day that's what'll happen." <<tearful>> you remove the remains of the rope from your arms. Whitney and <<his>> friends leave you by the pier.<<set $whitneylust += 5>><<glust>>

<<unbind>>
<<clotheson>>
<<endevent>>
<<click [[Next|Mer Street]]>><<set $eventskip to 1>><</click>>

<<elseif $enemyhealth lte 0>>
"Maybe paying a whore is worth it after all," the <<person1>><<person>> says. "They don't kick back." They grumble as they head back to their boat.

<<endcombat>>

<<whitney>><<person1>>
You hear Whitney's voice behind you. "You sure showed them." Your hands come free. "Don't forget who owns your ass." <<tearful>> you remove the remains of the rope from your arms. Whitney and <<his>> friends leave you by the pier.

<<unbind>>
<<clotheson>>
<<endevent>>
<<click [[Next|Mer Street]]>><<set $eventskip to 1>><</click>>

<</if>>

:: Bully Romance [nobr]
<<set $outside to 0>><<set $location to "town">><<effects>>
<<pass20>>

<<He>> pushes you through the school gates, groping your <<bottom>> the whole time without caring who sees. "I have something romantic planned," <<he>> says. "Only the best for my <<bitchstop>>"

<<He>> takes you to Harvest Street, to a seedy pub. "Sit down. I'll get drinks."

<<He>> returns with two colourful looking glasses. "Drink up," <<he>> says.

<<click [[Drink|Bully Romance 2]]>><<set $phase to 0>><<set $whitneydom += 1>><</click>><<gdom>>

<<click [[Don't Drink|Bully Romance 2]]>><<set $phase to 1>><<set $whitneydom -= 1>><</click>><<ldom>>

:: Bully Romance 2 [nobr]
<<set $outside to 0>><<set $location to "town">><<effects>>

<<if $phase is 0>>
You sip the drink. It's very sweet. You feel lightheaded within moments.

<<set $drunk += 120>>
<</if>>

<<He>> sips <<his>> drink and stares at you. "Why don't you come over here? Sit on my lap."

<<click [[Sit on lap|Bully Romance 3]]>><<set $phase to 0>><<set $whitneydom += 1>><<set $whitneylove += 1>><</click>><<glove>><<gdom>>

<<click [[Refuse|Bully Romance 3]]>><<set $phase to 1>><<set $whitneylove -= 1>><<set $whitneydom -= 1>><</click>><<llove>><<ldom>>

:: Bully Romance 3 [nobr]
<<set $outside to 0>><<set $location to "town">><<effects>>

<<if $phase is 0>>
You walk around the table and sit on <<his>> waiting lap. A few heads turn to look. <<He>> leans close.

<<else>>
You shake your head. <<He>> reaches forward and grabs your shoulders before pulling you onto the table. <<He>> leans close.

<</if>>

"I'm going to fuck you," <<he>> whispers. "Right here. Everyone will see and know you're mine."

<<click [[Nod|Bully Romance Sex]]>><<set $sexstart to 1>><<set $whitneydom += 1>><<set $whitneylove += 1>><</click>><<promiscuous1>><<glove>><<gdom>>

<<click [[Refuse|Bully Romance Sex]]>><<set $molestationstart to 1>><<set $whitneydom -= 1>><<set $whitneylove -= 1>><</click>><<llove>><<ldom>>

:: Bully Romance Sex [nobr]
<<if $molestationstart is 1>>
<<set $molestationstart to 0>>
<<controlloss>>
<<violence1>>
<<neutral1>>
<<molested>>
<<set $event to "molestationhome">>
<<man1init>>
"That's not your decision to make," <<he>> says.

<<endif>>

<<if $sexstart is 1>>
<<set $sexstart to 0>>
<<consensual>>
<<set $consensual to 1>>
<<neutral1>>
<<set $event to "molestationhome">>
<<man1init>><<promiscuity1>>

<<endif>>

<<effects>>

<<effectsman>><<man>>

<<audience>>

<<stateman>>

<<actionsman>>

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

:: Bully Romance Sex Finish [nobr]
<<effects>>
<<if $enemyarousal gte $enemyarousalmax>>
<<ejaculation>><<set $whitneylust -= 20>>

The audience applaud. Whitney gasps and climbs off you.

<<clotheson>>

<<tearful>> you climb to your feet. Whitney takes your hand. "Let's leave before these perverts get any funny ideas." <<He>> pulls you from the pub.

<<He>> pulls a cigarette out of <<his>> shirt pocket once outside. "And they say I'm not romantic," <<he>> says. "Fuck off home or wherever, I've got things to do." <<He>> walks away from you.<<llust>>

<<endcombat>>

<<click [[Next|Harvest Street]]>><<set $eventskip to 1>><</click>>
<<elseif $enemyhealth lte 0>>

You shove Whitney off you. <<tearful>> you flee the pub. The audience cheer at the spectacle.<<llove>><<ldom>><<set $whitneylove -= 1>><<set $whitneydom -= 1>>

<<clotheson>>
<<endcombat>>

<<click [[Next|Harvest Street]]>><<set $eventskip to 1>><</click>>

<<else>>

"You're showing me up in front of all these people," Whitney says. "You should treat your <<if $pronoun is "m">>boy<<else>>girl<</if>>friend better." <<He>> shoves you away, adjusts <<his>> clothes and leaves the pub.<<llove>><<ldom>><<set $whitneylove -= 1>><<set $whitneydom -= 1>>

<<clotheson>>
<<endcombat>>

<<tearful>> you leave the same way as Whitney, but don't see them anywhere.

<<click [[Next|Harvest Street]]>><<set $eventskip to 1>><</click>>

<</if>>

:: Bully Whore [nobr]
<<set $outside to 0>><<set $location to "town">><<effects>>
<<pass20>>

Whitney drags you by your hair, forcing you to bend forwards. <<He>> leads you through the school gates and down a nearby alley. <<He>> releases you in front of a <<endevent>><<generate1>><<person1>><<personstop>>

<<if $uppertype isnot "naked">>
Without warning, Whitney <<pullsup>> your $upperclothes.
<</if>>

"There. I've shown you a school <<girl>> shirtless. Now pay up."

<<if $whitneydom gte 20>>

The <<person>> reaches forward to grope your <<breastsstop>> "No touching!" Whitney says. "That's extra."

"How much extra?"

Whitney pauses, refusing to let you go. "£50."

"Done," the <<person>> says. <<He>> pulls some notes from <<his>> pocket. Whitney shoves you over while taking the money.

<<click [[Next|Bully Whore Molestation]]>><<set $molestationstart to 1>><</click>>

<<else>>

The <<person>> reaches forward to grope your <<breastsstop>> "No touching!" Whitney says. "You haven't paid for that." You struggle free.

<<endevent>><<whitney>><<person1>>

You leave the alley as Whitney takes <<his>> money. "Don't be upset," <<he>> shouts at you. "You've been productive for once."<<set $whitneylust += 5>><<glust>><<gtrauma>><<gstress>><<gtrauma60>><<gstress60>>

<<click [[Next|Oxford Street]]>><<endevent>><<set $eventskip to 1>><</click>>

<</if>>

:: Bully Whore Molestation [nobr]
<<if $molestationstart is 1>>
<<set $molestationstart to 0>>
<<controlloss>>
<<violence1>>
<<neutral1>>
<<molested>>
<<set $event to "molestationhome">>
<<man1init>>
<<endif>>

<<effects>>

<<effectsman>><<man>>

Whitney counts the money.

<<stateman>>

<<actionsman>>

<<if $enemyhealth lte 0>>
<<click [[Next|Bully Whore Molestation Finish]]>><</click>><<nexttext>>
<<elseif $enemyarousal gte $enemyarousalmax>>
<<click [[Next|Bully Whore Molestation Finish]]>><</click>><<nexttext>>
<<else>>
<<click [[Next|Bully Whore Molestation]]>><</click>><<nexttext>>
<</if>>

:: Bully Whore Molestation Finish [nobr]
<<if $enemyarousal gte $enemyarousalmax>>
<<ejaculation>><<set $forcedprostitutionstat += 1>>

"I hope you're satisfied," Whitney says. "Give another £20 and I'll let you have another go."

"I don't think my heart could take it," the <<person>> says. "Another time maybe."

<<tearful>> you stagger from the alley.

<<clotheson>>
<<endcombat>>

<<click [[Next|Oxford Street]]>><<set $eventskip to 1>><</click>>

<<elseif $enemyhealth lte 0>>

<<endcombat>>

"Fuck!" the <<person>> shouts as <<he>> backs away from you. "I want my money back. This one has rabies or something."

Whitney laughs. "There's nothing wrong with it. You're just a weakling. Come back with more money and you can have a another go."

<<tearful>> you leave the alley.

<<clotheson>>
<<endcombat>>

<<click [[Next|Oxford Street]]>><<set $eventskip to 1>><</click>>

<</if>>

:: Bully Light 2 [nobr]
<<set $outside to 1>><<set $location to "town">><<effects>>

<<He>> starts jogging towards you as <<he>> gets closer. "Hang on there <<girlstop>> Won't take long." <<He>> walks behind you. Your bonds come loose. "You alright?"

<<unbind>>
"Tha-" you begin, but Whitney interrupts you from the other side of the road. "What are you doing? Just fuck <<phim>> already."

One of the <<persons>> crewmates catches up and stares at Whitney. "Something's wrong with that kid. Damn."

"You shouldn't tie your friend up like that," the <<person>> shouts back at Whitney. "Not in this town especially."

<<endevent>><<whitney>><<person1>>

Whitney steps forward, fists clenched. <<His>> gang doesn't seem so eager to start a fight though. Two of them pull <<him>> back. "You weak fucks," <<he>> shouts, you're not sure at who. "I hope you fish fuckers get raped by a whale." <<He>> turns with <<his>> friends and walks away.

The crew make sure you're okay, then head back to their ship.

<<endevent>>

<<click [[Next|Mer Street]]>><<set $eventskip to 1>><</click>>

:: School Leave Whitney [nobr]
<<set $outside to 1>><<set $location to "school">><<schooleffects>><<effects>>

<<if $whitneyromance is 1>>

	<<if $rng gte 81>>
<<whitney>><<person1>>Whitney's busy arguing with one of <<his>> friends and doesn't spot you. Another of <<his>> friends, a <<generatey2>><<person2>><<person>> does though, and walks over to you. "You're Whitney's slut," <<he>> says. "Think I fancy a piece myself." You withdraw into a defensive posture as <<he>> tries to grope your <<genitalsstop>>

The <<person2>><<person>> turns just in time to get smacked in the face. Whitney grasps <<his>> collar and pulls <<him>> close. "Keep your <<if $pronoun is "m">>pervert hands<<else>>skanky ass<</if>> away from my slut." Whitney shoves <<him>> aside. <<He>> turns away, red in the face as Whitney grabs your arm and tugs.

<<endevent>><<whitney>><<person1>><<He>> pulls you away from <<his>> friends, behind the bike shed. "The nerve of that cunt," <<he>> says. "I need to vent," <<he>> shoves you to the ground and drops on top of you.

<<click [[Next|School Leave Whitney Rape]]>><<set $molestationstart to 1>><</click>>

	<<else>>
<<whitney>><<person1>>Whitney spots you approach the gate. <<He>> shoves one of <<his>> friends out of the way and marches towards you. <<He>> pushes you against a wall and holds your hands above your head in <<his>> own. "Almost missed you," <<he>> says. <<He>> kisses you, still pressing your arms against the wall. "You wouldn't do that to me, would you?" <<He>> kisses once more before releasing you. <<He>> slaps your <<bottom>> as you leave.<<gstress>><<garousal>><<glust>><<gstress60>><<garousal60>><<set $whitneylust += 5>>

<<click [[Next|Oxford Street]]>><<endevent>><</click>>

	<</if>>
<<else>>
	<<if $rng gte 81>>
<<whitney>><<person1>>Whitney spots you approach the gate. "Where do you think you're going," <<he>> says. "You haven't paid the toll." <<He>> grasps <<his>> crotch and <<his>> friends laugh.<<gtrauma>><<gstress>><<gtrauma60>><<gstress60>><<glust>><<set $whitneylust += 5>>

	<<click [[Next|Oxford Street]]>><<endevent>><</click>>

	<<elseif $rng gte 61>>
<<whitney>><<person1>>You hear footsteps behind you. Before you can turn, Whitney leaps on your back and wraps <<his>> arms around your neck. "Giddy up, <<bitchcomma>>" <<he>> says. The weight forces you to your knees. "You're a shit horse. Maybe you need to be ridden more." <<He>> turns to <<his>> friends. "Any takers?" They laugh as you climb to your feet.<<gtrauma>><<gstress>><<gtrauma60>><<gstress60>><<glust>><<set $whitneylust += 5>>

<<click [[Next|Oxford Street]]>><<endevent>><</click>>

	<<elseif $rng gte 41>>
	<<whitney>><<person1>>Whitney spots you approach the gate. "Look who it is," <<he>> shouts. <<His>> friends turn to watch you. "Look at the way <<pshe>> walks. I bet <<pshes>> sore after fucking all the teachers." They laugh.<<gtrauma>><<gstress>><<gtrauma60>><<gstress60>><<glust>><<set $whitneylust += 5>>

	<<click [[Next|Oxford Street]]>><<endevent>><</click>>

	<<elseif $rng gte 21>>

	<<whitney>><<person1>>Whitney spots you approach the gate. <<He>> blocks your path. "Where do you think you're going?" <<he>> says. "There's a toll for passing through." <<He>> holds out a hand. "Twenty quid. Or I'll take something else as payment."

		<<if $money gte 2000>>
	<<click [[Pay up|School Leave Whitney Pay]]>><<set $money -= 2000>><<set $submissive += 1>><</click>><<gdom>>

		<</if>>
		<<click [[Say you can't afford it|School Leave Whitney Strip]]>><<set $phase to 0>><<set $molestationstart to 1>><</click>>

		<<click [[Shove|School Leave Whitney Strip]]>><<set $submissive -= 1>><<set $whitneydom -= 1>><<set $phase to 1>><<set $molestationstart to 1>><</click>><<ldom>>

	<<else>>
	<<whitney>><<person1>>You walk past Whitney. You feel a sting on your arm and turn to see Whitney putting <<his>> cigarette out on it. <<He>> gives you an innocent smile.<<gpain>><<set $pain += 20>><<gtrauma>><<gstress>><<gtrauma60>><<gstress60>><<glust>><<set $whitneylust += 5>>

	<<endevent>>

	<<click [[Next|Oxford Street]]>><<endevent>><</click>>

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

:: School Leave Whitney Rape [nobr]
<<if $molestationstart is 1>>
<<set $molestationstart to 0>>
<<controlloss>>
<<violence1>>
<<neutral1>>
<<molested>>
<<set $event to "molestationhome">>
<<man1init>><<set $enemyanger += 60>>
<<endif>>

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

<<audience>>

<<stateman>>

<<actionsman>>

<<if $enemyarousal gte $enemyarousalmax>>
<<click [[Next|School Leave Whitney Rape Finish]]>><</click>><<nexttext>>
<<elseif $enemyhealth lte 0>>
<<click [[Next|School Leave Whitney Rape Finish]]>><</click>><<nexttext>>
<<else>>
<<click [[Next|School Leave Whitney Rape]]>><</click>><<nexttext>>
<</if>>

:: School Leave Whitney Rape Finish [nobr]
<<effects>>
<<if $enemyarousal gte $enemyarousalmax>>
<<ejaculation>><<set $whitneylust -= 20>>

"Maybe you'll smell like me now," <<he>> says. "I read somewhere that affects people subconciously." <<He>> pulls a cigarette from <<his>> shirt pocket. "Later <<girlstop>>"<<llust>>

<<tearful>> you climb to your feet.

<<clotheson>>
<<endcombat>>

<<click [[Next|Oxford Street]]>><<set $eventskip to 1>><</click>>
<<else>>

Whitney shouts in pain and staggers away from you. <<tearful>> you climb to you feet. <<He>> swipes at you but misses as you flee out from behind the shed. You leave the school.<<set $whitneydom -= 1>><<ldom>>

<<clotheson>>
<<endcombat>>

<<click [[Next|Oxford Street]]>><<set $eventskip to 1>><</click>>

<</if>>

:: School Leave Whitney Pay [nobr]
<<set $outside to 1>><<set $location to "school">><<schooleffects>><<effects>>

You hand Whitney the money. "Nice doing business," <<he>> says. <<He>> barges past you.<<gtrauma>><<gstress>><<gtrauma60>><<gstress60>><<glust>><<set $whitneylust += 5>>

<<click [[Next|Oxford Street]]>><<endevent>><</click>>

:: School Leave Whitney Strip [nobr]
<<if $molestationstart is 1>>
<<set $molestationstart to 0>>
<<controlloss>>
<<violence1>>
<<neutral1>>
<<molested>>
<<set $event to "molestationhome">>
<<man1init>><<npcstrip>><<npcidlegenitals>>
	<<if $phase is 0>>
	"Oh, I think you can," <<he>> says. <<He>> lunges for you. <<His>> friends cheer <<him>> on.

	<<elseif $phase is 1>>
	You shove Whitney away. "Slut," <<he>> snarls. "I'm gonna show everyone." <<He>> lunges for you. <<His>> friends cheer <<him>> on.

	<</if>>
<<if $delinquency lt 400>><<set $rescue to 1>><</if>>
<<endif>>

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

<<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>>

<<audience>>

<<stateman>>

<<actionsman>>

<<if $alarm is 1 and $rescue is 1>>
<<click [[Next|School Leave Whitney Strip Finish]]>><</click>><<nexttext>>
<<elseif $uppertype is "naked" and $lowertype is "naked" and $undertype is "naked">>
<<click [[Next|School Leave Whitney Strip Finish]]>><</click>><<nexttext>>
<<elseif $uppertype is "naked" and $lowertype is "naked" and $undertype is "chastity">>
<<click [[Next|School Leave Whitney Strip Finish]]>><</click>><<nexttext>>
<<elseif $enemyarousal gte $enemyarousalmax>>
<<click [[Next|School Leave Whitney Strip Finish]]>><</click>><<nexttext>>
<<elseif $enemyhealth lte 0>>
<<click [[Next|School Leave Whitney Strip Finish]]>><</click>><<nexttext>>
<<else>>
<<click [[Next|School Leave Whitney Strip]]>><</click>><<nexttext>>
<</if>>

:: School Leave Whitney Strip Finish [nobr]
<<if $enemyhealth lte 0>>

Whitney stumbles backwards. <<tearful>> you push past <<his>> friends and flee to safety.

<<clotheson>>
<<endcombat>>

<<click [[Next|Oxford Street]]>><<set $eventskip to 1>><</click>>
<<elseif $enemyarousal gte $enemyarousalmax>>
<<ejaculation>><<set $whitneylust -= 20>>

<<tearful>> you push past <<his>> friends and flee to safety.<<llust>>

<<clotheson>>
<<endcombat>>

<<click [[Next|Oxford Street]]>><<set $eventskip to 1>><</click>>
<<elseif $alarm is 1 and $rescue is 1>>

<<endcombat>>

<<doren>><<person1>>"Leave the <<if $playergenderappearance is "m">>lad<<else>>lass<</if>> alone," Doren shouts across the playground.<<endevent>><<whitney>><<person1>> Whitney shoves you away. "I wasn't doing nothing," <<he>> protests. <<tearful>> you push past <<his>> friends and flee to safety.

<<clotheson>>

<<click [[Next|Oxford Street]]>><<set $eventskip to 1>><</click>>

<<else>>

Whitney steps back to look at you. <<covered>> <<His>> friends jeer at you. "Hey everyone!" Whitney shouts, trying to attract more attention to your situation.<<glust>><<set $whitneylust += 5>><<fameexhibitionism30>>

<<endcombat>>
<<doren>><<person1>>Doren pushes through the crowd. <<He>> scowls when <<he>> sees you and Whitney. "Give the <<if $playergenderappearance is "m">>lad<<else>>lass<</if>> <<pher>> clothes back," <<he>> says. "Now."

Whitney hesitates, but relents and throws the clothes on top of you. "Come on. I think we showed <<phimstop>>"

Doren holds <<his>> large coat around you and looks away as you dress.

<<clothesontowel>>

"Are you alri-" <<he>> begins, but is cut off by a scream on the other side of the playground. <<He>> sighs. "Sorry." <<He>> leaves to investigate the noise.

<<endevent>>

<<click [[Next|Oxford Street]]>><<set $eventskip to 1>><</click>>

<</if>>

license: unknown


code:
:: Testing Wardrobe [nobr testing]
<<testingroomlist>>
<<effects>>

<<wardrobesystem "Testing Wardrobe">>

:: Testing Sprite [nobr testing]
<<testingroomlist>>
<<effects>>
<<if $outertop>><<set $outertop.state to "waist">><</if>>
<<if $outerbottom>><<set $outerbottom.state to "waist">><</if>>
<<if $outertop>><<set $outertop.state to "waist">><</if>>
<<if $outerbottom>><<set $outerbottom.state to "waist">><</if>>
<<if $outertop>><<set $outertop.state to "waist">><</if>>
<<if $outerbottom>><<set $outerbottom.state to "waist">><</if>>
<<combatimg>>

:: Testing Shop [nobr testing]
<<testingroomlist>>
<<effects>>

/*
ToDo:  Add handling for theft including crime increase

ToDo:  Add handling for 'try on clothing' - probably only after apropriate scenes are made.

*/
''Tops:''

<<if $temptype is "t-shirt">><<radiobutton "$temptype" "t-shirt" checked>>
<<else>><<radiobutton "$temptype" "t-shirt">><</if>>
T-Shirt  |
<<if $temptype is "tank top">><<radiobutton "$temptype" "tank top" checked>>
<<else>><<radiobutton "$temptype" "tank top">><</if>>
Tank Top  |
<<if $temptype is "bikini top">><<radiobutton "$temptype" "bikini top" checked>>
<<else>><<radiobutton "$temptype" "bikini top">><</if>>
Bikini Top  |
<<if $temptype is "pyjama shirt">><<radiobutton "$temptype" "pyjama shirt" checked>>
<<else>><<radiobutton "$temptype" "pyjama shirt">><</if>>
Pyjama Shirt  |
<<if $temptype is "towel top">><<radiobutton "$temptype" "towel top" checked>>
<<else>><<radiobutton "$temptype" "towel top">><</if>>
Towel (top)

''Bottoms:''

<<if $temptype is "shorts">><<radiobutton "$temptype" "shorts" checked>>
<<else>><<radiobutton "$temptype" "shorts">><</if>>
Shorts  |
<<if $temptype is "bikini bottoms">><<radiobutton "$temptype" "bikini bottoms" checked>>
<<else>><<radiobutton "$temptype" "bikini bottoms">><</if>>
Bikini Bottoms  |
<<if $temptype is "pyjama bottoms">><<radiobutton "$temptype" "pyjama bottoms" checked>>
<<else>><<radiobutton "$temptype" "pyjama bottoms">><</if>>
Pyjama Bottoms  |
<<if $temptype is "towel bottom">><<radiobutton "$temptype" "towel bottom" checked>>
<<else>><<radiobutton "$temptype" "towel bottom">><</if>>
Towel (bottom)

''School:''

<<if $temptype is "school shirt">><<radiobutton "$temptype" "school shirt" checked>>
<<else>><<radiobutton "$temptype" "school shirt">><</if>>
School Shirt  |
<<if $temptype is "school shorts">><<radiobutton "$temptype" "school shorts" checked>>
<<else>><<radiobutton "$temptype" "school shorts">><</if>>
School Shorts  |
<<if $temptype is "school skirt">><<radiobutton "$temptype" "school skirt" checked>>
<<else>><<radiobutton "$temptype" "school skirt">><</if>>
School Skirt  |
<<if $temptype is "school swimsuit">><<radiobutton "$temptype" "school swimsuit" checked>>
<<else>><<radiobutton "$temptype" "school swimsuit">><</if>>
School Swimsuit  |
<<if $temptype is "school swim shorts">><<radiobutton "$temptype" "school swim shorts" checked>>
<<else>><<radiobutton "$temptype" "school swim shorts">><</if>>
School Swim Shorts

''Underwear:''

<<if $temptype is "Y fronts">><<radiobutton "$temptype" "Y fronts" checked>>
<<else>><<radiobutton "$temptype" "Y fronts">><</if>>
Y Fronts  |
<<if $temptype is "plain panties">><<radiobutton "$temptype" "plain panties" checked>>
<<else>><<radiobutton "$temptype" "plain panties">><</if>>
Plain Panties  |
<<if $temptype is "lace panties">><<radiobutton "$temptype" "lace panties" checked>>
<<else>><<radiobutton "$temptype" "lace panties">><</if>>
Lace Panties

''Other:''

<<if $temptype is "sundress">><<radiobutton "$temptype" "sundress" checked>>
<<else>><<radiobutton "$temptype" "sundress">><</if>>
Sundress  |
<<if $temptype is "evening gown">><<radiobutton "$temptype" "evening gown" checked>>
<<else>><<radiobutton "$temptype" "evening gown">><</if>>
Evening Gown  |
<<if $temptype is "waist apron">><<radiobutton "$temptype" "waist apron" checked>>
<<else>><<radiobutton "$temptype" "waist apron">><</if>>
Waist Apron

''Color Selection:''

<<if $tempcolour is "white">><<radiobutton "$tempcolour" "white" checked>>
<<else>><<radiobutton "$tempcolour" "white">><</if>>
White |
<<if $tempcolour is "pink">><<radiobutton "$tempcolour" "pink" checked>>
<<else>><<radiobutton "$tempcolour" "pink">><</if>>
Pink |
<<if $tempcolour is "red">><<radiobutton "$tempcolour" "red" checked>>
<<else>><<radiobutton "$tempcolour" "red">><</if>>
Red |
<<if $tempcolour is "orange">><<radiobutton "$tempcolour" "orange" checked>>
<<else>><<radiobutton "$tempcolour" "orange">><</if>>
Orange |
<<if $tempcolour is "yellow">><<radiobutton "$tempcolour" "yellow" checked>>
<<else>> <<radiobutton "$tempcolour" "yellow">><</if>>
Yellow |
<<if $tempcolour is "green">><<radiobutton "$tempcolour" "green" checked>>
<<else>><<radiobutton "$tempcolour" "green">><</if>>
Green |
<<if $tempcolour is "blue">><<radiobutton "$tempcolour" "blue" checked>>
<<else>><<radiobutton "$tempcolour" "blue">><</if>>
Blue |
<<if $tempcolour is "purple">><<radiobutton "$tempcolour" "purple" checked>>
<<else>><<radiobutton "$tempcolour" "purple">><</if>>
Purple  |
<<if $tempcolour is "black">><<radiobutton "$tempcolour" "black" checked>>
<<else>><<radiobutton "$tempcolour" "black">><</if>>

''Action:''

<<if $tempaction is "wear">><<radiobutton "$tempaction" "wear" checked>>
<<else>><<radiobutton "$tempaction" "wear">><</if>>
Wear |
<<if $tempaction is "store">><<radiobutton "$tempaction" "store" checked>>
<<else>><<radiobutton "$tempaction" "store">><</if>>
Send Home

<<button "Buy Now!" "Testing Shop">><<buyclothes $tempcolour $temptype $tempaction>><</button>>
 - - - or - - -
<<button "Delete All Clothes" "Testing Shop">>
<<set $outertop to 0>><<set $outerbottom to 0>><<set $top to 0>><<set $bottom to 0>><<set $undertop to 0>><<set $underbottom to 0>><<set $legs to 0>><<set $feet to 0>><<set $headacc to 0>><<set $faceacc to 0>><<set $neckacc to 0>><<set $underacc to 0>><<set $wardrobe to []>><</button>>
 - - - or - - -
<<button "Give Money!" "Testing Shop">><<set $money += 5000>><</button>>

''Temp Items:''
<<link [[Get Plant Top|Testing Shop]]>><<giveclothes "green" "plant top" "wear">><</link>> |
<<link [[Get Plant Skirt|Testing Shop]]>><<giveclothes "green" "plant skirt" "wear">><</link>>

''Lewd Items:''
<<link [[Toggle Chastity Belt|Testing Shop]]>>
  <<if $underacc.name is "chastity belt">><<set $underacc to 0>>
  <<else>><<giveclothes "" "chastity belt" "wear">><</if>><</link>> |
<<link [[Toggle Collar|Testing Shop]]>>
  <<if $neckacc.name is "collar">><<set $neckacc to 0>>
  <<else>><<giveclothes "" "collar" "wear">><</if>><</link>>

''Accessories:''
<<link [[Get Hairpin|Testing Shop]]>><<giveclothes "" "hairpin" "wear">><</link>> |
<<link [[Get Beanie|Testing Shop]]>><<giveclothes "" "beanie" "wear">><</link>> |
<<link [[Get Glasses|Testing Shop]]>><<giveclothes "" "glasses" "wear">><</link>> |
<<link [[Get Cool Shades|Testing Shop]]>><<giveclothes "" "shades" "wear">><</link>>

''Socks:''
<<link [[Get Pink Gym Socks|Testing Shop]]>><<giveclothes "pink" "gym socks" "wear">><</link>> |
<<link [[Get Blue Gym Socks|Testing Shop]]>><<giveclothes "blue" "gym socks" "wear">><</link>>

''Stockings:''
<<link [[Get Fishnet Stockings|Testing Shop]]>><<giveclothes "fishnet" "stockings" "wear">><</link>> |
<<link [[Get Sheer Stockings|Testing Shop]]>><<giveclothes "sheer" "stockings" "wear">><</link>>

''Tights:''
<<link [[Get Brown Tights|Testing Shop]]>><<giveclothes "brown" "tights" "wear">><</link>> |
<<link [[Get Sheer Tights|Testing Shop]]>><<giveclothes "sheer" "tights" "wear">><</link>>

''Feet:''
<<link [[Get Black Shoes|Testing Shop]]>><<giveclothes "" "shoes" "wear">><</link>>

<<link "Reset Debug" "Testing Wardrobe">><<set $debugtxt to []>><</link>>

Print Debug: <<print $debugtxt>>

:: Testing Text [nobr testing]
<<testingroomlist>>
<<effects>>

Passage: $passage

Tags: $tags

Version: $version
Step: $step

<<link "Reset Debug" passage()>><<set $debugtxt to []>><</link>>

Print Debug: <<print $debugtxt>>

<<if $outertop is 0>>
  <<if $outerbottom is 0>>
<<else>> /*wearing outertop*/
  <</if>><</if>>

  <<if $upperclothes is "naked">>
	<<if $lowerclothes is "naked">>
		<<if $underclothes is "naked">>
		You are completely naked!
		<</if>>
		<<if $underclothes isnot "naked">>
		You are wearing nothing but a <<if $undertype isnot "chastity">>pair of <</if>><<underintegrity>> $undercolour $underclothes.
		<</if>>
	<</if>>
	<<if $lowerclothes isnot "naked">>
		<<if $underclothes is "naked">>
		You are topless and wearing no underwear but your lower half is covered by <<lowerword>> <<lowerintegrity>> $lowercolour $lowerclothes.
		<</if>>
		<<if $underclothes isnot "naked">>
		You are topless with <<lowerword>> <<lowerintegrity>> $lowercolour $lowerclothes and <<underword>> <<underintegrity>> $undercolour $underclothes.
		<</if>>
	<</if>>
<<elseif $upperclothes isnot "naked">>
	<<if $lowerclothes is "naked">>
		<<if $underclothes is "naked">>
			<<if $upperonepiece is 1 and $lowerset isnot $upperset>>
			You are wearing <<upperword>> <<upperintegrity>> $uppercolour $upperclothes that has been torn at the waist  leaving your bottom half completely exposed!
			<<else>>
		Your bottom half is completely exposed! You are wearing <<upperword>> <<upperintegrity>> $uppercolour $upperclothes.
			<</if>>
		<</if>>
		<<if $underclothes isnot "naked">>
			<<if $upperonepiece is 1 and $lowerset isnot $upperset>>
			You are wearing <<upperword>> <<upperintegrity>> $uppercolour $upperclothes that has been torn at the waist  leaving your <<underword>> <<underintegrity>> $undercolour $underclothes exposed.
			<<else>>
		You are wearing <<upperword>> <<upperintegrity>> $uppercolour $upperclothes and exposed <<underword>> <<underintegrity>> $undercolour $underclothes.
			<</if>>
		<</if>>
	<</if>>
	<<if $lowerclothes isnot "naked">>
		<<if $underclothes is "naked">>
		You are wearing <<upperword>> <<upperintegrity>> $uppercolour $upperclothes
		<<if $loweronepiece isnot 1>>and <<lowerword>> <<lowerintegrity>> $lowercolour $lowerclothes
		<</if>>
		<<if $lowertype is "swim">>and<<else>>but<</if>> you are not wearing underwear.
		<</if>>
		<<if $underclothes isnot "naked">><<nobr>>
		You are wearing <<upperword>> <<upperintegrity>> $uppercolour $upperclothes
		<<if $loweronepiece isnot 1>>with <<lowerword>> <<lowerintegrity>> $lowercolour $lowerclothes
		<</if>>and <<underword>> <<underintegrity>> $undercolour $underclothes.
		<<endnobr>><</if>>
	<</if>>
<</if>>

:: Testing Variables [nobr testing]
<<testingroomlist>>
<<effects>>
<<variablebar "Pain" "$pain" 0 2 20 200>>
<<variablebar "Arousal" "$arousal" 0 100 1000 10000>>
<<variablebar "Fatigue" "$tiredness" 0 20 200 2000>>
<<variablebar "Stress" "$stress" 0 100 1000 10010>>
<<variablebar "Trauma" "$trauma" 0 50 500 5000>>

<<variablebar "Promiscuity" "$promiscuity" 0 1 10 100>>
<<variablebar "Exhibitionism" "$exhibitionism" 0 1 10 100>>

Toggle:
<<link "Gender">><<if $playergender is "f">>
<<set $vaginaexist to 0>><<set $playergender to "m">><<set $penisexist to 1>>
<<else>><<set $penisexist to 0>><<set $playergender to "f">><<set $vaginaexist to 1>><</if>>
<<goto "Testing Variables">><</link>>  |
<<link "Virginity">>
<<if $penilevirginity is 0 or $vaginalvirginity is 0>>
  <<set $penilevirginity to 1>><<set $vaginalvirginity to 1>><<set $oralvirginity to 1>><<set $analvirginity to 1>>
<<else>>
  <<set $penilevirginity to 0>><<set $vaginalvirginity to 0>><<set $oralvirginity to 0>><<set $analvirginity to 0>>
<</if>>
<<goto "Testing Variables">><</link>> |
<<link "Hirsute">>
<<if $hirsutedisable is "f">><<set $hirsutedisable to "t">>
<<else>><<set $hirsutedisable to "f">><</if>>
<<goto "Testing Variables">><</link>>  |
<<link "Bound Left Arm">>
<<if $leftarm is "bound">><<set $leftarm to 0>><<set $leftboundcarry to 0>>
<<else>><<set $leftarm to "bound">><</if>>
<<goto "Testing Variables">><</link>>  |
<<link "Bound Right Arm">>
<<if $rightarm is "bound">><<set $rightarm to 0>><<set $rightboundcarry to 0>>
<<else>><<set $rightarm to "bound">><</if>>
<<goto "Testing Variables">><</link>>

Breast Size - 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12

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

<<variablebar "Hair Length" "$hairlength" 0 10 100 1000>>

Eye Colour (<<= $eyecolour>>):
<<link "Hazel">><<set $eyecolour to "hazel">><<goto "Testing Variables">><</link>> |
<<link "Amber">><<set $eyecolour to "amber">><<goto "Testing Variables">><</link>> |
<<link "Green">><<set $eyecolour to "green">><<goto "Testing Variables">><</link>> |
<<link "Dark Blue">><<set $eyecolour to "dark blue">><<goto "Testing Variables">><</link>> |
<<link "Light Blue">><<set $eyecolour to "light blue">><<goto "Testing Variables">><</link>> |
<<link "Purple">><<set $eyecolour to "purple">><<goto "Testing Variables">><</link>>

<<link "<">><<set $wolfgirl -= 1>><<goto "Testing Variables">><</link>>
Wolf (<<= $wolfgirl>>)
<<link ">">><<set $wolfgirl += 1>><<goto "Testing Variables">><</link>> |
<<link "<">><<set $angel -= 1>><<goto "Testing Variables">><</link>>
Angel (<<= $angel>>)
<<link ">">><<set $angel += 1>><<goto "Testing Variables">><</link>> |
<<link "<">><<set $demon -= 1>><<goto "Testing Variables">><</link>>
Demon (<<= $demon>>)
<<link ">">><<set $demon += 1>><<goto "Testing Variables">><</link>> |
<<link "<">><<set $fallenangel -= 1>><<goto "Testing Variables">><</link>>
Fallen Angel (<<= $fallenangel>>)
<<link ">">><<set $fallenangel += 1>><<goto "Testing Variables">><</link>>

Semen:
<<link "<">><<set $vaginasemen -= 1>><<goto "Testing Variables">><</link>>
Vagina (<<= $vaginasemen>>)
<<link ">">><<set $vaginasemen += 1>><<goto "Testing Variables">><</link>> |
<<link "<">><<set $anussemen -= 1>><<goto "Testing Variables">><</link>>
Anus (<<= $anussemen>>)
<<link ">">><<set $anussemen += 1>><<goto "Testing Variables">><</link>> |
<<link "<">><<set $mouthsemen -= 1>><<goto "Testing Variables">><</link>>
Mouth (<<= $mouthsemen>>)
<<link ">">><<set $mouthsemen += 1>><<goto "Testing Variables">><</link>>

Goo:
<<link "<">><<set $vaginagoo -= 1>><<goto "Testing Variables">><</link>>
Vagina (<<= $vaginagoo>>)
<<link ">">><<set $vaginagoo += 1>><<goto "Testing Variables">><</link>> |
<<link "<">><<set $anusgoo -= 1>><<goto "Testing Variables">><</link>>
Anus (<<= $anusgoo>>)
<<link ">">><<set $anusgoo += 1>><<goto "Testing Variables">><</link>> |
<<link "<">><<set $mouthgoo -= 1>><<goto "Testing Variables">><</link>>
Mouth (<<= $mouthgoo>>)
<<link ">">><<set $mouthgoo += 1>><<goto "Testing Variables">><</link>>

Parasite:
<<link "Chest">>
<<if $chestparasite is 0>><<set $chestparasite to 1>>
<<else>><<set $chestparasite to 0>><</if>>
<<goto "Testing Variables">><</link>>  |
<<link "Penis">>
<<if $penisparasite is 0>><<set $penisparasite to 1>>
<<else>><<set $penisparasite to 0>><</if>>
<<goto "Testing Variables">><</link>>  |
<<link "Clit">>
<<if $clitparasite is 0>><<set $clitparasite to 1>>
<<else>><<set $clitparasite to 0>><</if>>
<<goto "Testing Variables">><</link>>

<<if $outertop isnot 0>>
Outerclothes Top:  <<link "<<">><<set $outertop.integrity -= 10>><<goto "Testing Variables">><</link>>
<<link "<">><<set $outertop.integrity -= 1>><<goto "Testing Variables">><</link>>
Integrity (<<= $outertop.integrity>>)
<<link ">">><<set $outertop.integrity += 1>><<goto "Testing Variables">><</link>>
<<link ">>">><<set $outertop.integrity += 10>><<goto "Testing Variables">><</link>>  |
<<link "<">><<set $outertop.wet -= 1>><<goto "Testing Variables">><</link>>
Wet (<<= $outertop.wet>>)
<<link ">">><<set $outertop.wet += 1>><<goto "Testing Variables">><</link>>

<</if>>
<<if $outerbottom isnot 0>>
Outerclothes Bottom:  <<link "<<">><<set $outerbottom.botintegrity -= 10>><<goto "Testing Variables">><</link>>
<<link "<">><<set $outerbottom.botintegrity -= 1>><<goto "Testing Variables">><</link>>
Integrity (<<= $outerbottom.botintegrity>>)
<<link ">">><<set $outerbottom.botintegrity += 1>><<goto "Testing Variables">><</link>>
<<link ">>">><<set $outerbottom.botintegrity += 10>><<goto "Testing Variables">><</link>>  |
<<link "<">><<set $outerbottom.wet -= 1>><<goto "Testing Variables">><</link>>
Wet (<<= $outerbottom.wet>>)
<<link ">">><<set $outerbottom.wet += 1>><<goto "Testing Variables">><</link>>

<</if>>
<<if $top isnot 0>>
Upper Clothes:  <<link "<<">><<set $top.integrity -= 10>><<goto "Testing Variables">><</link>>
<<link "<">><<set $top.integrity -= 1>><<goto "Testing Variables">><</link>>
Integrity (<<= $top.integrity>>)
<<link ">">><<set $top.integrity += 1>><<goto "Testing Variables">><</link>>
<<link ">>">><<set $top.integrity += 10>><<goto "Testing Variables">><</link>>  |
<<link "<">><<set $top.wet -= 1>><<goto "Testing Variables">><</link>>
Wet (<<= $top.wet>>)
<<link ">">><<set $top.wet += 1>><<goto "Testing Variables">><</link>>

<</if>>
<<if $bottom isnot 0>>
Lower Clothes:  <<link "<<">><<set $bottom.botintegrity -= 10>><<goto "Testing Variables">><</link>>
<<link "<">><<set $bottom.botintegrity -= 1>><<goto "Testing Variables">><</link>>
Integrity (<<= $bottom.botintegrity>>)
<<link ">">><<set $bottom.botintegrity += 1>><<goto "Testing Variables">><</link>>
<<link ">>">><<set $bottom.botintegrity += 10>><<goto "Testing Variables">><</link>>  |
<<link "<">><<set $bottom.wet -= 1>><<goto "Testing Variables">><</link>>
Wet (<<= $bottom.wet>>)
<<link ">">><<set $bottom.wet += 1>><<goto "Testing Variables">><</link>>

<</if>>
<<if $undertop isnot 0>>
Underclothes Top:  <<link "<<">><<set $undertop.integrity -= 10>><<goto "Testing Variables">><</link>>
<<link "<">><<set $undertop.integrity -= 1>><<goto "Testing Variables">><</link>>
Integrity (<<= $undertop.integrity>>)
<<link ">">><<set $undertop.integrity += 1>><<goto "Testing Variables">><</link>>
<<link ">>">><<set $undertop.integrity += 10>><<goto "Testing Variables">><</link>>  |
<<link "<">><<set $undertop.wet -= 1>><<goto "Testing Variables">><</link>>
Wet (<<= $undertop.wet>>)
<<link ">">><<set $undertop.wet += 1>><<goto "Testing Variables">><</link>>

<</if>>
<<if $underbottom isnot 0>>
Underclothes Bottom:  <<link "<<">><<set $underbottom.botintegrity -= 10>><<goto "Testing Variables">><</link>>
<<link "<">><<set $underbottom.botintegrity -= 1>><<goto "Testing Variables">><</link>>
Integrity (<<= $underbottom.botintegrity>>)
<<link ">">><<set $underbottom.botintegrity += 1>><<goto "Testing Variables">><</link>>
<<link ">>">><<set $underbottom.botintegrity += 10>><<goto "Testing Variables">><</link>>  |
<<link "<">><<set $underbottom.wet -= 1>><<goto "Testing Variables">><</link>>
Wet (<<= $underbottom.wet>>)
<<link ">">><<set $underbottom.wet += 1>><<goto "Testing Variables">><</link>>

<</if>>
<<if $underacc isnot 0>>
Under Accessory:  <<link "<<">><<set $underacc.botintegrity -= 1000>><<goto "Testing Variables">><</link>>
<<link "<">><<set $underacc.botintegrity -= 100>><<goto "Testing Variables">><</link>>
Integrity (<<= $underacc.botintegrity>>)
<<link ">">><<set $underacc.botintegrity += 100>><<goto "Testing Variables">><</link>>
<<link ">>">><<set $underacc.botintegrity += 1000>><<goto "Testing Variables">><</link>>  |
<<link "<">><<set $underacc.wet -= 1>><<goto "Testing Variables">><</link>>
Wet (<<= $underacc.wet>>)
<<link ">">><<set $underacc.wet += 1>><<goto "Testing Variables">><</link>>

<</if>>
<<if $legs isnot 0>>
Leggings and Socks:  <<link "<<">><<set $legs.integrity -= 10>><<goto "Testing Variables">><</link>>
<<link "<">><<set $legs.integrity -= 1>><<goto "Testing Variables">><</link>>
Integrity (<<= $legs.integrity>>)
<<link ">">><<set $legs.integrity += 1>><<goto "Testing Variables">><</link>>
<<link ">>">><<set $legs.integrity += 10>><<goto "Testing Variables">><</link>>  |
<<link "<">><<set $legs.wet -= 1>><<goto "Testing Variables">><</link>>
Wet (<<= $legs.wet>>)
<<link ">">><<set $legs.wet += 1>><<goto "Testing Variables">><</link>>

<</if>>

:: Widgets Testing [widget]
<<widget "testingroomlist">><<nobr>>
<<if $passage is "Testing Wardrobe">> ''[[Wardrobe|Testing Wardrobe]]''
<<else>> [[Wardrobe|Testing Wardrobe]] <</if>> |
<<if $passage is "Testing Shop">> ''[[Shop|Testing Shop]]''
<<else>> [[Shop|Testing Shop]] <</if>> |
<<if $passage is "Testing Sprite">> ''[[Sprite|Testing Sprite]]''
<<else>> [[Sprite|Testing Sprite]] <</if>> |
<<if $passage is "Testing Text">> ''[[Text|Testing Text]]''
<<else>> [[Text|Testing Text]] <</if>> |
<<if $passage is "Testing Variables">> ''[[Variables|Testing Variables]]''
<<else>> [[Variables|Testing Variables]] <</if>>

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

<<widget "variablebar">><<nobr>>
<<= '[["|<"|' + $passage + '][' + $args[1] + ' to ' + $args[2] + ']]'>>
<<= '[["<<"|' + $passage + '][' + $args[1] + ' -= ' + $args[4] + ']]'>>
<<= '[["<"|' + $passage + '][' + $args[1] + ' -= ' + $args[3] + ']]'>>
<<= '[[">"|' + $passage + '][' + $args[1] + ' += ' + $args[3] + ']]'>>
<<= '[[">>"|' + $passage + '][' + $args[1] + ' += ' + $args[4] + ']]'>>
<<= '[[">|"|' + $passage + '][' + $args[1] + ' to ' + $args[5] + ']]'>>
$args[0] ($args[1])

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


code:
#!/bin/bash
if [ ! -d ".git" ]; then
	#not running in git repo, so can't use git commands :-)
	echo "No .git repo found - skipping sanity checks"
	exit 0
fi

WARNING='\033[93m'
WARNING='\033[93m'
ENDC='\033[0m'

myprint() {
	while read data; do
		echo -n -e "[$1]$WARNING"
		echo "$data"
	done
}

GREP="git grep -n --color"
# Check for missing right angle bracket: <</if>
$GREP "<</[^>]*>[^>]" -- 'game/*'  | myprint "MissingClosingAngleBracket"
$GREP "<<[^>()]*>[^()<>"$'\r]*\r'"\?$" -- 'game/*' | myprint "MissingClosingAngleBracket"
# Check for missing left angle bracket: </if>>
$GREP "\([^<]\|^\)</\?\(if\|else\|case\|set\|print\|elseif\)" -- 'game/*' | myprint "MissingOpeningAngleBracket2"
# Check for accidental assignment.  e.g.:   <<if $foo = "hello">>
$GREP "<<[ ]*if[^>=]*[^><\!=]=[^=][^>]*>>" -- 'game/*' | myprint "AccidentalAssignmentInIf"
# Check for accidental assignment.  e.g.:   <<elseif $foo = "hello">>
$GREP "<<[ ]*elseif[^>=]*[^><\!=]=[^=][^>]*>>" -- 'game/*' | myprint "AccidentalAssignmentInElseIf"
# Check for missing ".  e.g.:   <<if $foo == "hello>>
$GREP "<<[^\"<>]*\"[^\"<>]*>>" -- 'game/*' | myprint "MissingSpeechMark"
# Check for missing ".  e.g.:   <<if $foo = "hello)
$GREP -e "<<[^\"<>]*\([^\"<>]*\"[^><\"]*\"\| [<>] \)*\"\([^\"<>]*\"[^><\"]*\"\| [<>] \)*\([^\"<>]\| [<>] \)*>>" --and --not -e "*[^']*" -- 'game/*' | myprint "MissingSpeechMark2"
# Check for colors like: @@color:red   - should be @@.red
$GREP -e "@@color:" --and --not -e  "@@color:rgb([0-9 ]\+,[0-9 ]\+,[0-9 ]\+)" -- "game/*" | myprint "UseCssColors"
# Check for missing $ in activeSlave or PC
$GREP "<<[ ]*[^\$><_\[]*\(activeSlave\|PC\)[.]"  -- "game/*" | myprint "MissingDollar"
# Check for closing bracket without opening bracket.  e.g.:  <<if foo)>>      (but  <<case "foo")>>   is valid, so ignore those
$GREP -e "<<[ a-zA-Z]\+\([^()<>]\|[^()<>][<>][^()<>]\)*)" --and --not -e "<< *case"  -- "game/*" | myprint "MissingOpeningBracket"
# Check for opening bracket without closing bracket.  e.g.:  <<if (foo>>
$GREP -e "<<[ a-zA-Z]\([^<>]\|[^<>][<>][^<>]\)\+(\([^()<>]\|[^<>()][<>][^<>()]\|([^<>()]*])\)*>>" -- "game/*" | myprint "MissingClosingBracket"
# Check for two closing brackets but one opening bracket.  e.g.:  <<if (foo))>>
$GREP -e "<<[ a-zA-Z]\+[^()<>]*([^()]*)[^()]*)[^()<>]*>>"  -- "game/*" | myprint "MissingOpeningBracket2"
# Check for one closing bracket but two opening brackets.  e.g.:  <<if ((foo)>>
$GREP -e "<<[ a-zA-Z]\+[^()<>]*([^()]*([^()]*)[^()<>]*>>"  -- "game/*" | myprint "MissingClosingBracket2"
$GREP -e "<<.*[(][^<>)]*[(][^<>)]*)\?[^<>)]*>>" -- "game/*" | myprint "MissingClosingBracket3"
# Check for missing >>.  e.g.:   <<if $foo
$GREP "<<[^<>]*[^,\"\[{"$'\r]\r'"\?$" -- 'game/*' | myprint "MissingClosingAngleBrackets"
# Check for too many >>>.  e.g.: <</if>>>
$GREP "<<[^<>]*[<>]\?[^<>]*>>>" -- "game/*.twee" | myprint "TooManyAngleBrackets"
# Check for too many <<<.  e.g.: <<</if>>
$GREP "<<<[^<>]*[<>]\?[^<>]*>>" -- "game/*.twee" | myprint "TooManyAngleBrackets"
# Check for wrong capitalization on 'activeslave' and other common typos
$GREP -e "\$act" --and --not -e "\$\(activeSlave\|activeArcology\|activeStandard\|activeOrgan\|activeLimbs\|activeUnits\|activeCanine\|activeHooved\|activeFeline\)" -- "game/*" | myprint "WrongCapitilization"
$GREP  "\(csae\|[a-z] She \|attepmts\|youreslf\|advnaces\|canAcheive\|setBellySize\|SetbellySize\|setbellySize\|bellypreg\|pregBelly\|bellyimplant\|bellyfluid\|pronounCaps\|carress\)" -- 'game/*' | myprint "SpellCheck"
$GREP  "\(recieve\|recieves\)" -- 'game/*' | myprint "PregmodderCannotSpellReceive"
$GREP "\$slave\[" -- 'game/*' | myprint "ShouldBeSlaves"
# Check for strange spaces e.g.  $slaves[$i]. lips
$GREP "\$slaves\[\$i\]\. " -- 'game/*' | myprint "MissingPropertyAfterSlaves"
# Check, e.g., <<//if>>
$GREP "<</[a-zA-Z]*[^a-zA-Z<>]\+[a-zA-Z]*>>" -- 'game/*' | myprint "DoubleSlash"
# Check, e.g.  <<else $foo==4
$GREP "<<else >\?[^>]" -- 'game/*' | myprint "ShouldBeElseIf"
# Check, e.g., =to
$GREP "=to" -- 'game/*' | myprint "EqualAndTo"
# Check, e.g.  <<set foo == 4>>
$GREP "<<set[^{>=]*==" -- 'game/*' | myprint "DoubleEqualsInSet"
# Check for, e.g   <<if slaves[foo]>>
$GREP "<<\([^>]\|[^>]>[^>]\)*[^$]slaves\[" -- 'game/*' | myprint "MissingDollar"
# Check for missing $ or _ in variable name:
$GREP -e "<<[a-zA-Z]\([^>\"]\|[^>]>[^>]\|\"[^\"]*\"\)* [a-zA-Z]\+ * =" -- game/*.twee | myprint "MissingDollar2"
# Check for missing command, e.g.  <<foo =
$GREP -e "<<[a-zA-Z]* = *" -- game/*.twee | myprint "BadCommand"
# Check for duplicate words, e.g. with with
$GREP -e  " \(\b[a-zA-Z][a-zA-Z]\+\) \1\b " --and --not -e " her her " --and --not -e " you you " --and --not -e " New New " --and --not -e "Slave Slave " --and --not -e " that that " --and --not -e " in in " --and --not -e " is is " -- 'game/*' | myprint "Duplicate words"
# Check for obsolete SugarCube macros
$GREP -E "<<display |<<click|<<.*\.contains" -- game/*.twee | myprint "ObsoleteMacro"
# Check for double articles
$GREP -E "\Wa an\W" -- game/*.twee | myprint "DoubleArticle"
# Check for incorrect articles
$GREP -i -E "\Wa (a|e|i|o|u)." -- game/*.twee | grep -a -i -vE "\Wa (un|eu|us|ut|on|ur|in)." | grep -a -i -vE "(&|<<s>>|UM)." | myprint "IncorrectArticle"
$GREP -i -E "\Wan (b|c|d|f|g|j|k|l|m|n|p|q|r|s|t|v|w|x|y|z)\w." -- game/*.twee | grep -a -i -vE "[A-Z]{3}" | myprint "IncorrectArticle"
# Check for $ sign mid-word
$GREP -i "\w$\w" -- game/*.twee | myprint "VarSignMidWord"
# check for $ sign at beginning of macro
$GREP '<<\s*\$' -- 'game/*'  | myprint "VarSignAtMacroStart"
# check for missing ; before statement
$GREP 'if $ ' -- 'game/*'  | myprint "missing ; before statement"
$GREP 'elseif $ ' -- 'game/*'  | myprint "missing ; before statement"

# Check that we do not have any variables that we use only once.   e.g.     $onlyUsedOnce
# Ignore  *Nationalities
(
cd game/
cat $(find . -name "*.twee" ) | tr -c '$a-zA-Z' '\n'  | sed -n '/^[$]/p' | grep -v "Nationalities" | sort | uniq -u | sed 's/^[$]/-e[$]/' | sed 's/$/\\\\W/' | xargs -r  git grep -n --color | myprint "OnlyUsedOnce"
cat $(find . -name "*.twee" ) | tr -c '.$a-zA-Z[]_' '\n' | sed 's/SugarCube\.State\.variables\./$/g' | sed -n -e 's/^[$]\(PC\|activeSlave\|\(slaves\|tanks\)\[[^]]*\]*\)[.]\([a-zA-Z]\+\).*$/[.]\3/p' | sort | uniq -u |sed 's/^\(.*\)$/-e\1\\\\\b/'  | xargs -r git grep -n --color | myprint "SlaveAttributeUsedOnce"
$GREP "\$\(PC\|activeSlave\|slaves\|tanks\)[.][^a-zA-Z]" | myprint "UnexpectedCharAfterDot"

)

# Check that all the tags are properly opened and closed
git ls-files "game/*.twee" | xargs -d '\n' ./devTools/check.py

path: sanityCheck


code:
*.bat	text eol=crlf
*.tw	text eol=lf
*.sh	text eol=lf
*.py	text eol=lf
*.txt	text eol=lf
compile	text eol=lf
compile-git	text eol=lf
sanityCheck	text eol=lf

path: .gitattributes


code:
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class
*.swp
*.swo

# C extensions
*.so

# Distribution / packaging
.Python
env/
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
*.egg-info/
.installed.cfg
*.egg

# PyInstaller
#  Usually these files are written by a python script from a template
#  before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
.tox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*,cover
.hypothesis/

# Translations
*.mo
*.pot

# Django stuff:
*.log
local_settings.py

# Flask stuff:
instance/
.webassets-cache

# Scrapy stuff:
.scrapy

# Sphinx documentation
docs/_build/

# PyBuilder
target/

# IPython Notebook
.ipynb_checkpoints

# pyenv
.python-version

# celery beat schedule file
celerybeat-schedule

# dotenv
.env

# virtualenv
venv/
ENV/

# Spyder project settings
.spyderproject

# Rope project settings
.ropeproject

# Start.tw
src/config/start.tw

path: .gitignore


code:
further development:
-specialized slave schools
-fortifications
-more levels for militia edict (further militarize society)
-conquering other arcologies?

Events:
-famous criminal escapes to the arcology, followed by another arcology police force

Bugs:
-sometimes troop counts breaks
-sometimes rebel numbers have fractionary parts


code:
# How to vector art

Please read the whole document before starting to work.
Some aspects are not obvious right away.

Note: This does not actually describe how to be an artist.

## TL;DR

    killall inkscape
    artTools/vector_layer_split.py artTools/vector_source.svg tw src/art/vector/layers/
    compile

## 1. Be an artist

Make changes to the vector_source.svg.
Inkscape was thoroughly tested.
Adobe Illustrator might work decently, too.

## 2. Respect the structure

While editing, keep the Layers in mind.

* In Inkscape, Layers are special "Inkscape groups".
* In Illustrator, Layers are groups with user-definded IDs.
* All Layers should have an ID that is globally unique
  (not just within their subtree).

* Please use anonymous groups only for the ease of editing. Remove all "helper" groups before finally saving the file.
* Anonymous groups can be used for continous scaling (of e.g. boobs).

* Every asset that should go into a separate file needs to be in a labelled group
  (even if that is a group with only one shape).
* There are some globally available styles defined as CSS classes (e.g. skin, hair).
  Use them if your asset should be changed upon display.
  Do not set the style directly in the object.

## 3. Normalise the document (before committing)

**THIS IS IMPORTANT**

The various editors out there (Inkscape, Illustrator) may use different variants of formatting the SVG XML.
Use

    python3 normalize_svg.py vector_source.svg

before committing to normalise the format so git will not freak out about the changed indentation.

If you use Inkscape, please use in Edit → Settings → Input/Output → SVG-Output → Path Data → Optimized. This is the default.
In case your Editor uses another path data style which cannot be changed, please contact the other artists and developers via the issue tracker to find a new common ground.

What it does:
* Formats the SVG XML according to Pythons lxml module, regardless of editor.
* Adobe Illustrator uses group IDs as layer labels.
  Inkscape however uses layer labels and a separate, auto-generated group ID.
  normalize_svg.py overwrites the group ID with the Inkscape layer label
  so they are synchronised with Inkscape layer labels.
* Inkscape copies the global style definition into the object *every time*
  the object is edited. If an object references a CSS class AND at the same time
  has a local style, the local style is removed
  so global dynamic styling is possible later on.

Note: Behaviour of Adobe Illustrator is untested.

## 4. Split the layers

For NoX original, deepurk extensions, execute

    python3 vector_layer_split.py vector_source_ndmain.svg tw ../src/art/vector/layers/

For faraen revamped art (based on NoX original)

	python3 vector_revamp_layer_split.py vector_revamp_source.svg tw ../src/art/vector_revamp/layers/

. This application reads all groups in `vector_source.svg`.
Each group is stored in a separate file in the target directory `/src/art/vector/layers/`.
The group ID sets the file name. Therefore, the group ID **must not** contain spaces or any other weird characters.

Also consider:
* A group with ID ending in _ is ignored. Use Layers ending in _ to keep overview.
* A group with ID starting with "g" (Inkscape) or "XMLID" (Illustrator) is also ignored.
* Existing files are overwritten **without enquiry**.
* The target directory is not emptied. If a file is no longer needed, you should remove it manually.
* This procedure removes global definitions. This means, SVG filters are currently not supported.

Available output formats are `svg` and `tw`.
`svg` output exists for debug reasons.
`tw` embeds the SVG data into Twine files, but removes the global style definitions so they can be set during display.

## 5. Edit the code

`/src/art/` contains Twine code which shows the assets in the story.
There are many helpful comments in `/src/art/artWidgets.tw`.
The code also generates the previously removed global style definitions on the fly and per display.

## 6. Compile the story

Use the provided compile script (Windows batch or shell) for compiling.

## 7. Advanced usage

You can define multiple CSS classes to one element, e.g. "skin torso". When procedurally generating CSS, you can then set a global "skin" style, and a different one for "torso".

You can put variable text into the image using single quotes, e.g. "'+_tattooText+'". The single quotes *break* the quoting in Twine so the content of the Twine variable `_tattooText` is shown upon display. You can even align text on paths.

An anonymous group can be used for dynamic transformation. However, finding the correct parameters for the affine transformation matrix can be cumbersome. Use any method you see fit. See `src/art/vector/Boob.tw` for one example of the result.


code:
Apron
AttractiveLingerie
AttractiveLingerieForAPregnantWoman
BallGown
Battledress
BodyOil
Bunny
Chains
ChattelHabit
Cheerleader
ClubslutNetting
ComfortableBodysuit
Conservative
Cutoffs
Cybersuit
FallenNunsHabit
FuckdollSuit
HalterTopDress
HaremGauze
Hijab
Huipil
Kimono
LatexCatsuit
Leotard
LongQipao
MaternityDress
MilitaryUniform
MiniDress
Monokini
NiceBusinessAttire
NiceMaid
NiceNurse
No
PenitentNunsHabit
RedArmyUniform
RestrictiveLatex
ScalemailBikini
SchoolgirlUniform
SchutzstaffelUniform
ShibariRopes
SlaveGown
Slutty
SluttyBusinessAttire
SluttyJewelry
SluttyMaid
SluttyNurse
SluttyQipao
SluttySchutzstaffelUniform
Spats
StretchPants
StringBikini
Succubus
Toga
UncomfortableStraps
Western


code:
#!/bin/bash

# This script reads all possible values of $slave.clothes as mentioned by the documentation.
# This script uses the actual implementation of the JS clothing2artSuffix function as defined in src/art/vector/Helper_Functions.tw
# This script outputs suffixes to be used in the SVG naming scheme
# This script is meant to be executed at the project root directory.
# This script depends on bash, grep, sed, paste and nodejs (so best executed on Linux, I guess)

# grep -Porh '(?<=\.clothes = )"[^"]+"' src/ | sort | uniq # searches sources for all clothes strings actually used in the game, even undocumented ones

(
  echo 'var window = {};'
  grep -v '^:' src/art/vector/Helper_Functions.tw
  echo -n 'Array('
  sed '/^clothes:/,/:/!d' "slave variables documentation - Pregmod.txt" | grep '"' | paste -sd,
  echo ').forEach(v => {console.log(window.clothing2artSuffix(v));});'
) | nodejs | sort


code:
#!/usr/bin/env python3

'''
Application for "normalizing" SVGs

These problems are addressed:

* Inkscape notoriously copies class styles into the object definitions.
https://bugs.launchpad.net/inkscape/+bug/167937

* Inkscape uses labels on layers. Layers are basically named groups.
  Inkscape does not sync the group id with the layer label.

Usage Example:
python3 inkscape_svg_fixup.py vector_source.svg
'''

import lxml.etree as etree
import sys

def fix(tree):
  # know namespaces
  ns = {
    'svg' : 'http://www.w3.org/2000/svg',
    'inkscape' : 'http://www.inkscape.org/namespaces/inkscape'
  }

  # find document global style definition
  # mangle it and interpret as python dictionary
  style_element = tree.find('./svg:style',namespaces=ns)
  style_definitions = style_element.text
  pythonic_style_definitions = '{'+style_definitions.\
  replace('\t.','"').replace('{','":"').replace('}','",').\
  replace('/*','#')+'}'
  styles = eval(pythonic_style_definitions)

  # go through all SVG elements
  for elem in tree.iter():
    if (elem.tag == etree.QName(ns['svg'], 'g')):
      # compare inkscape label with group element ID
      l = elem.get(etree.QName(ns['inkscape'], 'label'))
      if l:
        i = elem.get('id')
        if (i != l):
          print("Overwriting ID %s with Label %s..."%(i, l))
          elem.set('id', l)

    # clean styles (for easier manual merging)
    style_string = elem.get('style')
    if style_string:
      split_styles = style_string.strip('; ').split(';')
      styles_pairs = [s.strip('; ').split(':') for s in split_styles]
      filtered_pairs = [ (k,v) for k,v in styles_pairs if not (
        k.startswith('font-') or
        k.startswith('text-') or
        k.endswith('-spacing') or
        k in ["line-height", " direction", " writing", " baseline-shift", " white-space", " writing-mode"]
      )]
      split_styles = [':'.join(p) for p in filtered_pairs]
      style_string = ';'.join(sorted(split_styles))
      elem.attrib["style"] = style_string

    # remove all style attributes offending class styles
    s = elem.get('style')
    c = elem.get('class')
    if (c and s):
      s = s.lower()
      c = c.split(' ')[0] # regard main style only
      cs = ''
      if c in styles:
        cs = styles[c].strip('; ').lower()
      if (c not in styles):
        print("Object id %s references unknown style class %s."%(i,c))
      else:
        if (cs != s.strip('; ')):
          print("Style %s removed from object id %s differed from class %s style %s."%(s,i,c,cs))
        del elem.attrib["style"]

if __name__ == "__main__":
  input_file = sys.argv[1]
  tree = etree.parse(input_file)
  fix(tree)
  # store SVG into file (input file is overwritten)
  svg = etree.tostring(tree, pretty_print=True)
  with open(input_file, 'wb') as f:
    f.write('<?xml version="1.0" encoding="UTF-8" standalone="no"?>\n'.encode("utf-8"))
    f.write(svg)


code:
#!/usr/bin/env python3

'''
Application for procedural content adaption
*THIS IS VERY EXPERIMENTAL*
Contains a very poor man's implementation of spline mesh warping.

This application parses SVG path data of an outfit sample aligned to a body part.
The outfit is then replicated for other shapes of the same body part.

Example data is geared towards generating a strap outfit for boobs and torso
for all sizes of boobs and all shapes of torsos based on a single outfit for
boobs of size 2 and a hourglass torso respectively.

Limitations:
* handles paths only
* only svg.path Line and CubicBezier are tested
* only the aforementioned examples are tested

Usage:
python3 vector_clothing_replicator.py infile clothing bodypart destinationfile

Usage Example:
python3 vector_clothing_replicator.py vector_source.svg Straps Boob vector_destination.svg
python3 vector_clothing_replicator.py vector_source.svg Straps Torso vector_destination.svg
'''

from svg.path import parse_path
import copy
import lxml.etree as etree
import sys

REFERENCE_PATH_SAMPLES = 200
EMBED_REPLICATIONS = True # wether to embed all replications into the input file or output separate files

input_file = sys.argv[1]
clothing = sys.argv[2]
bodypart = sys.argv[3]
output_file_embed = sys.argv[4]

# TODO: make these configurable
output_file_pattern = '%s_%s_%s.svg' #bodypart, target_id, clothing

if ('Torso' == bodypart):
  xpath_shape = './svg:g[@id="Torso_"]/svg:g[@id="Torso_%s"]/svg:path[@class="skin torso"]/@d' # TODO: formulate more general, independent of style
  xpath_outfit_container = '//svg:g[@id="Torso_Outfit_%s_"]'%(clothing)
  xpath_outfit = '//svg:g[@id="Torso_Outfit_%s_%s"]'%(clothing,'%s')
  target_ids = "Unnatural,Hourglass,Normal".split(",")
  reference_id = "Hourglass"
else:
  raise RuntimeError("Please specify a bodypart for clothing to replicate.")

tree = etree.parse(input_file)
ns = {'svg' : 'http://www.w3.org/2000/svg'}

canvas = copy.deepcopy(tree)
for e in canvas.xpath('./svg:g',namespaces=ns)+canvas.xpath('./svg:path',namespaces=ns):
  # TODO: this should be "remove all objects, preserve document properties"
  e.getparent().remove(e)

def get_points(xpath_shape):
  '''
  This funciton extracts reference paths by the given xpath selector.
  Each path is used to sample a fixed number of points.
  '''
  paths_data = tree.xpath(xpath_shape,namespaces=ns)
  points = []
  path_length = None
  for path_data in paths_data:
    p = parse_path(path_data)
    points += [
      p.point(1.0/float(REFERENCE_PATH_SAMPLES)*i)
      for i in range(REFERENCE_PATH_SAMPLES)
    ]
  if (not points):
    raise RuntimeError(
      'No paths for reference points found by selector "%s".'%(xpath_shape)
    )
  return points

def point_movement(point, reference_points, target_points):
  '''
  For a given point, finds the nearest point in the reference path.
  Gives distance vector from the nearest reference point to the
  respective target reference point.
  '''
  distances = [abs(point-reference_point) for reference_point in reference_points]
  min_ref_dist_idx = min(enumerate(distances), key=lambda x:x[1])[0]
  movement = target_points[min_ref_dist_idx] - reference_points[min_ref_dist_idx]
  return movement

reference_points = get_points(xpath_shape%(reference_id))
container = tree.xpath(xpath_outfit_container,namespaces=ns)
if (len(container) != 1):
  raise RuntimeError('Outfit container selector "%s" does not yield exactly one layer.'%(xpath_outfit_container))
container = container[0]
outfit_source = container.xpath(xpath_outfit%(reference_id),namespaces=ns)
if (len(outfit_source) != 1):
  raise RuntimeError('Outfit source selector "%s" does not yield exactly one outfit layer in container selected by "%s".'%(xpath_outfit%(reference_id), xpath_outfit_container))
outfit_source = outfit_source[0]

for target_id in target_ids:
  print(
    'Generating variant "%s" of clothing "%s" for bodypart "%s"...'%
    (target_id, clothing, bodypart)
  )
  outfit = copy.deepcopy(outfit_source)
  paths = outfit.xpath('./svg:path',namespaces=ns)
  if target_id == reference_id:
    print("This is the source variant. Skipping...")
  else:
    layerid = outfit.get('id').replace('_%s'%(reference_id),'_%s'%(target_id))
    outfit.set('id', layerid)
    outfit.set(etree.QName('http://www.inkscape.org/namespaces/inkscape', 'label'), layerid) # for the Inkscape-users
    target_points = get_points(xpath_shape%(target_id))
    if (len(reference_points) != len(target_points)):
      raise RuntimeError(
        ('Different amounts of sampled points in reference "%s" and target "%s" paths. '+
        'Selector "%s" probably matches different number of paths in the two layers.')%
        (reference_id, target_id, xpath_shape)
      )
    for path in paths:
      path_data = path.get("d")
      p = parse_path(path_data)
      for segment in p:
        original_distance = abs(segment.end-segment.start)
        start_movement = point_movement(segment.start, reference_points, target_points)
        segment.start += start_movement
        end_movement = point_movement(segment.end, reference_points, target_points)
        segment.end += end_movement
        distance = abs(segment.end-segment.start)
        try:
          # enhance position of CubicBezier control points
          # amplification is relative to the distance gained by movement
          segment.control1 += start_movement
          segment.control1 += (segment.control1-segment.start)*(distance/original_distance-1.0)
          segment.control2 += end_movement
          segment.control2 += (segment.control2-segment.end)*(distance/original_distance-1.0)
        except AttributeError as ae:
          # segment is not a CubicBezier
          pass
      path.set("d", p.d())
    if EMBED_REPLICATIONS:
      container.append(outfit)
  if not EMBED_REPLICATIONS:
    container = copy.deepcopy(canvas).xpath('.',namespaces=ns)[0]
    container.append(outfit)

  if not EMBED_REPLICATIONS:
    svg = etree.tostring(container, pretty_print=True)
    with open((output_file_pattern%(bodypart, target_id, clothing)).lower(), 'wb') as f:
      f.write('<?xml version="1.0" encoding="UTF-8" standalone="no"?>\n'.encode("utf-8"))
      f.write(svg)

if EMBED_REPLICATIONS:
  svg = etree.tostring(tree, pretty_print=True)
  with open(output_file_embed, 'wb') as f:
    f.write('<?xml version="1.0" encoding="UTF-8" standalone="no"?>\n'.encode("utf-8"))
    f.write(svg)


code:
#!/usr/bin/env python3

'''
Application for splitting groups from one SVG file into separate files

Usage:
python3 vector_layer_split.py infile format outdir

Usage Example:
python3 vector_layer_split.py vector_source.svg tw ../src/art/vector/layers/
'''

import lxml.etree as etree
import sys
import os
import copy
import re
import normalize_svg

input_file = sys.argv[1]
output_format = sys.argv[2]
output_directory = sys.argv[3]
if not os.path.exists(output_directory):
    os.makedirs(output_directory)

ns = {
  'svg' : 'http://www.w3.org/2000/svg',
  'inkscape' : 'http://www.inkscape.org/namespaces/inkscape',
  'sodipodi':"http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd",
}

tree = etree.parse(input_file)
normalize_svg.fix(tree)

# prepare output template
template = copy.deepcopy(tree)
root = template.getroot()

# remove all svg root attributes except document size
for a in root.attrib:
  if (a != "viewBox"):
    del root.attrib[a]

# add placeholder for CSS class (needed for workaround for non HTML 5.1 compliant browser)
if output_format == 'tw':
  root.attrib["class"] = "'+_art_display_class+'"

# remove all content, including metadata
# for twine output, style definitions are removed, too
defs = None
for e in root:
  if (e.tag == etree.QName(ns['svg'], 'defs')):
    defs = e
  if (e.tag == etree.QName(ns['svg'], 'g') or
      e.tag == etree.QName(ns['svg'], 'metadata') or
      e.tag == etree.QName(ns['svg'], 'defs') or
      e.tag == etree.QName(ns['sodipodi'], 'namedview') or
      (output_format == 'tw' and e.tag == etree.QName(ns['svg'], 'style'))
      ):
    root.remove(e)
# template preparation finished

# prepare regex for later use
regex_xmlns = re.compile(' xmlns[^ ]+',)
regex_space = re.compile('[>][ ]+[<]',)

# find all groups
layers = tree.xpath('//svg:g',namespaces=ns)
for layer in layers:
  i = layer.get('id')
  if ( # disregard non-content groups
    i.endswith("_") or # manually suppressed with underscore
    i.startswith("XMLID") or # Illustrator generated group
    i.startswith("g") # Inkscape generated group
  ):
    continue
  # create new canvas
  output = copy.deepcopy(template)
  # copy all shapes into template
  canvas = output.getroot()
  for e in layer:
    canvas.append(e)
  # represent template as SVG (binary string)
  svg = etree.tostring(output, pretty_print=False)
  # poor man's conditional defs insertion
  # TODO: extract only referenced defs (filters, gradients, ...)
  # TODO: detect necessity by traversing the elements. do not stupidly search in the string representation
  if ("filter:" in svg.decode('utf-8')):
    # it seems there is a filter referenced in the generated SVG, re-insert defs from main document
    canvas.insert(0,defs)
    # re-generate output
    svg = etree.tostring(output, pretty_print=False)

  if (output_format == 'tw'):
    # remove unnecessary attributes
    # TODO: never generate unnecessary attributes in the first place
    svg = svg.decode('utf-8')
    svg = regex_xmlns.sub('',svg)
    svg = svg.replace(' inkscape:connector-curvature="0"','') # this just saves space
    svg = svg.replace('\n','').replace('\r','') # print cannot be multi-line
    svg = regex_space.sub('><',svg) # remove indentaion
    svg = svg.replace('svg:','') # svg namespace was removed
    svg = svg.replace('<g ','<g transform="\'+_art_transform+\'"') # internal groups are used for scaling
    svg = svg.encode('utf-8')

  # save SVG string to file
  i = layer.get('id')
  output_path = os.path.join(output_directory,i+'.'+output_format)
  with open(output_path, 'wb') as f:
    if (output_format == 'svg'):
      # Header for normal SVG (XML)
      f.write('<?xml version="1.0" encoding="UTF-8" standalone="no"?>\n'.encode("utf-8"))
      f.write(svg)
    elif (output_format == 'tw'):
      # Header for SVG in Twine file (SugarCube print statement)
      f.write((':: Art_Vector_%s [nobr]\n\n'%(i)).encode("utf-8"))
      f.write("<<print '<html>".encode("utf-8"))
      f.write(svg)
      f.write("</html>' >>".encode("utf-8"))