<?xml version="1.0" ?>

<Scene name="Sewers" image="null" width="600" zbase="520" zfactor="1.2810">
	<Object type="LBAMap" name="Sewers_walk" filename="Sewers.lba" x="0" y="0"/>

	<Audio source="computer"/>

	<!-- Images -->
	<Object type="ImageBox" image="Sewers" x="0" y="0" />
    <Object type="ImageBox" image="Sewers_Bg1" x="426" y="0" />
    <if t="not $strange_object_taken">
		<Object type="ImageBox" image="Black_hole" x="228" y="234" />
	</if>

	<if t="$luna_scene == varion.Sewers or $current_character == luna">
		<Object type="Character2D" chr="luna" x="0" y="0"/>
	</if>

	<if t="$brawe_scene == varion.Sewers">
		<Object type="Character2D" chr="brawe" x="0" y="0"/>
	</if>


	<!-- Actions -->

	<if t="$prison_she_down and $return_to_luna">
		<Action type="SetVar" var="return_to_luna" value="0" reset="0"/>
	</if>


	<!-- DISTRACTION TIMER -->

	<if t="not $disable_sewers_timer and not $walking_from_sewers_to_prison">
		<if t="$distraction_in_progress and not $she_goes_out_cutscene">
			<if t="$varion_timer_counter } 0">
				<Animator type="DelayedAction" time="1">
					<Action type="IncVar" var="varion_timer_counter" value="-1"/>
				</Animator>

			<else> <!-- on timeout -->
				<Action type="EndDialog"/>
				<Action type="ClearJobs" chr="luna"/>
				<Action type="ClearJobs" chr="she"/>
				<Action type="ClearJobs" chr="brawe"/>
				<Action type="Reference" ref="M::SHE_GOES_BACK"/>
				<Action type="SetVar" var="she_goes_out_cutscene" value="0" reset="0"/>
				<Action type="SetVar" var="switch_back_to" value="varion.Sewers" reset="0"/> <!-- ime trenutne scene -->
				<Action type="SwitchScene" scene="varion.LCorridor"/>
			</else>
			</if>
		</if>
	<else>
		<Action type="DebugPrint" text="sewers timer skipped."/>
	</else>
	</if>

	<!-- **************** -->

	<if t="$luna_under_pothole and $prev_scene == varion.Prison">
		<!--
		<Action type="EndDialog"/>
		<Action type="ClearJobs" chr="she"/>
		<Action type="ClearJobs" chr="danny"/>
		<Action type="ClearJobs" chr="luna"/>
		<Action type="ClearJobs" chr="brawe"/> 
		-->
		
		<Action type="CommandCharacter" chr="luna">
			<Job type="SetVar" var="walking_from_sewers_to_prison" value="1" reset="1"/>
			<!-- <Job type="Pause" time="1"/> -->
			<Job condition="not $luna_gave_brawe_sprayer" type="Say" key="INCAPACITATE_HINT_01"/> <!-- pre-delay is embedded in textfile -->			
			<Job condition="not $luna_gave_brawe_sprayer" type="SetVar" var="hint25_diversion" value="1" reset="0"/>
			<Job condition="$luna_gave_brawe_sprayer" type="Pause" time="1"/>
			<!-- <Job type="SetVar" var="walking_from_sewers_to_prison" value="0" reset="0"/> --> <!-- u Prisonu se resetira natrag na 0 -->
			<Job type="SetVar" var="luna_under_pothole" value="0" reset="0"/>
			<Job type="SwitchScene" scene="varion.Prison"/>			
		</Action>
	</if>

	<Action color="FFFF00" type="CommandCharacter" chr="$current_character" rollover="RO_BACK_TO_WAREHOUSE|u">
		<Job type="LockScene"/>
		<Job type="SetVar" var="disable_sewers_timer" value="1" reset="1"/>
		<Job type="Move" x="457" y="221"/>
		<Job type="SetOrientation" direction="NW"/>
		<Job type="SwitchScene" scene="Warehouse" pos="277,128,SW"/>
	</Action>

	<Action color="0000FF" type="CommandCharacter" chr="$current_character" rollover="RO_GOTO_PRISON_FROM_SEWERS|u">		
		<Job type="SetVar" var="walking_from_sewers_to_prison" value="1" reset="1"/>
		<Job condition="not (not $distraction_in_progress and not $prison_she_down) and not $current_character == brawe" type="LockScene"/>
		<Job type="Move" x="68" y="223"/>
		<Job type="SetOrientation" direction="NE"/>		
		<Job condition="$distraction_in_progress" type="SetVar" var="luna_under_pothole" value="1" reset="0"/>
		<Job condition="$distraction_in_progress" type="SetVar" var="ignore_this_reset" value="1" reset="0"/>
		<!-- <Job type="SetVar" var="walking_from_sewers_to_prison" value="0" reset="0"/> --> <!-- u Prisonu se resetira natrag na 0 -->		
		<Job condition="$distraction_in_progress or $prison_she_down" type="SwitchScene" scene="varion.Prison"/>
		<Job condition="not $distraction_in_progress and not $prison_she_down" type="Say" key="LUNA_CANT_GO_UP_TO_PRISON_01"/>
	</Action>

	<Action condition="not $strange_object_taken" color="FF0000" type="Multiple" rollover="RO_BLACK_HOLE">
		<Action multiple="look" type="CommandCharacter" chr="$current_character">
			<Job type="Move" x="228" y="275"/>
			<Job type="SetOrientation" direction="NE"/>
			<Job type="SetVar" var="knows_about_strange_object" value="1"/>
			<Job type="Say" key="BLACK_HOLE_LOOK_01"/>
		</Action>

		<Action multiple="use" condition="$current_character == brawe" type="CommandCharacter" chr="brawe" rollover="ui.casual_use_only">
			<Job type="Move" x="228" y="275"/>
			<Job type="SetOrientation" direction="NE"/>
			<Job type="Say" key="BLACK_HOLE_TAKE_BRAWE_01"/>
			<Job type="Animate" ani="Take"/>
			<Job type="SetVar" var="strange_object_taken" value="1"/>
			<Job type="AddItem" item="black_hole"/>
			<Job type="Animate" ani="TakeBack"/>
		</Action>

		<Action multiple="use" condition="not $current_character == brawe" type="CommandCharacter" chr="$current_character" rollover="ui.casual_use_only">
			<Job type="Move" x="228" y="275"/>
			<Job type="SetOrientation" direction="NE"/>
			<Job type="Say" key="BLACK_HOLE_TAKE_LUNA_01"/>
		</Action>

	</Action>

	<!-- foreground -->
	<Object type="ImageBox" image="Sewers-Foreground" x="90" y="220" />

</Scene>