code:
:: Prison Cell
<<set $outside to 0>><<location "prison">><<effects>><<effects_prison>><<set $bus to "cell">>

You are in your cell. There's a bed in one corner, and a cupboard in another. A barred gate separates you from the walkway outside. There's no privacy.
<<if $prison.poster is "man">>
    A poster depicting a sexy gentleman hangs on one wall.
<<elseif $prison.poster is "woman">>
    A poster depicting a sexy lady hangs on one wall.
<<elseif $prison.poster is "puppy">>
    A poster depicting a cute puppy hangs on one wall.
<</if>>

<<if $hour is 20 and $prison.evening isnot 1>>
    Thuds echo down the hall as cells lock shut.

    <<set $prison.evening to 1>>
<<elseif $prison.schedule is "lockdown">>
    The door is locked.

<</if>>
<<if $prison.schedule is "hunt" and $prison.morning isnot 1>>
    <<set $prison.schedule to "wake">>
    <<generate_methodical_guard 0>><<person1>>
    The lights buzz into life, and a rattle echoes as the cell doors slide open. A <<personsimple>>'s voice rings through the hall. "Role call." You see other prisoners lining up.

    <<link [[Line up|Prison Cell Role]]>><<cell_trouble -1>><</link>>

    <<link [[Refuse|Prison Cell Refuse]]>><<prison_guards 1>><<prison_inmates 1>><<pain 4>><<cell_trouble 1>><</link>><<gpain>><<gsuspicion>><<grespect>>

    <<set $prison.morning to 1>>
<<else>>

	<<if $leftarm is "bound" or $rightarm is "bound">>
		<<ind>><<link [[Undo your bindings (0:10)|Prison Cell]]>><<set $unbind to 1>><<pass 10>><<arm_unbind>><</link>>

	<</if>>
    <<if $prison.poster and !$prison.tunnel>>
        <<ind>><<link [[Examine your poster|Prison Poster]]>><<set $prison.tunnel to 1>><</link>>

    <<elseif $prison.tunnel is 1 and $prison.hammer is 1>>
        <<ind>><<link [[Test the wall behind the poster|Prison Poster 2]]>><<set $prison.tunnel to 2>><</link>>

    <<elseif $prison.tunnel gte 120 and $prison.schedule is "lockdown">>
        <<ind>><<link [[Examine tunnel|Prison Tunnel]]>><</link>>

    <<elseif $prison.tunnel gte 2 and $prison.schedule is "lockdown">>
        <<ind>><<link [[Dig tunnel|Prison Tunnel]]>><</link>>

    <</if>>
    <<if $prison.schedule is "revolt">>
        It's too noisy to sleep.

    <<else>>
		<<listsleepoutfits "prison bed">>
        <<bedicon>><<link [[Strip and get in bed|Prison Bed]]>><<undressSleep "prison bed">><</link>>

    <</if>>
	<<roomoptions>>
    <<if $prison.schedule isnot "lockdown" and !$worn.face.type.includes("blindfold")>>
        <<plaqueicon>><<link [[Plaque|Prison Plaque]]>><</link>>

    <</if>>
	<<wardrobeicon>><<link [[Cupboard|Prison Wardrobe]]>><</link>>

    <<if $prison.mirror gte 1>>
        <<mirroricon>><<link [[Mirror|Prison Mirror]]>><</link>>

    <</if>>

    <<if $prison.schedule isnot "lockdown">>
        <<link [[Leave|Prison Walkway]]>><</link>>

    <</if>>

	<<link [[Settings|Prison Settings]]>><</link>>

	<<attitudesControlCheck>>
	<<if $attitudesControl.showGoldLink is true>>
		<<link [[Attitudes]]>><<set $attitudesExitPassage to $passage>><</link>> !!
	<<else>>
		<<link [[Attitudes]]>><<set $attitudesExitPassage to $passage>><</link>>
	<</if>>

<</if>>

<<set $eventskip to 0>>

:: Prison Mirror
<<effects>>

<<link [[Step away|Prison Cell]]>><<unset $mirrorMenu>><<unset $bodywritingSet>><</link>>

<<mirror>>

:: Prison Poster
<<effects>>

You examine your poster.
<<if $prison.poster is "man">>
    He wears a seductive expression, but there's something in his eyes. Like he's keeping a secret.
<<elseif $prison.poster is "lady">>
    She wears a seductive expression, but there's something in her eyes. Like she's keeping a secret.
<<elseif $prison.poster is "puppy">>
    The puppy looks spirited and mischievous. Almost like it's hiding something.
<</if>>

You remember the crack in the wall. You pull the poster back, and run your finger down the schism. Some of the stone crumbles away.

If you had something to dig with, you could do more.

<<link [[Next|Prison Cell]]>><</link>>

:: Prison Poster 2
<<effects>>

Hammer in hand, and careful not to make too much noise, you tap the wall behind the poster. More stone crumbles away. It would take a very long time, but with the hammer to dig, and poster to conceal your work, you could tunnel to the edge of the island.

You could only dig during lockdown. Too risky otherwise.

<<link [[Next|Prison Cell]]>><</link>>

:: Prison Tunnel
<<effects>>

<<if $prison.tunnel gte 120>>
    You peer down the tunnel. The sky peers back.

    <<link [[Crawl to the edge (0:03)|Prison Tunnel Edge]]>><<pass 3>><</link>>

<<else>>
    <<if $prison.tunnel gte 80>>
        The tunnel stretches into darkness.
    <<elseif $prison.tunnel gte 40>>
        The tunnel passes through the prison wall, into the natural rock of the island.
    <<elseif $prison.tunnel gte 20>>
        The short tunnel bores through the prison wall.
    <<elseif $prison.tunnel gte 10>>
        The hole in the wall is wide enough to fit your body.
    <<else>>
        The wall is cracked.
    <</if>>

    <<for _i to 1; _i lt 9; _i++>>
        <<if _i is 1>>
            <<link [[Dig for 1 hour|Prison Tunnel Dig]]>><<set $prison_dig to 1>><</link>><<gtiredness>>

        <<else>>
            <<capture _i>>
                <<link [["Dig for " + _i + " hours"|Prison Tunnel Dig]]>><<set $prison_dig to _i>><</link>><<gtiredness>>

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

<</if>>

<<link [[Leave|Prison Cell]]>><</link>>

:: Prison Tunnel Dig
<<effects>>

<<for _dig to 0; _dig lt $prison_dig; _dig++>>
    <<set $prison.tunnel += 1>>
    <<tiredness 6>><<pass 1>><<advancetohour>><<effectstime>>
    <<if $hour is 6>>
        <<set $prison.schedule to "wake">>
        <<break>>
    <</if>>
<</for>>
<<unset $prison_dig>>

<<if $prison.tunnel gte 120>>
    You crawl deep into the dark, and continue digging.

    You're struck by a sudden, exhilarating breeze. The smell of salt. You dig away the last of the rock, widening the hole large enough to fit your body.

    <<earnFeat "Time and Pressure">>
    You're at the edge of the island, above the sea.

<<elseif $prison.tunnel gte 100>>
    You crawl deep into the dark, and continue digging.
    <<set _rng to random(1, 3)>>
    <<switch random(1, 3)>>
    <<case 1>>
        Shells melt into the surrounding stone.
    <<case 2>>
        You think you hear a seagull, but you might be imagining it.
    <<case 3>>
        You hear a rumble.
    <</switch>>
<<elseif $prison.tunnel gte 80>>
    You crawl into the dark, and continue digging.
    <<set _rng to random(1, 3)>>
    <<switch random(1, 3)>>
    <<case 1>>
        You hear rushing water.
    <<case 2>>
        The tunnel trembles. Dust falls from the ceiling.
    <<case 3>>
        You breathe in some dust, and cough.<<gstress>><<stress 6>>
    <</switch>>
<<elseif $prison.tunnel gte 60>>
    You crawl through the hole and continue digging.
    <<set _rng to random(1, 3)>>
    <<switch random(1, 3)>>
    <<case 1>>
        The soft rock breaks apart with ease.<<lstress>><<stress -6>>
    <<case 2>>
        You graze your arm against the coarse rock.<<gpain>><<pain 4>>
    <<case 3>>
        The rock is uniform in consistency.
    <</switch>>
<<elseif $prison.tunnel gte 40>>
    You crawl down the hole and continue digging.
    <<set _rng to random(1, 3)>>
    <<switch random(1, 3)>>
    <<case 1>>
        You strike something hard. It feels like a pebble. You're able to dig around it, and prise it from the rock.
    <<case 2>>
        The natural rock crumbles away, almost like sand.
    <<case 3>>
        The stonework bleeds into natural rock. The latter is softer.
    <</switch>>
<<elseif $prison.tunnel gte 20>>
    You crawl into the hole and continue digging.
    <<set _rng to random(1, 3)>>
    <<switch random(1, 3)>>
    <<case 1>>
        One of the bricks is already loose, which is nice.<<lstress>><<stress -6>>
    <<case 2>>
        The stonework is ancient. Some of the bricks have warped together.
    <<case 3>>
        One of the bricks above falls, landing on your back.<<gpain>><<gstress>><<pain 4>><<stress 6>>
    <</switch>>
<<elseif $prison.tunnel gte 10>>
    You reach into the hole and continue digging.
    <<set _rng to random(1, 3)>>
    <<switch random(1, 3)>>
    <<case 1>>
        The poster flaps in a sudden breeze. You pause a moment before continuing.
    <<case 2>>
        It's too dark to see, but you find yourself glancing at the cell door to make sure no one's watching.
    <<case 3>>
        The next layer of stone is firmer than the last, and darker in colour.
    <</switch>>
<<else>>
    You chip away the wall, piece by piece.
    <<set _rng to random(1, 3)>>
    <<switch random(1, 3)>>
    <<case 1>>
        The crack widens.
    <<case 2>>
        You hear a cough, and freeze for a moment before continuing.<<gstress>><<stress 6>>
    <<case 3>>
        It crumbles with little effort.
    <</switch>>
<</if>>

<<if $prison.schedule is "wake" and $prison.morning isnot 1>>
    <<generate_methodical_guard 0>><<person1>>
    You hear a rattle as the cell doors open behind you.
    <<if $prison.tunnel gte 20>>
        You rush down the tunnel, and cover the entrance with the poster.
    <<else>>
        You cover the entrance with the poster.
    <</if>>

    A <<personsimple>>'s voice rings through the hall. "Role call." You see other prisoners lining up.

    <<link [[Line up|Prison Cell Role]]>><<cell_trouble -1>><</link>>

    <<link [[Refuse|Prison Cell Refuse]]>><<prison_guards 1>><<prison_inmates 1>><<pain 4>><<cell_trouble 1>><</link>><<gpain>><<gsuspicion>><<grespect>>

    <<set $prison.morning to 1>>
<<else>>
    <<link [[Next|Prison Cell]]>><</link>>

<</if>>

:: Prison Tunnel Edge
<<effects>>

<<if $phase is 1>>
    You climb the rocks, and squeeze into your tunnel.
    <<set $phase to 0>>
<<else>>
    You crawl to the precipice, and peer off the edge. There's a sandy beach, trailing out of sight. It's not far down, but the waves are violent.
    <<if $weather is "clear">>
        You can see the surrounding mist in the moonlight.
    <<else>>
        You can't see far.
    <</if>>
<</if>>

<<link [[Crawl to cell|Prison Cell]]>><</link>>

<<link [[Climb to beach (0:05)|Prison Beach]]>><<pass 5>><</link>>

:: Prison Bed
<<effects>>
<<wearoutfit>>

<<set $bus to "prison_bedroom">><<effects>>
You lie on your mattress. It's hard to get comfortable<<if ($worn.neck.name is "free use collar" or $worn.neck.name is "free use collar with leash")>>, especially with the jagged metal around your neck poking into your skin<</if>>.

<<prison_sleep_options>>

:: Prison Sleep
<<if !_preventUpdate and !$autosavedisabled>>
	<<run Save.autosave.save(null, {"saveId":$saveId, "saveName":$saveName})>>
	<<run setSaveDetail("autosave",{"saveId":$saveId,"saveName":$saveName})>>
<</if>>
<<sleep>><<effects>>
<<if $nightmares gte 1 and $controlled is 0>>
	You dream you are being hunted by something <<if $wraith and $wraith.state is "haunt" and $rng lte 25>>pale<<else>>dark<</if>> and terrible.
<<else>>
	<<if $specialClothesEffects.bimboTotal gte random(100,1000) or $arousal gte 9000>>
		Your sleep is plagued by dirty dreams.
		<<arousal `$specialClothesEffects.bimboTotal / 10 * $sleepHoursTotal`>>
		<<arousal `100 * $sleepHoursTotal`>>
		<<if $arousal gte $arousalmax>>
			They push you over the edge.
			<<orgasm>>
		<<else>>

		<</if>>
	<<else>>
		You sleep soundly.
	<</if>>
<</if>>
<<sleepeffects>>
<<if $prisonwake is 1>>
	<<set $schoolwake to 0>>
    A bell rings, waking you from your slumber.

	<<set $wardrobe_location to "prison">>
	<<wardrobeSelection true>>
	<<radiooutfits>>

	<<link [[Next|Prison Cell]]>><<bedclotheson "prison bed">><<endevent>><</link>>

<<else>>

	<<set $wardrobe_location to "prison">>
	<<wardrobeSelection true>>
	<<radiooutfits>>

	<<link [[Get up|Prison Cell]]>><<bedclotheson "prison bed">><</link>>
<</if>>

:: Prison Wardrobe
<<effects>>

You open the cupboard.

<<set $wardrobe_location to "prison">>
<<wardrobeSelection>>

<<wardrobewear>>

<<wardrobeExits>>

<<wardrobe>>

:: Prison Settings
<<set $settingsExitPassage to "Prison Cell">>
<<settings>>

:: Prison Plaque
<<effects>>

God is watching.

Obey the guards

The guards obey the warden

You owe nine hours of work each day

<<if $prison.active_punishments.includes("free use")>>
    Do not remove your "free use" collar

<</if>>
<<if $prison.active_punishments.includes("nude")>>
    Wear no clothes

<<elseif $prison.active_punishments.includes("topless")>>
    Wear nothing above the waist

<<elseif $prison.active_punishments.includes("bottomless")>>
    Wear nothing below the waist

<</if>>
<<if $prison.active_punishments.includes("underwear") and $prison.active_punishments.includes("free use")>>
    Underwear only

<</if>>
<<if $prison.active_punishments.includes("blindfold")>>
    Do not remove your blindfold

<</if>>
<<if $prison.active_punishments.includes("leash")>>
    Do not remove your leash

<</if>>
<<if $prison.active_punishments.includes("cuffs")>>
    Do not remove your shackles

<</if>>
<<if $prison.active_punishments.includes("gag")>>
    Do not remove your gag

<</if>>
<<if $prison.active_punishments.includes("bindings")>>
    Do not remove your bindings

<</if>>

Schedule:

<<ampm 6 00>>: Shower and breakfast

<<ampm 7 00>>: Work

<<ampm 12 00>>: Lunch

<<ampm 13 00>>: Yard

<<ampm 14 00>>: Work

<<ampm 18 00>>: Dinner

<<ampm 19 00>>: Free Time

<<ampm 20 00>>: Lights out

You have $prison.time days left until release.

<<link [[Step away|Prison Cell]]>><</link>>

:: Prison Cell Role
<<set $bus to "walkway">><<effects>><<effects_prison>>

<<if $prison_kylar_timer gte 1>>
    <<set $prison_kylar_timer -= 1>>
<</if>>

You stand outside your cell, and wait as <<methodical_guard 0>> reads out each number.

"...prisoner 144."

<<if $worn.face.type.includes("gag")>>
    "Mmmhr!" you say. The inmates laugh.<<lrespect>><<prison_inmates -1>>
<<else>>
    "Here," you say.
<</if>>

<<if $NPCName[$NPCNameList.indexOf("Kylar")].state is "prison" and $prison.kylar is 0 and $prison_kylar_timer lte 0>>
    <<set $prison.kylar to "active">>
    <<unset $prison_kylar_timer>>
    <<endevent>>
    <<npc Kylar>><<person1>>
    <<generate_methodical_guard 1>>
    <<generate_veteran_guard 2>>
    <<person2>><<He>> opens <<his>> mouth again, but is interrupted by a banging door somewhere below. You see <<veteran_guard 2>> through the walkway beneath your feet, pushing a small figure ahead of <<person3>><<him>>.

    A final shove knocks the newcomer off <<person1>><<his>> feet, and <<he>> falls on <<his>> face. <<He>> scrambles to <<his>> feet, and pulls <<his>> hair away from <<his>> face. It's Kylar.

    <<link [[Next|Prison Kylar Intro]]>><</link>>

<<elseif $prison.active_punishments.includes("free use") and $worn.neck.name isnot "free use collar" and $worn.neck.name isnot "free use collar with leash">>
    "Where's your collar?" <<he>> asks. "Best come with me."

    <<prison_repunishment_options>>
<<elseif $prison.active_punishments.includes("nude") and ($worn.upper.name isnot "naked" or $worn.lower.name isnot "naked" or $worn.under_upper.name isnot "naked" or $worn.under_lower.name isnot "naked")>>
    "Aren't you supposed to be naked?" <<he>> asks. "Come with me."

    <<prison_repunishment_options>>
<<elseif $prison.active_punishments.includes("blindfold") and !$worn.face.type.includes("blindfold")>>
    "Where's your blindfold?" <<he>> asks. "Best come with me."

    <<prison_repunishment_options>>
<<elseif $prison.active_punishments.includes("topless") and ($worn.upper.name isnot "naked" or $worn.under_upper.name isnot "naked")>>
    "You're supposed to be topless," <<he>> says. "Come with me."

    <<prison_repunishment_options>>
<<elseif $prison.active_punishments.includes("bottomless") and ($worn.lower.name isnot "naked" or $worn.under_lower.name isnot "naked")>>
    "You're supposed to be bottomless," <<he>> says. "Come with me."

    <<prison_repunishment_options>>
<<elseif $prison.active_punishments.includes("leash") and $worn.neck.collared isnot 1>>
    "Where's your leash?" <<he>> asks. "Come with me."

    <<prison_repunishment_options>>
<<elseif $prison.active_punishments.includes("underwear") and ($worn.upper.name isnot "naked" or $worn.lower.name isnot "naked")>>
    "That doesn't look like underwear," <<he>> says. "Come with me."

    <<prison_repunishment_options>>
<<elseif $prison.active_punishments.includes("cuffs") and !$worn.feet.type.includes("shackle")>>
    "Where are your shackles?" <<he>> asks. "Come with me."

    <<prison_repunishment_options>>
<<elseif $prison.active_punishments.includes("gag") and !$worn.face.type.includes("gag")>>
    "Where's your gag?" <<he>> asks. "Come with me."

    <<prison_repunishment_options>>
<<elseif $prison.active_punishments.includes("bindings") and ($leftarm isnot "bound" or $rightarm isnot "bound")>>
    "Your arms aren't supposed to be free," <<he>> says. "Come with me."

    <<prison_repunishment_options>>
<<elseif $prison.time lte 0>>
    There's a pause. "Your release is due," <<he>> says. <<He>> snaps the ledger shut. "Come with me."

    <<link [[Next|Prison End]]>><<set $prison.hours_worked to 0>><</link>>

<<elseif $prison.hours_worked lt 9>>
    There's a pause. "You didn't meet your work quota," <<he>> says. <<He>> snaps the ledger shut. "Come with me."

    <<link [[Go quietly|Prison Punishment]]>><<endevent>><<set $prison.hours_worked to 0>><</link>>

    <<link [[Refuse|Prison Cell Punishment Refuse]]>><</link>>

<<elseif $prison_punished_days lte 0 and $prison.active_punishments.length gte 1>>
    <<set $prison.hours_worked to 0>>
    There's a pause.
    <<if $prison.active_punishments.length gte 2>>
        "I think we can remove one of your punishments," <<he>> says. <<He>> snaps the ledger shut.
    <<else>>
        "I think we can remove your punishment," <<he>> says. <<He>> snaps the ledger shut.
    <</if>>
    <<set $prison_punished_days to 2>>
    <<set _rng to random(0, ($prison.active_punishments.length - 1))>>
    <<set _punishment to $prison.active_punishments[_rng]>>
    <<switch _punishment>>
        <<case "free use">>
            <<set $prison.active_punishments.delete("free use")>>
            <<He>> walks along the walkway, and fishes a key from <<his>> pocket.

            <<link [[Next|Prison Remove Free Use]]>><</link>>

        <<case "nude">>
            <<set $prison.active_punishments.delete("nude")>>
            <<if random(1, 2) is 2>>
                <<set $prison.active_punishments.delete("topless")>>
                "You can wear clothes again. Underwear only however, and you must remain bottomless, for now."

            <<else>>
                <<set $prison.active_punishments.delete("bottomless")>>
                "You can wear clothes again. Underwear only however, and you must remain topless, for now."

            <</if>>
            <<link [[Next|Prison Walkway]]>><<endevent>><</link>>

        <<case "blindfold">>
            <<set $prison.active_punishments.delete("blindfold")>>
            The walkway moves as steps approach.

            <<link [[Next|Prison Remove Blindfold]]>><</link>>

        <<case "topless">>
            <<set $prison.active_punishments.delete("topless")>>
            <<if $prison.active_punishments.includes("nude")>>
                <<set $prison.active_punishments.delete("nude")>>
                <<if $prison.active_punishments.includes("underwear")>>
                    "You can wear a bra or vest, but nothing more. Remain naked from the waist down."

                <<else>>
                    "You can wear a shirt again, but must remain naked from the waist down.

                <</if>>
            <<else>>
                <<if $prison.active_punishments.includes("underwear")>>
                    "You can cover your chest with a bra or vest, but no shirts or such, for now."
                <<else>>
                    "You can clothe yourself properly again." This prompts the other inmates to take another gawk at you.
                <</if>>

            <</if>>
            <<link [[Next|Prison Walkway]]>><<endevent>><</link>>

        <<case "leash">>
            <<set $prison.active_punishments.delete("leash")>>
            <<He>> pulls a pair of pliers from <<his>> pocket as <<he>> walks towards you.

            <<link [[Next|Prison Remove Leash]]>><</link>>

        <<case "underwear">>
            <<if $prison.active_punishments.includes("nude")>>
                <<set $prison.active_punishments.delete("nude")>>
                <<if random(1, 2) is 2>>
                    <<set $prison.active_punishments.delete("topless")>>
                    "You can wear clothes again. Underwear only however, and you must remain bottomless, for now."

                <<else>>
                    <<set $prison.active_punishments.delete("bottomless")>>
                    "You can wear clothes again. Underwear only however, and you must remain topless, for now."

                <</if>>
            <<else>>
                <<set $prison.active_punishments.delete("underwear")>>
                <<if $prison.active_punishments.includes("topless")>>
                    "You can wear trousers again. But keep your chest bare, for now."

                <<elseif $prison.active_punishments.includes("bottomless")>>
                    "You can wear a shirt again. You must remain naked from the waist down however, for now."

                <<else>>
                    "You can clothe yourself properly again." This prompts the other inmates to take another gawk at you.

                <</if>>
            <</if>>
            <<link [[Next|Prison Walkway]]>><<endevent>><</link>>

        <<case "cuffs">>
            <<set $prison.active_punishments.delete("cuffs")>>
            <<He>> pulls a key from <<his>> pocket as <<he>> walks towards you.

            <<link [[Next|Prison Remove Cuffs]]>><</link>>

        <<case "bottomless">>
            <<set $prison.active_punishments.delete("bottomless")>>
            <<if $prison.active_punishments.includes("nude")>>
                <<set $prison.active_punishments.delete("nude")>>
                <<if $prison.active_punishments.includes("underwear")>>
                    "You can wear underwear again, but must remain topless."
                <<else>>
                    "You can wear trousers again," but must remain topless."
                <</if>>

            <<else>>
                <<if $prison.active_punishments.includes("underwear")>>
                    "You can wear underwear again, but no shirts or such, for now."
                <<else>>
                    "You can clothe yourself properly again." This prompts the other inmates to take another gawk at you.
                <</if>>

            <</if>>
            <<link [[Next|Prison Walkway]]>><<endevent>><</link>>

        <<case "gag">>
            <<set $prison.active_punishments.delete("gag")>>
            <<He>> walks closer. "My job's easier when you can speak anyway."

            <<link [[Next|Prison Remove Gag]]>><</link>>

        <<default>>
            <<set $prison.active_punishments.delete("bindings")>>
            The walkway moves underfoot as <<he>> walks towards you. "You're more useful with your arms free."

            <<link [[Next|Prison Remove Bindings]]>><</link>>

    <</switch>>
<<else>>
    <<methodical_guard 0 cap>> snaps the ledger shut, and a tall gate opens at the far end of the hall. The prisoners shuffle towards it.

    <<link [[Next|Prison Walkway]]>><<endevent>><<set $prison.hours_worked to 0>><</link>>

<</if>>

:: Prison Cell Refuse
<<effects>><<effects_prison>>

<<if $prison.shock is 1>>
    <<methodical_guard 0 cap>> sighs, and reaches into <<his>> shirt pocket. A terrible jolt runs through you, emanating from your neck. It only lasts a moment, but it's enough to make you fall to the ground, and twitch.<<gtrauma>><<ggstress>><<gggpain>><<trauma 4>><<stress 4>><<pain 4>>

    You're too hurt to resist as <<methodical_guard 0>> cuffs you, and drags you from your cell. The other inmates tease you as you pass, but it doesn't sound malicious.<<grespect>><<prison_inmates 1>>
    <<bind>>

    <<link [[Next|Prison Punishment]]>><<endevent>><<set $prison.hours_worked to 0>><</link>>
<<else>>
    <<if $prison.cell_trouble gte 5>>
        <<generate_veteran_guard 1>><<generate_anxious_guard 2>><<generate_relaxed_guard 3>>
        The walkway rattles beneath <<methodical_guard 0 apo>> feet. <<Hes>> not alone. "Must we make an example of you?" <<he>> says. "Because we will."

        <<He>> arrives at your cell, with <<veteran_guard 1>>, <<anxious_guard 2>>, and <<relaxed_guard 3>> close behind. They unstrap their batons.

        <<link [[Next|Prison Cell Fight]]>><<set $fightstart to 1>><</link>>

    <<elseif $prison.cell_trouble gte 4>>
        <<generate_veteran_guard 1>><<generate_anxious_guard 2>>
        The walkway rattles beneath <<methodical_guard 0 apo>> feet. <<Hes>> not alone. "Must we make an example of you?" <<he>> says. "Because we will."

        <<He>> arrives at your cell, with <<veteran_guard 1>> and <<anxious_guard 2>> close behind. They unstrap their batons.

        <<link [[Next|Prison Cell Fight]]>><<set $fightstart to 1>><</link>>

    <<elseif $prison.cell_trouble gte 3>>
        <<generate_veteran_guard 1>>
        The walkway rattles beneath <<methodical_guard 0 apo>> feet. <<Hes>> not alone. "Must we make an example of you?" <<he>> says. "Because we will."

        <<He>> arrives at your cell, with <<veteran_guard 1>> close behind. They unstrap their batons.

        <<link [[Next|Prison Cell Fight]]>><<set $fightstart to 1>><</link>>

    <<elseif $prison.cell_trouble gte 2>>
        The walkway rattles beneath <<methodical_guard 0 apo>> feet. "You'd better be sick in there," <<he>> says. "Or you'll be sorry."

        <<He>> finds you lazing on your bed, and unstraps the baton from <<his>> side.

        <<link [[Next|Prison Cell Fight]]>><<set $fightstart to 1>><</link>>

    <<else>>
        You remain in your cell. "Number 144," <<methodical_guard 0>> says. "Leave your cell at once."

        <<link [[Leave your cell|Prison Cell Role]]>><</link>>

        <<link [[Refuse|Prison Cell Refuse]]>><<cell_trouble 1>><<prison_guards 1>><<prison_inmates 1>><</link>><<gsuspicion>><<grespect>>

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

:: Prison Cell Punishment Refuse
<<effects>><<effects_prison>>

<<if $prison.shock is 1>>
    <<methodical_guard 0 cap>> sighs, and reaches into <<his>> shirt pocket. A terrible jolt runs through you, emanating from your neck. It only lasts a moment, but it's enough to make you fall to the ground, and twitch.<<gtrauma>><<ggstress>><<gggpain>><<trauma 4>><<stress 4>><<pain 4>>

    You're too hurt to resist as <<methodical_guard 0>> cuffs you, and drags you from your cell. The other inmates tease you as you pass, but it doesn't sound malicious.<<grespect>><<prison_inmates 1>>
    <<bind>>

    <<link [[Next|Prison Punishment]]>><<endevent>><<set $prison.hours_worked to 0>><</link>>
<<else>>
    <<if $prison.cell_trouble gte 5>>
        <<generate_veteran_guard 1>><<generate_anxious_guard 2>><<generate_relaxed_guard 3>>
        The walkway rattles beneath <<methodical_guard 0 apo>> feet. <<Hes>> not alone. "Must we make an example of you?" <<he>> says. "Because we will."

        <<He>> arrives at your cell, with <<veteran_guard 1>>, <<anxious_guard 2>>, and <<relaxed_guard 3>> close behind. They unstrap their batons.

        <<link [[Next|Prison Cell Fight]]>><<set $fightstart to 1>><</link>>

    <<elseif $prison.cell_trouble gte 4>>
        <<generate_veteran_guard 1>><<generate_anxious_guard 2>>
        The walkway rattles beneath <<methodical_guard 0 apo>> feet. <<Hes>> not alone. "Must we make an example of you?" <<he>> says. "Because we will."

        <<He>> arrives at your cell, with <<veteran_guard 1>> and <<anxious_guard 2>> close behind. They unstrap their batons.

        <<link [[Next|Prison Cell Fight]]>><<set $fightstart to 1>><</link>>

    <<elseif $prison.cell_trouble gte 3>>
        <<generate_veteran_guard 1>>
        The walkway rattles beneath <<methodical_guard 0 apo>> feet. <<Hes>> not alone. "Must we make an example of you?" <<he>> says. "Because we will."

        <<He>> arrives at your cell, with <<veteran_guard 1>> close behind. They unstrap their batons.

        <<link [[Next|Prison Cell Fight]]>><<set $fightstart to 1>><</link>>

    <<else>>
        The walkway rattles beneath <<methodical_guard 0 apo>> feet. "You're holding up the whole system." <<He>> unstraps the baton from <<his>> side before <<he>> arrives at the cell.

        <<link [[Next|Prison Cell Fight]]>><<set $fightstart to 1>><</link>>

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

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

	<<neutral 1>>

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

<</if>>

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

<<stateman>>

<<actionsman>>

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

:: Prison Cell Fight Finish
<<effects>>
<<if $enemyarousal gte $enemyarousalmax>>
	<<ejaculation>>

    <<if $enemynomax gte 2>>
        The inmates cheer as the guards stagger from your cell. <<veteran_guard 1>> eyes you cautiously, but <<methodical_guard 0>> shakes <<person1>><<his>> head. "No time for this," <<he>> says, groping for <<his>> glasses. "We'll be watching you."<<ggsuspicion>><<prison_guards -3>><<ggrespect>><<prison_inmates 3>>
    <<else>>
	    The inmates cheer as <<methodical_guard 0>> staggers from your cell, and would fall from the walkway if not for the railing. "No time for this," <<he>> says, groping for <<his>> glasses. "I'll be watching you."<<ggsuspicion>><<prison_guards -3>><<ggrespect>><<prison_inmates 3>>
    <</if>>

	<<clotheson>>
	<<endcombat>>

    <<prison_revolt_options>>

<<elseif $enemyhealth lte 0>>
    <<if $enemynomax gte 2>>
        The inmates cheer as the guards stagger from your cell. <<veteran_guard 1>> eyes you cautiously, but <<methodical_guard 0>> shakes <<person1>><<his>> head. "No time for this," <<he>> says, groping for <<his>> glasses. "We'll be watching you."<<ggsuspicion>><<prison_guards -3>><<ggrespect>><<prison_inmates 3>>
    <<else>>
	    The inmates cheer as <<methodical_guard 0>> staggers from your cell, and would fall from the walkway if not for the railing. "No time for this," <<he>> says, groping for <<his>> glasses. "I'll be watching you."<<ggsuspicion>><<prison_guards -3>><<ggrespect>><<prison_inmates 3>>
    <</if>>
    <<switch $enemynomax>>
        <<case 1>>
            <<greb>><<prison_reb 1>>
        <<case 2>>
            <<greb>><<prison_reb 2>>
        <<case 3>>
            <<ggreb>><<prison_reb 3>>
        <<default>>
            <<ggreb>><<prison_reb 4>>
    <</switch>>

	<<clotheson>>
	<<endcombat>>
	<<prison_revolt_options>>
<<else>>
	You're too hurt to resist as <<methodical_guard 0>> cuffs you, and drags you from your cell. The other inmates tease you as you pass, but it doesn't sound malicious.<<grespect>><<prison_inmates 1>>
    <<bind>>

	<<clotheson>>
	<<endcombat>>
	<<link [[Next|Prison Punishment]]>><</link>>
    <<cell_trouble -5>>
<</if>>

<<set $prison.hours_worked to 0>>

:: Prison Shower
<<effects>><<effects_prison>><<set $bus to "shower">>

You are in the prison showers.
<<if $prison.schedule is "wake">>
    Prisoners undress, leaving their clothes on wood benches, before entering the shower. You hear running water.
    <<if $prison.kylar is "active">>
        Kylar stands in the corner, watching you.
    <</if>>

    <<generate_veteran_guard 0>><<person1>><<veteran_guard 0 cap>> paces through the room.

    <<endevent>>
    <<if !$prison_veteran_greet and $prison.veteran gte 15>>
        <<prison_guard_greet veteran>>
    <<elseif random(1, 5) is 5 and $eventskip isnot 1>>
        <<prison_guard_watch veteran>>
    <<elseif $worn.upper.name is "naked" and $worn.lower.name is "naked" and $worn.under_upper.name is "naked" and $worn.under_lower.name is "naked">>
        <<link [[Have a shower (0:10)|Prison Shower Take]]>><<pass 10>><</link>>

        <<link [[Leave|Prison Block]]>><</link>>

    <<else>>
        <<if $exhibitionism gte 15>>
            <<link [[Undress in the open (0:10)|Prison Shower Open]]>><</link>>

        <<else>>
            You can't bear to undress in front of everyone.

        <</if>>
        <<link [[Find somewhere private to undress (0:10)|Prison Shower Private]]>><</link>>

        <<link [[Leave|Prison Block]]>><</link>>

    <</if>>
<<else>>
    There's no one around. The guards only leave the plumbing on for an hour.

    <<link [[Leave|Prison Block]]>><</link>>

    <<set $eventskip to 0>>
<</if>>

:: Prison Walkway
<<set $outside to 0>><<effects>><<effects_prison>><<set $bus to "walkway">>

You are on the metal walkway outside your cell, at the top of the cell block. There's a staircase leading to the floor.

<<if $hour is 20>>
    You hear a bell ring. "Lockdown," <<generate_veteran_guard 0>><<veteran_guard 0>> shouts. "Back to your cells."

    You're shuffled along with the other prisoners.

    <<link [[Next|Prison Cell]]>><<endevent>><</link>>

<<elseif $stress gte $stressmax>>
    <<passout_prison>>
<<else>>
    <<if $prison.schedule is "wake">>
        Other prisoners shuffle towards the showers.

    <<elseif $prison.schedule is "free time">>
        Many prisoners lounge on their beds.

    <<elseif $prison.schedule is "lockdown">>
        You hear snoring.

    <<else>>

    <</if>>

    <<if $prison.schedule isnot "lockdown" and $prison.attention gte 100>>
        <<events_prison_attention>>
    <<else>>
        <<if $prison.schedule isnot "lockdown" and $eventskip isnot 1>>
            <<events_prison>>
        <</if>>
        <<if $prison_event_trigger>>
            <<events_prison_triggered>>
        <<else>>
            Your cell is in the corner.

            <<cellicon>><<link [[Your cell|Prison Cell]]>><</link>>

            <<if $prison.attention_level gte 1 and !$prison.protection and $prison.schedule is "free time">>
                <<if !$prison.protection>>
                    <<if !$prison_scarred_done>>
                        <<generate_scarred_inmate 0>><<person1>>
                        <<scarred_inmate 0 capo>> cell is more spartan than most. Almost as if it were unoccupied.
                        <<endevent>>

                        <<cellicon>><<link [[Spartan cell|Prison Scarred]]>><</link>>

                    <</if>>
                    /*
                    <<generate_tattooed_inmate 0>><<person1>>
                    The walls of <<tattooed_inmate 0 apo>> cell, as well as parts of the ceiling, are decorated with pornography.
                    <<endevent>>

                    <<cellicon>><<link [[Porn-decorated cell|Prison Tattooed]]>><</link>>

                    */
                <</if>>
            <</if>>
            A heavy wood door sits across from the tower. A faded green cross embellishes it, painted over a silver crucifix.

            <<if $prison.schedule is "lockdown">>
                The door to medical is locked.

            <<else>>
                <<prisonmedicalicon>><<link [[Medical|Prison Medical]]>><</link>>

            <</if>>
            The stairs snake around the central tower.

            <<link [[Downstairs|Prison Block]]>><</link>>

            <<prison_map walkway>>
        <</if>>
        <<set $eventskip to 0>>
    <</if>>
<</if>>

:: Prison Block
<<set $outside to 0>><<effects>><<effects_prison>><<set $bus to "cell_block">>

You are at the bottom of the cell block. There are stairs leading to a walkway above, and halls leading to other parts of the prison.

<<if $hour is 20>>
    You hear a bell ring. "Lockdown," <<generate_veteran_guard 0>><<veteran_guard 0>> shouts. "Back to your cells."

    You're shuffled along with the other prisoners.

    <<link [[Next|Prison Cell]]>><<endevent>><</link>>

<<elseif $stress gte $stressmax>>
    <<passout_prison>>
<<else>>
    <<if $prison.schedule is "wake">>
        Other prisoners shuffle towards the showers.

    <<elseif $prison.schedule is "free time">>
        Many prisoners lounge on their beds.

    <<elseif $prison.schedule is "lockdown">>
        You hear snoring.

    <<else>>

    <</if>>

    <<if $prison.schedule isnot "lockdown" and $prison.attention gte 100>>
        <<events_prison_attention>>
    <<else>>
        <<if $prison.schedule isnot "lockdown" and $eventskip isnot 1>>
            <<events_prison>>
        <</if>>
        <<if $prison_event_trigger>>
            <<events_prison_triggered>>
        <<else>>
            There's a set of double doors on one end of the block, crowned by a couple of signs. "Showers" says one. "Sex is forbidden" warns another.
            <<if $prison.schedule is "wake">>
                Steam flows out.
            <</if>>

            <<link [[Showers|Prison Shower]]>><</link>>

            A faint chemical smell surrounds another door. The closest cells are vacant, the metal warped and corroded.

            <<prisonlaundryicon>><<link [[Laundry|Prison Laundry]]>><</link>>

            <<if $prison.kylar is "active" and !$prison_kylar_cell and ($prison.schedule is "free time" or $prison.schedule is "yard")>>
                <<npc Kylar>><<person1>>
                Kylar sits on the bed in <<his>> cell, fussing over something in <<his>> lap.
                <<endevent>>

                <<cellicon>><<link [[Kylar's cell|Prison Kylar]]>><</link>>

            <</if>>

            A corridor leads away, towards daylight.

            <<link [[Outside|Prison Yard]]>><</link>>

            The stairs circle a central tower. You entered here.

            <<link [[Climb the stairs towards your cell|Prison Walkway]]>><</link>>

            <<prison_map block>>
        <</if>>
        <<set $eventskip to 0>>
    <</if>>
<</if>>

:: Prison Laundry
<<set $bus to "laundry">><<set $outside to 0>><<effects>><<effects_prison>>

You are in the laundry room. The walls give way to raw rock part way in. Thick pipes extend from the rough surface in an irregular pattern.
<<if $prison.schedule is "work">>
    Inmates sort through clothes, and large machines rumble.

    <<generate_relaxed_guard 0>><<relaxed_guard 0 cap>> sits on a stool beside a short table, staring across the room and absentmindedly rolling a pair of dice.
    <<endevent>>

<<else>>
    The machines are still.

<</if>>

<<if $hour is 20>>
    You hear a bell ring. "Lockdown," <<generate_relaxed_guard 0>><<relaxed_guard 0>> shouts. "Back to your cells."

    You're shuffled along with the other prisoners.

    <<link [[Next|Prison Cell]]>><<endevent>><</link>>

<<else>>
    <<if !$prison_relaxed_greet and $prison.relaxed gte 15 and $prison.schedule is "work">>
        <<prison_guard_greet relaxed>>
    <<elseif random(1, 5) is 5 and $eventskip isnot 1 and $prison.schedule is "work">>
        <<prison_guard_watch relaxed>>
    <<else>>
        <<if $prison.schedule is "work">>
            <<if $prison.job is "laundry">>
                <<link [[Work|Prison Laundry Work]]>><<endevent>><</link>>

            <<else>>
                Your labours are expected elsewhere.

            <</if>>
        <</if>>
        <<link [[Leave|Prison Block]]>><</link>>

        <<prison_map laundry>>
    <</if>>
<</if>>

:: Prison Medical
<<set $bus to "medical">><<set $outside to 0>><<effects>><<effects_prison>>

You are in the medical room. Rows of beds stretch down its length, many occupied. There's a cupboard, locked by a modern mechanism at odds with the surroundings.

<<if $prison.schedule is "work">>
    <<generate_methodical_guard 0>><<person1>> <<methodical_guard 0 cap>> stands over one, writing on a clipboard.

    <<endevent>>
<<else>>

<</if>>
<<if $hour is 20>>
    You hear a bell ring. "Lockdown," <<generate_methodical_guard 0>><<methodical_guard 0>> says. "Go back to your cell."

    <<methodical_guard 0 cap>> leaves as well, and locks the door behind <<him>>.

    <<link [[Next|Prison Cell]]>><<endevent>><</link>>

<<else>>
    <<if random(1, 5) is 5 and $eventskip isnot 1 and $prison.schedule is "work">>
        <<prison_guard_watch methodical>>
    <<else>>
        <<if $prison.schedule is "work">>
            <<if $prison.job is "medical">>
                <<link [[Work|Prison Medical Work]]>><</link>>

            <<else>>
                Your labours are expected elsewhere.

            <</if>>
        <</if>>
        <<if $prison.shock is 1>>

            There's a black and yellow door in one corner.

            <<link [[Approach|Prison Medical Door]]>><</link>>

        <</if>>
        <<link [[Leave|Prison Walkway]]>><</link>>

        <<prison_map medical>>
    <</if>>
<</if>>

:: Prison Medical Door
<<effects>>

You approach the black and yellow door. There's no visible lock, but there is a keypad next to it.

<<if $prison.code is 1>>
    Wren claims the code <<nnpc_he Wren>> sold you will work.
    <<if $prison.schedule is "work">>
        <<generate_methodical_guard 0>><<person1>>
        You'll need to wait for <<methodical_guard 0>> to leave before trying.

    <<else>>

        <<link [[Enter|Prison Medical Shock]]>><</link>>

    <</if>>
<<else>>
    You'll need to find the code.

<</if>>

<<link [[Leave|Prison Medical]]>><<endevent>><</link>>

:: Prison Medical Shock
<<effects>>

You input the code, a green light flickers on above the door, and it slides open.

The interior is dark, even compared to the rest of the prison. There's a rack of hammers, screwdrivers, and other tools near the entrance. As your eyes adjust, you see a machine the size of a small bus, also black and yellow. An array of metal coils spring from the top. There's a plaque. You get a static shock when you wipe away the grime.

"Experimental shock generator. Requires specialised collars to function."

This machine doesn't look or sound stable. You could probably inflict irreparable damage with one of the tools lying around, but you wouldn't get away with it.

<<link [[Sabotage|Prison Medical Sabotage]]>><<prison_hope 20>><<prison_reb 20>><<set $prison.shock to 0>><<prison_guards -20>><<prison_inmates 20>><</link>><<gggsuspicion>><<gggreb>><<ggghope>><<gggrespect>>

<<link [[Leave|Prison Medical]]>><</link>>

:: Prison Medical Sabotage
<<effects>>

<<earnFeat "Breaker">>
You lift the largest hammer, one with a wooden handle, and get to work. You smash pipes, shatter glass, and dent plates.

<<if $physique gte 10000>>
    With your strength, you're able to inflict considerable damage before the guards arrive.<<ggrespect>><<prison_inmates 10>>
<<else>>
    Even with your limited strength, you're able to inflict a lot of damage before the guards arrive.
<</if>>

<<generate_methodical_guard 0>>
<<generate_veteran_guard 1>>

<<methodical_guard 0 cap>><<person1>> arrives with <<veteran_guard 1>> in tow. "What have you done," <<he>> asks, reaching into <<his>> shirt pocket. <<He>> pulls out a remote, points at you, and presses the button. Nothing happens. <<He>> tries again and again, to no avail.

"Back to basics," <<veteran_guard 1>><<person2>> says, stepping forward with <<his>> baton at the ready. "Good. Best come quietly."

<<link [[Go quietly|Prison Punishment]]>><<endevent>><</link>>

<<link [[Fight|Prison Medical Fight]]>><<set $fightstart to 1>><</link>>

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

	<<neutral 1>>

	<<maninit>>
	<<set $enemytrust -= 100>>
	<<set $enemyanger += 200>>
	<<npcidlegenitals>>
    Inmates crowd around the door to watch, some wearing bandages.

<</if>>

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

<<stateman>>

<<actionsman>>

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

:: Prison Medical Fight Finish
<<effects>>
<<if $enemyarousal gte $enemyarousalmax>>
	<<ejaculation>>
    They stagger and fall against the broken machine, drained of energy. The inmates taunt them, until <<veteran_guard 1>> turns and raises <<his>> baton.<<ggsuspicion>><<prison_guards -3>><<ggrespect>><<prison_inmates 3>>

    "Enough of this," <<methodical_guard 0>> says. "I need to make some calls."

	<<clotheson>>
	<<endcombat>>

    <<prison_revolt_options>>
<<elseif $enemyhealth lte 0>>
	They back away from you, towards the door. The inmates taunt them, until <<veteran_guard 1>> turns and raises <<his>> baton. <<ggsuspicion>><<prison_guards -3>><<ggrespect>><<prison_inmates 3>><<greb>><<prison_reb 1>>

    "Enough of this," <<methodical_guard 0>> says. "I need to make some calls."

	<<clotheson>>
	<<endcombat>>
	<<prison_revolt_options>>
<<else>>
	You fall to the ground, too hurt to continue. <<He>> cuffs you, and pulls to you to your feet. The other inmates tease you as you pass, but it doesn't sound malicious.<<grespect>><<prison_inmates 1>>
    <<bind>>

	<<clotheson>>
	<<endcombat>>
    <<link [[Next|Prison Punishment]]>><</link>>

<</if>>

:: Prison Yard
<<set $location to "prison">><<set $bus to "yard">><<set $outside to 1>><<effects>><<effects_prison>>

You are in the prison yard. It's spacious, but the surrounding walls are unreasonably tall, and seem to curve inward.

<<if $prison.schedule is "yard">>
    Inmates lift weights and socialise. <<generate_veteran_guard 0>><<veteran_guard 0 cap>> watches with a sternful gaze.<<endevent>>

<<elseif $prison.schedule is "revolt">>
    <<beastNEWinit 6 hawk>>
    Shadows roam the grass as <<beastsplural>> fly overhead. Inmates dart across the yard in groups, or stick to the shadows. Some are caught and carried into the sky. You're not sure where they're taken.
    <<endevent>>

<</if>>
<<if $hour is 20>>
    You hear a bell ring. "Lockdown," <<generate_veteran_guard 0>><<veteran_guard 0>> shouts. "Back to your cells."

    You're shuffled along with the other prisoners.

    <<link [[Next|Prison Cell]]>><<endevent>><</link>>

<<elseif $stress gte $stressmax>>
    <<passout_prison>>
<<elseif $prison_wren_intro is 1 and $prison.schedule is "yard">>
    <<if $wren_seen is "cards">>
        <<npc "Wren">><<person1>>
        "I've mixed feelings about meeting you here," says a young <<if $pronoun is "m">>man with short<<else>>woman with shoulder-length<</if>> hair. It's Wren.

        "I'm sorry your sneaking didn't work out. Maybe we can be useful to each other."

        <<link [[Next|Prison Wren Intro Met]]>><<unset $prison_wren_intro>><<set $wren_seen to "prison">><</link>>

    <<elseif $wren_seen is "catsuit">>
        <<npc "Wren">><<person1>>
        "I've mixed feelings about meeting you here," says a young <<if $pronoun is "m">>man with short<<else>>woman with shoulder-length<</if>> hair. It's Wren.

        "I'm sorry your skulking didn't work out. Maybe we can be useful to each other."

        <<link [[Next|Prison Wren Intro Met]]>><<unset $prison_wren_intro>><<set $wren_seen to "prison">><</link>>

    <<else>>
        <<npc "Wren">><<person1>>
        "Newcomer?" asks a young <<if $pronoun is "m">>man with short<<else>>woman with shoulder-length<</if>> hair. "Just my type." <<He>> wears a prison uniform, but seems apart from the other inmates, freer.

        <<link [[Next|Prison Wren Intro]]>><<unset $prison_wren_intro>><<set $wren_seen to "prison">><</link>>

    <</if>>
<<else>>
    <<if $prison.schedule isnot "lockdown" and $prison.attention gte 100>>
        <<events_prison_attention>>
    <<else>>
        <<if $prison.schedule isnot "lockdown" and $eventskip isnot 1>>
            <<events_prison>>
        <</if>>
        <<if $prison_event_trigger>>
            <<events_prison_triggered>>
        <<else>>
            <<if $prison.schedule is "yard" and !$prison_veteran_greet and $prison.veteran gte 15>>
                <<prison_guard_greet veteran>>
            <<elseif $prison.schedule is "yard" and random(1, 5) is 5 and $eventskip isnot 1>>
                <<prison_guard_watch veteran>>
            <<else>>
                <<if $prison.schedule isnot "revolt">>
                    <<if $worn.feet.type.includes("shackle")>>
                        You can't run with your legs bound.

                    <<else>>
                        <<prisonrunicon>><<link [[Run (0:30)|Prison Yard Run]]>><<endevent>><<tiredness 6>><<athletics 6>><<pass 30>><</link>><<gathletics>><<gphysique>>

                    <</if>>
                    <<if $leftarm is "bound" or $rightarm is "bound">>
                        You can't lift with your arms bound.

                    <<else>>
                        <<prisonlifticon>><<link [[Lift weights (0:30)|Prison Yard Exercise]]>><<endevent>><<pass 30>><<tiredness 6>><</link>><<gtiredness>><<ggphysique>>

                    <</if>>
                <</if>>
                <<if $prison.schedule is "yard">>
                    <<if $worn.face.type.includes("gag")>>
                        You can't speak to the guard or inmates with this gag in the way.

                    <<else>>
                        <<link [[Speak with the guard (0:30)|Prison Yard Speak]]>><<endevent>><<pass 30>><<prison_rep veteran 1>><</link>><<glove>>

                        <<link [[Cutely flirt with inmates (0:30)|Prison Yard Flirt]]>><<set $phase to 0>><<pass 30>><<prison_hope 1>><</link>><<promiscuous1>><<ghope>>

                        <<if $promiscuity gte 15>>
                            <<link [[Salaciously flirt with inmates (0:30)|Prison Yard Flirt]]>><<set $phase to 1>><<pass 30>><<prison_reb 1>><</link>><<promiscuous2>><<greb>>

                        <</if>>
                    <</if>>
                <</if>>
                <<if $prison.schedule is "yard" and $weekday is 6>>

                    <<npc Wren>><<person1>>
                    Wren leans against a wall. If the guards notice <<him>>, they pretend not to.

                    <<link [[Speak with Wren|Prison Wren]]>><<endevent>><</link>>

                <</if>>

                The ground slopes gently, leading to a pair of wide doors. The smell of stale food lingers in the air.

                <<prisoncanteenicon>><<link [[Canteen|Prison Canteen]]>><<endevent>><</link>>

                The wall protrudes, giving rise to a tower far taller than the rest of the prison. There's a metal door at the bottom.

                <<if $prison.job is "spire">>
                    <<link [[Climb the spire (0:05)|Prison Spire]]>><<tiredness 6>><<pass 5>><</link>><<gtiredness>>

                    <<if $prison.schedule isnot "revolt">>
                        <<if $prison.rope is 1>>

                            You could let your rope down the hole at the bottom of the spire.

                            <<link [[Use rope|Prison Spire Rope]]>><<set $prison.rope to 2>><</link>>

                        <<elseif $prison.rope is 2>>
                            <<link [[Descend the spire (0:05)|Prison Spire Descend]]>><<tiredness 6>><<pass 5>><</link>><<gtiredness>>

                        <<else>>

                            There's a deep hole at the bottom of the spire.

                            <<link [[Look in the hole|Prison Spire Hole]]>><</link>>

                        <</if>>
                    <</if>>
                <<else>>
                    You're not trusted in the spire.

                <</if>>

                There's a small area sheltered from view. A large locked door blends into the surrounding stone.

                <<if $prison.yard_door is 1>>
                    <<prisondooricon>><<link [[Sneak to beach (0:01)|Prison Beach]]>><<endevent>><<pass 1>><</link>>

                <<else>>
                    <<prisondooricon>><<link [[Large door|Prison Yard Door]]>><<endevent>><</link>>

                <</if>>

                <<link [[Prison block|Prison Block]]>><<endevent>><</link>>

                <<prison_map yard>>
            <</if>>
        <</if>>
        <<set $eventskip to 0>>
    <</if>>
<</if>>

:: Prison Spire Hole
<<set $outside to 1>><<effects>>

You cautiously approach the hole and peer over the edge. Shoddy stonework lines a shaft leading down an abyss. It's too deep to see the bottom. You hear strange, squelching sounds and the occasional rush of water, but you can't make out anything beyond the darkness. The thought of what might lie below fills you with unease.<<stress 2>><<gstress>>

You wonder what could be down there, but without something to help you descend the spire, there's no way of telling.

You return to the yard.

<<link [[Next|Prison Yard]]>><</link>>

:: Prison Spire Rope
<<location "underground">><<set $outside to 0>><<effects>>

You tie the rope firm, and toss the other end down the hole. You hear a thud below after a few seconds. You test the rope. It seems safe. You can descend whenever you want.

<<link [[Next|Prison Yard]]>><<location "prison">><</link>>

:: Prison Spire Descend
<<location "underground">><<set $outside to 0>><<effects>>

You climb down the spire, into the darkness beneath the prison.

<<if $prison_egg is 1 or $prison.watchers_friend is 2>>
    Your feet almost slip on the slick rock at the bottom. This is the cavern where you found the egg. You feel uneasy, and don't want to explore again without reason, so you climb back to the surface.

<<else>>
    Your feet almost slip on the slick rock at the bottom. There's something down here, hidden in the shadows. If you continue, however, it might be hard to find your way back.

    <<link [[Explore the rut|Prison Rut]]>><<set $rut to 0>><<set $rut_entry to "rope">><</link>>

<</if>>

<<link [[Climb back up|Prison Yard]]>><<location "prison">><</link>>

:: Prison Yard Door
<<effects>>

You approach the large door. It's locked.

<<if $prison.yard_key is 1>>
    <<link [[Use the key|Prison Yard Door Key]]>><<set $prison.yard_door to 1>><</link>>

<<else>>
    <<set $lock to 1000>>

    The door is locked tight.

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

        <<link [[Break in (0:05)|Prison Yard Door Pick]]>><<set $prison.yard_door to 1>><<pass 5>><</link>>

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

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

<<link [[Leave|Prison Yard]]>><</link>>

:: Prison Yard Door Key
<<effects>>

The key fits, but needs a lot of force to turn. The door creaks open. A straight stone tunnel slopes downwards. There's light at the bottom.

You close the door behind you, and walk towards the light, emerging on a beach.

<<link [[Next|Prison Beach]]>><</link>>

:: Prison Yard Door Pick
<<effects>>

The lock is sophisticated. It'd have to be, here. But it's still no match for you. The door creaks open. A straight stone tunnel slopes downwards. There's light at the bottom.

You close the door behind you, and walk towards the light, emerging on a beach.

<<link [[Next|Prison Beach]]>><</link>>

:: Prison Yard Speak
<<effects>>

<<generate_veteran_guard 0>><<person1>>
<<generate2>>
<<if $prison.veteran gte 60 and !$NPCList[0].name_known>>
    <<generatep3>>
    You find <<veteran_guard 0>> examining something in <<his>> palm. <<He>> closes <<his>> fist around it when <<he>> sees you approach. <<He>> was so absorbed <<he>> didn't notice you at first. Nor does <<he>> notice the <<person2>><<person>> backing into <<person1>><<him>>.

    The collision is accidental, but <<veteran_guard 0>> reaches for their baton, and delivers a punishing blow to the <<person2>><<persons>> stomach. The object slips from <<person1>><<his>> hand, landing in the grass.

    <<link [[Pick it up|Prison Yard Locket]]>><</link>>

<<else>>
    <<generate3>>
    You approach <<veteran_guard 0>>.

    <<He>> seems happy to chat, despite <<his>> gruff demeanor.

    <<if $rng gte 81>>
        A <<person2>><<person>> tries to climb the wall. <<veteran_guard 0 cap>><<person1>> doesn't seem concerned. "You'll get it this time," <<he>> laughs. "Just keep trying."
    <<elseif $rng gte 61>>
        You follow as <<he>> marches up and down the yard, stopping only to spank a <<person2>><<person>> with <<person1>><<his>> baton.
    <<elseif $rng gte 41>>
        <<He>> leers at a <<person2>><<person>> doing squats.
    <<elseif $rng gte 21>>
        "They think we'll let them leave if they manage to climb the wall," <<he>> chuckles, looking up at the spire. "But it's not up to us."
    <<else>>
        <<He>> stops to break up a fight between a <<person2>><<person>> and <<person3>><<person>>.
    <</if>>

    <<link [[Next|Prison Yard]]>><<endevent>><</link>>

<</if>>

:: Prison Yard Locket
<<effects>>

<<set $NPCList[0].name_known to 1>>
<<save_veteran_guard>>

It's an open locket. There's a picture of a young <<person3>><<personsimple>> inside. A drawing rather than a photograph, but rich in detail. "To my <<veteran_guard 0>>," it reads. "Yours forever."

Panting, <<veteran_guard 0>> steps away from the curled <<person2>><<person>>. You hold out the locket. <<person1>><<He>> snatches it from your grasp, and gives you an evil look.

<<link [[Next|Prison Yard]]>><<endevent>><</link>>

:: Prison Spire
<<set $bus to "spire">><<set $outside to 1>><<effects>><<effects_prison>>

<<if $prison.spire_intro isnot 1>>
    The metal door clangs as you knock. A camera perched atop swivels to face you. You hear a mechanical whir, then a click. The door opens, and a rush of air blows by.

    There's nothing inside except a staircase, spiralling up, and down, though the downward steps soon open onto a gaping pit. You decide to climb up.

    <<link [[Next|Prison Spire Intro]]>><<set $prison.spire_intro to 1>><<set $prison.birds to 0>><</link>>

<<else>>
    <<beastNEWinit 5 "hawk">><<generate_anxious_guard 5>><<person1>>
    You are in the small cabin atop the spire.
    <<if $prison.schedule is "work">>
        <<anxious_guard 5 cap>> sits in front of several security monitors, but <<person6>><<his>> eyes follow the <<person2>><<beastsplural 1>> outside.
    <<else>>
        You watch the <<person2>><<beastsplural 1>> through a window.
    <</if>>
    <<endevent>>

    <<if $hour is 20>>
        You hear a bell ring. "Lockdown," <<anxious_guard 0>><<person1>> sighs. "At last. Off to your cell."

        You run for the stairs with <<anxious_guard 0>> before the creatures react. <<He>> leads you down the stairs, through the yard and prison block, and into your cell.

        <<link [[Next|Prison Cell]]>><<endevent>><</link>>

    <<elseif $prison.birds gte 30 and !$prison.watchers_friend>>
        <<beastNEWinit 6 hawk>><<person1>>
        The <<beastsplural>> watch you in silence. Then one launches through the air, talons outstretched. You trip in fright, but <<bhe>> catches you, lifting you into the air.

        <<bHe>> flies in a circle around the beacon as the others sing, before landing on top.

        <<link [[Next|Prison Spire Beacon]]>><<set $prison.watchers_friend to 1>><</link>>

    <<else>>
        <<if $prison.schedule is "work">>
            <<if !$prison_anxious_greet and $prison.anxious gte 15>>
                <<prison_guard_greet anxious>>
            <<elseif random(1, 5) is 5 and $eventskip isnot 1>>
                <<prison_guard_watch anxious>>
            <<else>>
                <<if $prison.birds gte 30>>
                    The watchers are fond of you.
                <<elseif $prison.birds gte 20>>
                    The watchers think you're useful.
                <<elseif $prison.birds gte 10>>
                    The watchers recognise you.
                <<else>>
                    The watchers see you as meat.
                <</if>>

                <<if $prison.job is "spire">>
                    <<link [[Work|Prison Spire Work]]>><</link>>

                <<else>>
                    Your labours are expected elsewhere.

                <</if>>
                <<if $prison.watchers_friend is 1 and $prison_egg is 1>>
                    <<link [[Hold up the egg|Prison Spire Egg]]>><</link>>

                <</if>>
                <<if $harpy gte 6 and $birdFly gte 1>>

                    Your wings, and the wind, are strong. You think you could fly all the way to the mainland from here.

                    <<link [[Soar to the mainland|Prison Soar]]>><</link>>

                <</if>>
                <<link [[Leave (0:05)|Prison Yard]]>><<pass 5>><</link>>

            <</if>>
        <<else>>
            <<link [[Leave (0:05)|Prison Yard]]>><<pass 5>><</link>>

        <</if>>
        <<prison_map spire>>
    <</if>>
<</if>>

:: Prison Soar
<<effects>>

<<beastNEWinit 2 hawk>><<person1>>
You run and jump, letting the wind catch your wings. You soar.

<<if $prison.schedule is "revolt">>
    The <<beastsplural>> are too busy dealing with the revolt to stop, or even notice you. There's nothing stopping you from escaping.

    <<link [[Escape (0:30)|Prison Soar Escape]]>><<tiredness 12>><<prison_end>><<set $crime += Math.trunc($prison.time * 250)>><<set $crimehistory += Math.trunc($prison.time * 250)>><<pass 30>><<prison_guards -40>><</link>><<crime>><<gggsuspicion>><<ggtiredness>>

    <<link [[Land|Prison Spire]]>><<endevent>><</link>>

<<elseif $prison.watchers_friend gte 2>>
    Two <<beastsplural>> fly alongside you for a moment.
    <<if $monster is 1>>
        "Safe journey," one shouts over the wind.
    <<else>>

    <</if>>
    Then they both turn, and return to the spire.
    There's nothing stopping you from escaping.

    <<link [[Escape (0:30)|Prison Soar Escape]]>><<tiredness 12>><<prison_end>><<set $crime += Math.trunc($prison.time * 250)>><<set $crimehistory += Math.trunc($prison.time * 250)>><<pass 30>><<prison_guards -40>><</link>><<crime>><<gggsuspicion>><<ggtiredness>>

    <<link [[Land|Prison Spire]]>><<endevent>><</link>>

<<else>>
    Two <<beastsplural>> fly after you. You evade one, but the other grasps your shoulders in <<his>> talons. <<He>> carries you back to the spire.<<gpain>><<gtrauma>><<gstress>><<pain 4>><<trauma 6>><<stress 6>>

    <<if $monster is 1>>
        "We're watching," <<bhe>> warns. "Don't forget." <<bHe>> returns to the beacon.
    <<else>>
        <<bHe>> chirps a warning, then returns to the beacon.
    <</if>>
    You won't be able to fly away without distracting the <<beastsplural>>, or befriending them somehow.

    <<link [[Next|Prison Spire]]>><</link>>

<</if>>

:: Prison Soar Escape
<<effects>>
<<earnFeat "Not Meant to be Caged">>
You soar away from the island, over the mist, and towards the mainland.

<<if $daystate is "night">>
    <<if $weather is "clear">>
        You see the lights of town light up the horizon ahead.
    <<else>>
        You can't make out the coast in the dark, but you know it's there.
    <</if>>
<<else>>
    You see the town on the horizon ahead.
<</if>>

<<prison_bondage_removal>>
<<if _punishments_removed is true>>
    You feel the air tear away your bondage, piece by piece.
<</if>>

It's a tiring journey, but the wind is on your side. Free as a bird, you swoop onto the beach.

<<link [[Next|Beach]]>><<endevent>><<set $eventskip to 1>><</link>>

:: Prison Spire Beacon
<<effects>>

The beacon is covered with nests, made mostly of driftwood. The other <<beastsplural>> land, surrounding you. You sense no malice. The one that carried you bows <<his>> head, and scrapes the middle of one of the nests. There's an indentation, as if something once sat there.

<<if $monster is 1>>
    "Egg stolen," <<bhe>> says. "Eggs rare. Please, find below. Far below! Too far below." The others sing a melancholy tune.
<<else>>
    Are they missing an egg? It would have to be hidden somewhere they couldn't reach.
<</if>>

<<if $prison_egg is 1>>
    You already found an egg far below. You hold it out. The <<beastsplural>> hop in surprise, then chirp in excitement and relief.

    <<link [[Next|Prison Spire Egg 2]]>><<set $spraymax += 1>><<spray 5>><<set $prison.watchers_friend to 2>><</link>>

<<else>>

    Another <<beasttype>> grasps your shoulders, and carries you back to the platform.

    <<link [[Next|Prison Spire]]>><<endevent>><</link>>

<</if>>

:: Prison Spire Egg
<<effects>>

<<beastNEWinit 6 hawk>><<person1>>
You stand in front of the beacon, and hold up the egg. One <<beasttype>> notices, hops in excitement, and sings. This gets the others' attention. They rise from their nests and join the chorus. One swoops down and lifts you from your feet.

<<bHe>> carries you up to the beacon, and gently places you beside the empty nest. Others land, forming a circle around you.

<<link [[Next|Prison Spire Egg 2]]>><<set $spraymax += 1>><<spray 5>><<set $prison.watchers_friend to 2>><</link>>

:: Prison Spire Egg 2
<<effects>>
<<unset $prison_egg>>
You place the egg in the nest. The <<beasttype>> ruffles <<bhis>> features, then sits atop it.
<<earnFeat "Friends in the Sky">>
<<if $monster is 1>>
    "Thank you," <<he>> says. "We are friends. Here." <<He>> shifts a heavy piece of driftwood.
<<else>>
    <<bHe>> bows <<his>> head and shifts a heavy piece of driftwood.
<</if>>
There's a strange cylinder beneath, with an exposed computer chip at the base. It looks like a charge for your pepper spray. The <<beasttype>> rolls it over to you, and you plug it in.
<<gspraymax>>

You have befriended the watchers, and gained an additional pepper spray charge.

Another <<beasttype>> grasps your shoulders, and carries you back to the platform.

<<link [[Next|Prison Spire]]>><<endevent>><</link>>

:: Prison Spire Intro
<<set $outside to 1>><<effects>>

The climb takes your breath. You pass through another metal door, and onto a wide-open platform. There's another, smaller tower some distance away. Atop it perches a light, now dim. It's the beacon.

A great wind howls. You're far above the prison block.

<<link [[Next|Prison Spire Intro 2]]>><</link>>

:: Prison Spire Intro 2
<<set $outside to 1>><<effects>>

<<generate_anxious_guard 0>><<generateBEAST 2 "hawk">>
<<person1>>"Over here," says a voice to your left. It's <<anxious_guard 0>>. <<Hes>> stood outside a small concrete cabin, one foot still inside. <<He>> looks up at the sky. "Hurry."

You hasten towards <<him>> as you hear a whoosh, as if the wind were picking up. "Fuck," <<anxious_guard 0>> says as <<he>> recoils into the building. "Run!"

Animated by a terrible fear, you run for the door, sparing a glance behind. A <<beasttype 1>> swoops through the air, talons outstretched.<<ggstress>><<stress 12>>

You manage to clear the cabin entrance just moments before the <<beasttype 1>> lands, <<anxious_guard 0>> shutting the door behind you. The <<beasttype 1>> takes off again, leaving talon marks in the stone. You watch through the window as other <<beastsplural 1>> descend, landing on and around the beacon.

<<link [[Next|Prison Spire Intro 3]]>><</link>>

:: Prison Spire Intro 3
<<set $outside to 1>><<effects>><<effects_prison>>

<<person1>>"They're always agitated when they come back from hunting," <<anxious_guard 0>> says. "Not that it's ever safe up here. Hope you last longer than the last." <<He>> points at the ground some distance away. "Stay away from the edge. The wall is long gone."

"Tried to put collars on them once." <<He>> shakes <<his>> head. "Anyway, main job is keeping them fed, collecting shark's teeth, and confiscating contraband. Dunno where they get it out here, but it'll end up in inmate hands if we do nothing."

<<link [[Next|Prison Spire]]>><<endevent>><</link>>

:: Prison Tattooed
<<effects>>

<<link [[Next|Prison Walkway]]>><</link>>

:: Prison Spire Precipice
<<effects>>

<<anxious_guard 0 cap>> shouts, but <<his>> words are incoherent. <<He>> isn't carried high, or far, before release, but the force sends <<him>> rolling off the edge.

Only <<his>> fingers can be seen, grasping the ledge in desperation.

<<link [[Help|Prison Spire Precipice Help]]>><<famegood 20>><<prison_rep anxious 1>><</link>><<ggglove>>

<<link [[Make demands|Prison Spire Precipice Demand]]>><<def 3>><</link>>

:: Prison Spire Precipice Help
<<effects>>

You rush over to the edge and grasp <<anxious_guard 0 apo>> hand. Together, you're able to pull <<him>> up and over the top.

<<He>> staggers towards the cabin, but collapses to <<his>> shaking knees after a couple of steps. You help <<him>> up again, and hold <<his>> until you make it to safety.

<<set $NPCList[0].name_known to 1>>
<<save_anxious_guard>>
<<pass 10>>
<<He>> sits for several minutes before managing to speak. "Thank you," <<he>> says. "I'm <<anxious_guard 0>> by the way. Not meant to share our names, but fuck it. I thought that was it for me."

<<prison_spire_options>>

:: Prison Spire Precipice Demand
<<effects>>

"I-I don't have anything," <<anxious_guard 0>> says. "Please, just... Wait. I have a key! The key to the beach. I'll give it to you if you save me, and I won't tell anyone you have it."

<<if $skulduggery gte 1000>>
    That key is of little use to one with your talents, but it might be to someone else.
<</if>>

You grasp <<anxious_guard 0 apo>> hand. Together, you're able to pull <<him>> up and over the top.

<<He>> staggers towards the cabin, but collapses to <<his>> shaking knees after a couple of steps. You help <<him>> up again, and hold <<his>> until you make it to safety.

<<set $NPCList[0].name_known to 1>>
<<save_anxious_guard>>
<<pass 10>>
<<He>> sits for several minutes before managing to speak. "Thank you," <<he>> says. "I'm <<anxious_guard 0>> by the way. Not meant to share our names, but fuck it. I thought that was it for me."

You hold out your hand. "Y-yes," <<he>> says. "I gave my word." <<He>> pulls a heavy iron key from <<his>> pocket. "If you're caught, don't tell them where you got it."

<<set $prison.yard_key to 1>>

<<prison_spire_options>>

:: Passout Prison
<<effects>>
You've pushed yourself too much.

<<passout>>
<<link [[Wake up|Passout Prison 2]]>><</link>>

<<pass 1 hour>>
<<trauma 6>><<set $stress -= 2000>>

:: Passout Prison 2
<<location "prison">><<effects>>

<<generate_veteran_guard 0>><<person1>>
"Wake up you shit," says a <<personsimple>>'s voice. It's <<veteran_guard 0>>. "Sleeping ain't allowed anywhere but your cell. Up you get." <<He>> grasps your collar and helps haul you to your feet.

<<He>> has you marching before you can properly recover.

<<link [[Next|Prison Punishment]]>><<endevent>><</link>>

:: Prison Revolt Refuse
<<effects>>

It's enough to bask in your victory, for now.

<<destination_prison>>

:: Prison Revolt
<<effects>>
<<set $prison.schedule to "revolt">>
<<if $submissive gte 1150>>
    "It's time to end their bullying," you shout. "Let's show them we won't be pushed around!"
<<elseif $submissive lte 850>>
    "I'm fed up with these fuckers telling us what to do!" you shout. "Let's fuck them up!"
<<else>>
    "It's time for some changes around here," you should. "We're in charge now!"
<</if>>

<<generate1>><<person1>><<generate2>>
The inmates cheer. A <<person>> grasps the bars of a nearby window, and pulls them apart with <<his>> bare hands. Another throws a rock, shattering one of the lights. Anarchy breaks out.

<<set $prison.attention to 0>>
<<destination_prison>>


code:
:: Prison Punishment
<<effects>>

<<generate_methodical_guard 0>><<person1>>
<<generate_relaxed_guard 1>>
<<generate_anxious_guard 2>>
<<generate_veteran_guard 3>>

<<if $prison.punishment_intro is 0>>
	<<set $prison.punishment_intro to 1>>
	The guard leads you through the prison block, back into the room with the gaping hole on one side. The other guards are already here. <<methodical_guard 0 cap>><<person1>> sits behind the desk.

	"You were warned," <<he>> says. "The warden allows me to dole out punishments-"

	The door opens, and <<relaxed_guard 1>> steps through. "We using the list?"

	<<methodical_guard 0 cap>> rubs <<his>> temple. "We're not-"

	<<anxious_guard 2 cap>><<person3>> enters. "Come on," <<he>> says. "It's much more fun."

	"It's unpro-"

	"If the warden had a problem with it," says <<veteran_guard 3>>, leaning against the door frame. "We'd have heard something."

	<<methodical_guard 0 cap>><<person1>> sighs. "Fine." <<He>> reaches beneath the desk.

<<elseif $prison.active_punishments.length gte 1>>
	The guard leads you through the prison block, back into the room with the gaping hole on one side. The other guards are already here. <<methodical_guard 0 cap>><<person1>> sits behind the desk.

	"Not enough punishment for you?" <<he>> says, reaching out of sight. The other guards step aside.

<<else>>
	The guard leads you through the prison block, back into the room with the gaping hole on one side. The other guards are already here. <<methodical_guard 0 cap>><<person1>> sits behind the desk.

	With a sigh, <<he>> reaches out of sight. The others step aside.

<</if>>

<<link [[Next|Prison Punishment List]]>><</link>>

:: Prison Punishment List
<<effects>>

<<methodical_guard 0 cap>> produces a large torch. <<He>> rests it on the desk, and points it at the abyss opposite. It flashes into light. The dark resists a moment, before coiling away and revealing a silvery plate several metres from the edge.

Writing is engraved on its surface.

<<prison_list>>

<<relaxed_guard 1 cap>> pulls a pair of dice from <<his>> pocket. <<He>> cups <<his>> hands together, and leans over the desk.

<<link [[Roll|Prison Punishment Roll]]>><</link>>

:: Prison Punishment Roll
<<effects>>

	<<prison_list>>

<<set _die_1 to random(1, 6)>>
<<set _die_2 to random(1, 6)>>

		<<if $images is 1>>

		<<else>>
			?
		<</if>>

	+

		<<if $images is 1>>

		<<else>>
			?
		<</if>>

	=

<<timed 2s>>
	<<replace "#die_1">>
	<<if $images is 1>>

	<<else>>
		_die_1
	<</if>>
	<</replace>>
<</timed>>
<<timed 3s>>
	<<replace "#die_2">>
	<<if $images is 1>>

	<<else>>
		_die_2
	<</if>>
	<</replace>>
<</timed>>
<<set $prison_punishment_number to _die_1 + _die_2>>
<<switch $prison_punishment_number>>
	<<case 2>>
		<<set $prison_punishment to "free use">>
	<<case 3>>
		<<set $prison_punishment to "nude">>
	<<case 4>>
	<<set $prison_punishment to "blindfold">>
	<<case 5>>
		<<set $prison_punishment to "topless">>
	<<case 6>>
		<<set $prison_punishment to "leash">>
	<<case 7>>
		<<set $prison_punishment to "underwear">>
	<<case 8>>
		<<set $prison_punishment to "cuffs">>
	<<case 9>>
		<<set $prison_punishment to "bottomless">>
	<<case 10>>
		<<set $prison_punishment to "gag">>
	<<case 11>>
		<<set $prison_punishment to "bindings">>
	<<default>>
		<<set $prison_punishment to "rut">>
<</switch>>
<<timed 4s>>
	<<replace "#die_result">>
		<<print $prison_punishment_number>>
	<</replace>>
	<<replace "#prison_list">>
		<<prison_list_dark>>
	<</replace>>
<</timed>>
<<timed 5s>>
	<<replace "#prison_list_result">>
		| <<prison_list_result>>
	<</replace>>
<</timed>>

<<link [[Next|Prison Punishment 2]]>><</link>>

:: Prison Punishment 2
<<effects>>

<<if $prison.active_punishments.includes($prison_punishment)>>
	<<prison_list_speech>> <<methodical_guard 0>> says. "We're already implementing that one.
	<<for _i to $prison_punishment_number - 2; _i lt 11; _i++>>
		<<if !$prison.active_punishments.includes($prison.punishments[_i])>>
			<<set _prison_punishment_hi to $prison.punishments[_i]>>
			<<break>>
		<</if>>
	<</for>>
	<<for _i to $prison_punishment_number - 2; _i gt 0; _i-->>
		<<if !$prison.active_punishments.includes($prison.punishments[_i])>>
			<<set _prison_punishment_lo to $prison.punishments[_i]>>
			<<break>>
		<</if>>
	<</for>>
	<<if !_prison_punishment_hi>>
		<<set $prison_punishment to _prison_punishment_lo>>
		We'll ascend the list, and use the next available." <<He>> peers at the list. <<prison_list_speech end>>

	<<elseif !_prison_punishment_lo>>
		<<set $prison_punishment to _prison_punishment_hi>>
		We'll descend the list, and use the next available." <<He>> peers at the list. <<prison_list_speech end>>

	<<else>>
		We'll move up or down the list, to the next eligible punishment, depending on a coin flip."

		<<relaxed_guard 1 cap>><<person2>> pulls a coin from <<his>> pocket. "Heads goes up." <<He>> flips it, then covers it with <<his>> free hand before removing it with a flourish.

		<<if random(1, 2) is 2>>
			<<set $prison_punishment to _prison_punishment_lo>>
			"Heads," <<he>> announces. They all turn to the metal plate. <<prison_list_speech end>>
		<<else>>
			<<set $prison_punishment to _prison_punishment_hi>>
			"Tails," <<he>> announces. They all turn to the metal plate. <<prison_list_speech end>>
		<</if>>

	<</if>>
<<else>>
	<<prison_list_speech>> <<methodical_guard 0>> says.

<</if>>

<<switch $prison_punishment>>
	<<case "free use">>
		<<leash 20>>
		<<if $prison.active_punishments.includes("leash")>>
			<<attach_leash>>
		<</if>>
		"Oh my <<girl>>," <<veteran_guard 3>> chuckles. "The prisoners will be pleased."

		<<methodical_guard 0 cap>> rummages beneath once more. Jagged metal clanks onto the desk, a metal collar with grotesque wording melted to one side. "Free use."

		<<relaxed_guard 1 cap>> unlocks your collar, but the freedom is short-lived. The new metal is even weightier.

		<<link [[Next|Prison Punishment Free]]>><<prison_punishment_init>><</link>>

	<<case "nude">>
		<<if $worn.upper.name is "naked" and $worn.lower.name is "naked" and $worn.under_upper.name is "naked" and $worn.under_lower.name is "naked">>
			<<methodical_guard 0 cap>><<person1>> adjusts <<his>> glasses. "You are allowed no clothes," <<he>> says. "Judged by your peers. Seems you're ahead of us."
		<<else>>
			<<clothesruined>>
			<<methodical_guard 0 cap>><<person1>> adjusts <<his>> glasses as the other guards close in. "Your clothes are forfeit," <<he>> says. "You will be judged by your peers."

			Their hands grasp and tug the fabric. You're left bare in the middle of the room.

		<</if>>

		<<link [[Next|Prison Punishment Nude]]>><<prison_punishment_init>><</link>>

	<<case "blindfold">>
		<<if $worn.face.name is "gag">>
			<<set $worn.face.type.push("broken")>>
			<<faceruined>>
			<<facewear 6>>
		<<else>>
			<<facewear 5>>
		<</if>>
		"You'll need to watch your step," <<methodical_guard 0>><<person1>> says. You hear footsteps behind, but your vision is blocked by a piece of fabric before you can turn. You've been blindfolded.

		<<link [[Next|Prison Punishment Blindfold]]>><<prison_punishment_init>><</link>>

	<<case "topless">>
		<<if $worn.upper.name is "naked" and $worn.under_upper.name is "naked">>
			<<methodical_guard 0 cap>><<person1>> adjusts <<his>> glasses. "You are allowed no clothes above the waist," <<he>> says. "To prove your devotion. Seems you're ahead of us."

		<<else>>
			<<upperruined>><<underupperruined>>
			<<methodical_guard 0 cap>><<person1>>adjusts <<his>> glasses as the other guards close in. "You are allowed no clothes above the waist," <<he>> says. "To prove your devotion."

			Their hands grasp and tug the fabric. You're left topless in the middle of the room.

		<</if>>
		<<link [[Next|Prison Punishment Topless]]>><<prison_punishment_init>><</link>>

	<<case "leash">>
		<<attach_leash>>
		<<veteran_guard 3 cap>><<person4>>produces a length of cord as <<he>> approaches. <<He>> affixes one end to the collar around your neck, before handing the other to <<relaxed_guard 1>>. "There's a good <<bitch>>."

		<<link [[Next|Prison Punishment Leash]]>><<prison_punishment_init>><</link>>

	<<case "underwear">>
		<<if $worn.upper.name is "naked" and $worn.lower.name is "naked">>
			<<methodical_guard 0 cap>><<person1>> adjusts <<his>> glasses. "You are allowed no clothes other than underwear," <<he>> says. "That's your atonement. Though it seems you're ahead of us."
		<<else>>
			<<upperruined>><<lowerruined>>
			<<methodical_guard 0 cap>><<person1>> adjusts <<his>> glasses as the other guards close in. "You are allowed no clothes other than underwear," <<he>> says. "That's your atonement." Hands reach from all around, pulling and tugging at the fabric covering your body, until you're left exposed in the middle of the room.
		<</if>>

		<<link [[Next|Prison Punishment Underwear]]>><<prison_punishment_init>><</link>>

	<<case "cuffs">>
		<<feetwear 26>>
		<<methodical_guard 0 cap>><<person1>> rummages beneath the desk again. A metal ball chained to a shackle thuds onto the wood. <<veteran_guard 3 cap>><<person4>> takes it in hand, and crouches beside you.

		"Maybe this bondage will remind you of your place."

		<<link [[Next|Prison Punishment Cuffs]]>><<prison_punishment_init>><</link>>

	<<case "bottomless">>
		<<if $worn.lower.name is "naked" and $worn.under_lower.name is "naked">>
			<<methodical_guard 0 cap>><<person1>> adjusts <<his>> glasses. "You are to be chastised," <<he>> says. "Allowed no clothes below the waist. Seems you're ahead of us."

		<<else>>
			<<lowerruined>><<underlowerruined>>
			<<methodical_guard 0 cap>><<person1>> adjusts <<his>> glasses as the other guards close in. "You are to be chastised," <<he>> says "Allowed no clothes below the waist."

			Their hands grasp and tug the fabric. You're left bottomless in the middle of the room.

		<</if>>

		<<link [[Next|Prison Punishment Bottomless]]>><<prison_punishment_init>><</link>>

	<<case "gag">>
		<<if $worn.face.name is "blindfold">>
			<<set $worn.face.type.push("broken")>>
			<<faceruined>>
			<<facewear 6>>
		<<else>>
			<<facewear 4>>
		<</if>>
		<<methodical_guard 0 cap>><<person1>> reaches beneath the desk. <<He>> slaps a plastic gag onto the table. <<anxious_guard 2 cap>><<person3>>picks it up, and affixes it around your face.

		<<link [[Next|Prison Punishment Mask]]>><<prison_punishment_init>><</link>>

	<<case "bindings">>
		<<set $leftarm to "bound">><<set $rightarm to "bound">>
		<<methodical_guard 0 cap>> nods at <<veteran_guard 3>><<person4>>, who produces a length of rope. "Hold still <<girl>>." <<He>> binds your arms together, leaving you helpless.

		<<link [[Next|Prison Punishment Bindings]]>><<prison_punishment_init>><</link>>

	<<case "rut">>
		<<veteran_guard 3 cap>><<person4>> laughs. "Nice knowing you," <<he>> says, pushing you towards the gaping hole across from the desk.<<gtrauma>><<gstress>><<trauma 6>><<stress 6>>

		"If <<pshe>> brings us something valuable," <<anxious_guard 2>> says. "We let <<phim>> back up, right?"<<lstress>><<stress -6>>

		"Right," <<veteran_guard 3>> replies. "But the rut was picked clean a long time ago."<<gstress>><<stress 6>>

		"Some inmates find their own way up," <<relaxed_guard 1>> adds.<<lstress>><<stress -6>>

		"Not often." <<veteran_guard 3 cap>> thrusts <<his>> boot into your back, and you plunge into darkness.<<gtrauma>><<ggstress>><<trauma 6>><<stress 12>>

		<<link [[Next|Prison Punishment Rut]]>><</link>>

	<<default>>

<</switch>>

:: Prison Punishment Rut
<<effects>>

You fall through darkness, and land in a pool of cold water.
<<water>>
<<if $leftarm is "bound" and $rightarm is "bound">>
	You writhe to the shore.
<<else>>
	You swim to the shore.
<</if>>

You listen for voices above, but can't hear a thing. You smell something, however.

<<if $worn.face.type.includes("blindfold")>>
	A sweet vapour, erupting from somewhere nearby. It seems to clear your mind.<<lstress>><<stress -6>>
<<else>>
	A purple plume of vapour trails from a strange mushroom. The mushroom itself looks dangerous, but the vapour smells so sweet. It clears your mind.<<lstress>><<stress -6>>
<</if>>

<<set $rut_entry to "punish">>

<<link [[Inhale|Prison Rut Inhale]]>><<set $rut to 0>><<endevent>><<arousal 5000>><<drugs 300>><<stress -120>><</link>><<gggarousal>><<lllstress>>

<<link [[Ignore|Prison Rut]]>><<set $rut to 0>><<endevent>><</link>>

:: Prison Punishment Free
<<effects>>

<<prison_punishment_end>>

"Listen up scum," <<he>> says. "This bad <<girl>> has earned penance. It's open season on <<pher>> ass. Beat <<phim>>, fuck <<phim>>. As long as this sign says so." <<He>> whacks the "Free Use" collar with <<his>> baton. "Do whatever the fuck you want."

<<destination_prison_walkway>>

:: Prison Punishment Nude
<<effects>>

<<prison_punishment_end>>

<<covered>> The inmates taunt you with lewd jeers. Up on the walkway, there's nowhere to hide from their lascivious eyes.

<<destination_prison_walkway>>

:: Prison Punishment Blindfold
<<effects>>

<<endevent>>
You're able to follow the railing back to your cell.

<<if $prison.schedule is "lockdown">>
	One of the guards trails behind, though you're not sure which. They close the cell door behind you.
<<else>>
	<<generate1>><<person1>>You think you're at the right one, anyway.

	You're interrupted when a pair of hands grasp your <<breasts>> from behind. "Boo," says a <<personsimple>>'s voice from behind. <<He>> releases you, but smacks your <<bottom>> before walking away.<<gtrauma>><<gstress>><<garousal>><<trauma 6>><<stress 6>><<arousal 600>>
<</if>>

<<link [[Next|Prison Cell]]>><<endevent>><</link>>

:: Prison Punishment Topless
<<effects>>

<<prison_punishment_end>>

<<covered>> The inmates enjoy the sight, taunting you with lewd jeers.

<<destination_prison_walkway>>

:: Prison Punishment Leash
<<effects>>

<<prison_punishment_end>>

"On your knees, <<bitch>>," <<he>> says once <<he>> has their attention.

<<link [[Drop to your knees|Prison Punishment Knees]]>><><</link>>

<<link [[Refuse|Prison Punishment Knees Refuse]]>><<def 1>><</link>><<physiquedifficulty 1 16000>>

:: Prison Punishment Knees
<<effects>>

You drop to your knees. "Good slut," <<relaxed_guard 1>><<person2>> says. <<He>> tugs the leash, forcing you to crawl along the walkway and towards your cell.

<<if $prison.schedule is "lockdown">>
	<<generate5>><<person5>>One of the inmates, a <<person>>, reaches from <<his>> cell as you pass. You try to shift away, but <<relaxed_guard 1>> tugs you closer. The <<person>> gropes your <<bottom>> as you pass.<<gtrauma>><<gstress>><<garousal>><<trauma 6>><<stress 6>><<arousal 600>>

	The other inmates follow suit, some giving you a swift spank, others a grope. <<relaxed_guard 1 cap>> keeps the leash taut.

	You're sore by the time you make it back to your cell.<<ggpain>><<pain 8>>

<<else>>
	<<if $exposed gte 1>>
		Inmates stare through the grate below you, eyeing your <<lewdness>>. There's not much you can do but endure.<<gtrauma>><<gstress>><<trauma 6>><<stress 6>>

	<</if>>
	<<generate5>><<person5>>One of the inmates, a <<person>>, follows from <<his>> cell as you pass. <<He>> looks down at you, then gives your <<bottom>> a swift spank. <<relaxed_guard 1 cap>> doesn't stop <<him>>.

	Other inmates follow suit. You're sore by the time you make it back to your cell.<<ggpain>><<pain 8>>

<</if>>

<<link [[Next|Prison Cell]]>><<endevent>><</link>>

:: Prison Punishment Knees Refuse
<<effects>>

<<if $submissive gte 1150>>
	<<gagged_speech "I-I'm sorry but I don't want" ->>
<<elseif $submissive lte 850>>
	<<gagged_speech "I'm not a dog you piece of" ->>
<<else>>
	<<gagged_speech "I don't want" ->>
<</if>>

<<if $physiqueSuccess>>
	<<methodical_guard 0 cap>><<person1>> interrupts you with a hard tug on the leash, trying to force you down. You grasp the end close to you, and pull yourself. <<methodical_guard 0 cap>> tumbles to the metal grate.<<ggsuspicion>><<ggrespect>><<prison_guards -3>><<prison_inmates 3>>

	The inmates cheer for you to smack <<him>> while <<hes>> down, but <<hes>> already reaching for <<his>> baton. You return to your cell.

<<else>>
	<<methodical_guard 0 cap>><<person1>> interrupts you with a hard tug on the leash, and forces you to your knees. <<He>> pulls you along the walkway, towards your cell.

	<<if $prison.schedule is "lockdown">>
		<<generate5>><<person5>>One of the inmates, a <<person>>, reaches from <<his>> cell as you pass. You try to shift away, but <<relaxed_guard 1>> tugs you closer. The <<person>> gropes your <<bottom>> as you pass.<<gtrauma>><<gstress>><<garousal>><<trauma 6>><<stress 6>><<arousal 6>>

		The other inmates follow suit, some giving you a swift spank, others a grope. <<relaxed_guard 1 cap>> keeps the leash taut.

		You're sore by the time you make it back to your cell.<<ggpain>><<pain 8>>

	<<else>>
		<<if $exposed gte 1>>
			Inmates stare through the grate below you, eyeing your <<lewdness>>. There's not much you can do but endure.<<gtrauma>><<gstress>><<trauma 6>><<stress 6>>

		<</if>>
		<<generate5>><<person5>>One of the inmates, a <<person>>, follows from <<his>> cell as you pass. <<He>> looks down at you, then gives your <<bottom>> a swift spank. <<relaxed_guard 1 cap>> doesn't stop <<him>>.

		Other inmates follow suit. You're sore by the time you make it back to your cell.<<ggpain>><<pain 8>>

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

<<link [[Next|Prison Cell]]>><</link>>

:: Prison Punishment Underwear
<<effects>>

"You're getting off easy," <<relaxed_guard 1>> says once back on the walkway.

<<destination_prison_walkway>>

:: Prison Punishment Cuffs
<<effects>>

<<if $prison.schedule is "lockdown">>
	The chain rattles against the ground as you walk. Some of the inmates investigate, peering through the bars of their cells, before returning to bed.
<<else>>
	The chain rattles against the ground as you walk. Some of the inmates passing below look up, and smirk as they turn away.
<</if>>

<<destination_prison_walkway>>

:: Prison Punishment Bottomless
<<effects>>

<<prison_punishment_end>>

<<covered>> The inmates enjoy the sight, taunting you with lewd jeers.

<<destination_prison_walkway>>

:: Prison Punishment Mask
<<effects>>

"Is it too tight?" <<relaxed_guard 1 cap>><<person2>> chuckles once back on the walkway. "Didn't think so." <<He>> gives your <<bottom>> a parting whack with <<his>> baton.

<<destination_prison_walkway>>

:: Prison Punishment Bindings
<<effects>>

<<relaxed_guard 1 cap>><<person2>> holds your bindings as <<he>> pushes you back to your cell.

<<if $prison.schedule is "lockdown">>
	<<generate5>><<person5>>One of the inmates, a <<person>>, reaches through the bars and gropes your <<breasts>> as you pass. <<relaxed_guard 1 cap>><<person2>> holds you still for a moment, leaving you defenceless.<<gstress>><<gtrauma>><<garousal>><<stress 6>><<trauma 6>><<arousal 600>>
<<else>>
	<<generate5>><<person5>>One of the inmates, a <<person>>, steps in front of you. <<relaxed_guard 1 cap>><<person2>> holds you still, leaving you defenceless as the inmate gropes your <<breasts>>.<<gstress>><<gtrauma>><<garousal>><<stress 6>><<trauma 6>><<arousal 600>>
<</if>>

<<link [[Endure|Prison Punishment Bindings Endure]]>><><</link>>

<<link [[Headbutt|Prison Punishment Bindings Headbutt]]>><<def 1>><</link>>
<<if $cow gte 6>>
	<<cow>><<ltrauma>><<lstress>>
<<else>>
	<<gpain>><<ltrauma>>
<</if>>

:: Prison Punishment Bindings Endure
<<effects>>

You endure until the <<person5>><<person>> is satisfied. <<relaxed_guard 1 cap>> pushes you the rest of the way to your cell.

<<link [[Next|Prison Cell]]>><<endevent>><</link>>

:: Prison Punishment Bindings Headbutt
<<effects>>

<<if $cow gte 6>>
	<<trauma -6>><<stress -6>>
	You slam your forehead into the <<person5>><<person>>'s forehead, wiping the idiotic smirk from <<his>> face. You barely feel it, but the inmate is sent reeling.
<<else>>
	You slam your forehead into the <<person5>><<person>>'s. It hurts, but it's worth it to wipe the idiotic smirk from <<his>> face.<<pain 4>><<trauma -6>>
<</if>>

<<relaxed_guard 1 cap>> barks a laugh, then pushes you into motion once more. You leave the <<person>> rubbing <<his>> head.

<<link [[Next|Prison Cell]]>><<endevent>><</link>>

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

	<<neutral 1>>

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

<</if>>

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

<<stateman>>

<<actionsman>>

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

:: Prison Punishment Fight Finish
<<effects>>
<<if $enemyarousal gte $enemyarousalmax>>
	<<ejaculation>>
	<<He>> staggers and leans against the wall, drained of energy. The inmates taunt <<him>>.<<ggsuspicion>><<prison_guards -3>><<ggrespect>><<prison_inmates 3>>

	<<clotheson>>
	<<endcombat>>

	<<prison_revolt_options>>
<<elseif $enemyhealth lte 0>>
	<<He>> falls to the ground. The inmates taunt <<him>>, until <<he>> reaches for <<his>> baton. <<ggsuspicion>><<prison_guards -3>><<ggrespect>><<prison_inmates 3>><<greb>><<prison_reb 1>>

	<<clotheson>>
	<<endcombat>>
	<<prison_revolt_options>>

<<else>>
	You fall to the ground, too hurt to continue. <<He>> cuffs you, and pulls to you to your feet. The other inmates tease you as you pass, but it doesn't sound malicious.<<grespect>><<prison_inmates 1>>
	<<bind>>

	<<clotheson>>
	<<endcombat>>
	<<link [[Next|Prison Punishment]]>><</link>>

<</if>>

:: Prison Punishment Shock
<<effects>>

The guard reaches into <<his>> shirt pocket. A terrible jolt runs through you, emanating from your neck. It only lasts a moment, but it's enough to make you fall to the ground, and twitch.<<gtrauma>><<ggstress>><<gggpain>><<trauma 4>><<stress 4>><<pain 4>>

You're too hurt to resist as <<he>> cuffs you, and drags you to your feet. The other inmates tease you as you pass, but it doesn't sound malicious.<<grespect>><<prison_inmates 1>>
<<bind>>

<<link [[Next|Prison Punishment]]>><<endevent>><</link>>

:: Prison Remove Leash
<<effects>>

The pliers bite through the leash, leaving your collar bare.

<<detach_leash>>

<<destination_prison>>

:: Prison Remove Cuffs
<<effects>>

<<He>> crouches beside you, and inserts the key. The ball and chain clicks open.

"Be on your best behaviour," <<he>> says. "Or these go back on."

<<set $worn.feet.type.push("broken")>>
<<feetruined>>

<<destination_prison>>

:: Prison Remove Gag
<<effects>>

<<if $worn.face.type.includes("blindfold")>>
	<<set $worn.face.type.push("broken")>>
	<<faceruined>>
	<<facewear 5>>
<<else>>
	<<set $worn.face.type.push("broken")>>
	<<faceruined>>
<</if>>

You stay still as <<he>> fiddles with the strap behind your head, until your gag comes loose.

"Watch your words," <<he>> says.

<<destination_prison>>

:: Prison Remove Blindfold
<<effects>>

<<if $worn.face.type.includes("gag")>>
	<<set $worn.face.type.push("broken")>>
	<<faceruined>>
	<<facewear 4>>
<<else>>
	<<set $worn.face.type.push("broken")>>
	<<faceruined>>
<</if>>

You stay still as <<he>> fiddles with the strap behind your head. It comes loose, and the light forces you to blink.

<<destination_prison>>

:: Prison Remove Free Use
<<effects>>

<<He>> inserts the key, and the "free use" part of the collar drops into <<his>> hand.

"I hope that demonstrated why obedience is best for you," <<he>> says.

<<if $worn.neck.cursed is 1>>
	<<set $worn.neck.type.push("broken")>>
	<<neckruined>>
	<<if $prison.active_punishments.includes("leash")>>
		<<neckwear 21>>
	<<else>>
		<<neckwear 1>>
	<</if>>
<</if>>

<<destination_prison>>

:: Prison Remove Bindings
<<effects>>

<<arm_unbind>>

<<He>> unties your bindings, freeing your arms. "Don't give us a reason to bind you again," <<he>> says. "You're more useful with your arms free."

<<destination_prison>>

:: Prison Repunishment
<<effects>>

<<He>> leads you into a dingy room at the bottom of the central tower.

<<if $prison.active_punishments.includes("free use") and $worn.neck.name isnot "free use collar" and $worn.neck.name isnot "free use collar with leash">>
	<<leash 20>>
	<<if $prison.active_punishments.includes("leash")>>
		<<attach_leash>>
	<</if>>
	Your new collar is as grotesque as the last.
<<elseif $prison.active_punishments.includes("nude") and ($worn.upper.name isnot "naked" or $worn.lower.name isnot "naked" or $worn.under_upper.name isnot "naked" or $worn.under_lower.name isnot "naked")>>
	<<clothesruined>>
	<<He>> pulls a blade from <<his>> pocket, grasps your clothing, and tears through it with rough strokes.<<covered>>

<<elseif $prison.active_punishments.includes("blindfold") and !$worn.face.type.includes("blindfold")>>
	<<if $worn.face.name is "gag">>
		<<set $worn.face.type.push("broken")>>
		<<faceruined>>
		<<facewear 6>>
	<<else>>
		<<facewear 5>>
	<</if>>
	<<He>> wraps the blindfold around your head, and ties it firm.
<<elseif $prison.active_punishments.includes("topless") and ($worn.upper.name isnot "naked" or $worn.under_upper.name isnot "naked")>>
	<<upperruined>><<underupperruined>>
	<<He>> pulls a blade from <<his>> pocket, grasps your clothing, and tears through it with rough strokes.<<covered>>

<<elseif $prison.active_punishments.includes("bottomless") and ($worn.lower.name isnot "naked" or $worn.under_lower.name isnot "naked")>>
	<<lowerruined>><<underlowerruined>>
	<<He>> pulls a blade from <<his>> pocket, grasps your clothing, and tears through it with rough strokes.<<covered>>

<<elseif $prison.active_punishments.includes("leash") and $worn.neck.collared isnot 1>>
	<<He>> fastens a leash to your $worn.neck.name.
	<<attach_leash>>
<<elseif $prison.active_punishments.includes("underwear") and ($worn.upper.name isnot "naked" or $worn.lower.name isnot "naked")>>
	<<upperruined>><<lowerruined>>
	<<He>> pulls a blade from <<his>> pocket, grasps your clothing, and tears through it with rough strokes.<<covered>>

<<elseif $prison.active_punishments.includes("cuffs") and !$worn.feet.type.includes("shackle")>>
	<<feetwear 26>>
	<<He>> clamps cold metal around your ankle, linked to a heavy ball.
<<elseif $prison.active_punishments.includes("gag") and !$worn.face.type.includes("gag")>>
	<<if $worn.face.name is "blindfold">>
		<<set $worn.face.type.push("broken")>>
		<<faceruined>>
		<<facewear 6>>
	<<else>>
		<<facewear 4>>
	<</if>>
	<<He>> pushes a gag into your mouth, and ties it tight around your head.
<<elseif $prison.active_punishments.includes("bindings") and ($leftarm isnot "bound" or $rightarm isnot "bound")>>
	<<He>> binds your arms tight behind your back.
	<<bind>>
<</if>>

"See that you stick to the rules from now on," <<he>> says. "Perhaps you need another reminder."

<<link [[Next|Prison Punishment]]>><<endevent>><</link>>

repo_name: Area/degrees

license: mit