<?xml version="1.0" ?>

<Scene name="LCorridor" zbase="316" zfactor="0.52">
	<Object type="LBAMap" name="LCorridor_walk" filename="LCorridor.lba" x="0" y="0"/>

	<Audio source="entrance"/>

	<!-- Images -->
    <if t="not $taken_logo"> <Object type="ImageBox" image="Kribb-Logo" x="330" y="197" /> </if>

	<if t="not $distraction_in_progress">
		<if t="not $returning_to_lcorr">
			<if t="$danny_scene == varion.LCorridor">
				<if t="$current_character == danny and not $switched_character">
					<Object type="Character2D" chr="danny" x="0" y="0">						
						<Property name="position_if:$prev_scene == varion.Elevator" value="390,274,W"/>
						<Property name="position_if:$prev_scene == varion.LandingDock" value="164,199,SW"/>
						<Property name="position_if:$prev_scene == varion.Prison" value="81,244,SE"/>
						<Property name="position_if:" value="344,265,NE"/>
					</Object>
				<else>
					<Object type="Character2D" chr="danny" x="0" y="0">
						<Property name="position_if:" value="122,224,W"/>
					</Object>
				</else>
				</if>
			</if>
		</if>
	<else> <!-- distraction_in_progress -->
		<Object type="Character2D" chr="danny" x="0" y="0">
			<Property name="position_if:" value="122,224,W"/>
		</Object>

		<Object type="Character2D" chr="she" x="0" y="0">
			<Property name="position_if:" value="42,235,E"/>
		</Object>

	</else>
	</if>

	<if t="$returning_to_lcorr">
		<Object type="Character2D" chr="danny" x="0" y="0">
			<Property name="position_if:" value="122,224,W"/>
		</Object>

		<Action type="CommandCharacter" chr="danny">
			<Job type="SetVar" var="returning_to_lcorr" value="0" reset="0"/>
		</Action>
	</if>

	<Object type="Character2D" chr="policeman" x="0" y="0" name="policeman3">
		<Property name="position_if:" value="73,211,E"/>
	</Object>


	<if t="$luna_scene == varion.LCorridor">
		<Object type="Character2D" chr="luna" x="0" y="0">
			<Property name="position_if:$prev_scene == varion.Prison and not $switched_character" value="37,233,E"/>
			<Property name="position_if:$prev_scene == varion.Laboratory and not $switched_character" value="192,224,W"/>
			<Property name="position_if:" value="192,224,W"/>
		</Object>
		<if t="$prev_scene == varion.Prison and $current_character == luna and not $switched_character">
			<Action type="CommandCharacter" chr="luna">
				<Job type="Move" x="145" y="230"/>
				<Job type="SetOrientation" direction="E"/>
			</Action>
		</if>
	</if>

	<!-- Actions -->
	<Action color="0000FF" type="CommandCharacter" chr="$current_character" rollover="RO_BACK_TO_LANDING_DOCK|u">
		<Job type="Move" x="164" y="199"/>
		<Job type="SetOrientation" direction="NE"/>
		<Job condition="$current_character == danny" type="SwitchScene" scene="LandingDock"/>
		<Job condition="$current_character == luna" type="Dialog" dialog="SEQ_GUARD_LUNA_CANT_GO_TO_LANDING_DOCK"/>
	</Action>
	<Action color="FFFF00" type="CommandCharacter" chr="$current_character" rollover="RO_GOTO_ELEVATOR|r">
		<Job type="Move" x="390" y="274"/>
		<Job condition="$current_character == danny" type="SetOrientation" direction="E"/>
		<Job condition="$current_character == danny" type="SwitchScene" scene="Elevator" />
		<Job condition="$current_character == luna" type="SetOrientation" direction="NW"/>
		<Job condition="$current_character == luna" type="Dialog" dialog="SEQ_GUARD_LUNA_CANT_GO_TO_ELEVATOR"/>
	</Action>

	<Action color="FF0000" type="CommandCharacter" chr="$current_character" rollover="RO_GOTO_PRISON|l">
		<Job condition="$current_character == danny" type="Move" x="122" y="224"/>
		<Job condition="$current_character == danny" type="SetOrientation" direction="W"/>
		<Job condition="$current_character == danny" type="Dialog" dialog="SEQ_DANNY_NOT_GOING_TO_PRISON"/>
		<Job condition="$current_character == luna" type="Move" x="37" y="233"/>
		<Job condition="$current_character == luna" type="SetOrientation" direction="NE"/>
		<Job condition="$current_character == luna" type="Dialog" dialog="SEQ_RETURNING_TO_PRISON"/>
	</Action>


	<if t="$distraction_in_progress and $she_goes_out_cutscene"> <!-- zapocne "dijalog" i starta se timer -->
		<Action type="CommandCharacter" chr="she">
			<Job type="SetVar" var="disable_prison_timer" value="0" reset="0"/>
			<Job type="SetVar" var="disable_sewers_timer" value="0" reset="0"/>
			<Job type="Pause" time="1"/>
			<Job type="Say" key="SHE_PRISON_DANNY_INFO_02"/>
		
			
			<Job type="SetVar" var="danny_items" value="$items" reset="0"/>
			<Job type="SetVar" var="items" value="$luna_items" reset="0"/>
			
			<Job type="SetVar" var="current_character" value="luna" reset="0"/>
			<Job type="SwitchScene" scene="$luna_scene"/>
			<Job type="SetVar" var="she_goes_out_cutscene" value="0" reset="0"/>
			<Job type="UnlockScene"/>
		</Action>
	</if>

	<!-- DISTRACTION TIMER -->

	<if t="$distraction_in_progress and not $she_goes_out_cutscene and not $disable_LCorr_timer">
		<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"/>
		</else>
		</if>
	</if>

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


	<Action name="M::SHE_GOES_BACK" type="CommandCharacter" chr="she">
		<Job type="LockScene"/>
		<Job type="SetVar" var="disable_LCorr_timer" value="1" reset="0"/>
		<Job type="SetVar" var="disable_prison_timer" value="1" reset="0"/>
		<Job type="SetVar" var="ignore_this_reset" value="0" reset="0"/>
		<Job type="SetVar" var="she_goes_out_cutscene" value="0" reset="0"/>
		<Job type="Pause" time="1"/>
		<Job type="Say" key="SHE_PRISON_DANNY_INFO_03"/>
		<Job type="SetOrientation" direction="W"/>
		<Job type="SetVar" var="disable_LCorr_timer" value="0" reset="0"/>
		<Job type="SwitchScene" scene="varion.Prison"/>
	</Action>



	<if t="$current_character == danny">
		<Action color="00FF00" type="Multiple" rollover="RO_GUARD">
			<Action multiple="look" type="CommandCharacter" chr="danny" >
				<Job type="Move" x="122" y="224"/>
				<Job type="SetOrientation" direction="W"/>
				<Job type="Say" key="LOOKED_AT_GUARD_01"/>
			</Action>
			<Action multiple="talk" type="CommandCharacter" chr="danny" >
				<Job type="Move" x="122" y="224"/>
				<Job type="SetOrientation" direction="W"/>
				<Job condition="not $luna_is_interrogator and not $prison_she_down" type="Dialog" dialog="guard3_root"/>
				<Job condition="not (not $luna_is_interrogator and not $prison_she_down) and $lcorr_guard_commented" type="CallAction" ref="M::GUARD_GET_LOST_DANNY"/>
				<Job condition="not (not $luna_is_interrogator and not $prison_she_down) and not $lcorr_guard_commented" type="Dialog" dialog="SEQ_GUARD_COMMENTS"/>
			</Action>
		</Action>
	</if>
		
	<Action name="M::GUARD_GET_LOST_DANNY" type="CommandCharacter" chr="policeman">
		<Job type="Say" key="GUARD_GET_LOST_DANNY_01"/>
	</Action>
	

	<if t="not $taken_logo">
		<Action color="FF66FF" type="Multiple" rollover="RO_KRIBB_LOGO">
			<Action multiple="look" type="CommandCharacter" chr="danny">
				<Job type="Move" x="344" y="265"/>
				<Job type="SetOrientation" direction="N"/>
				<Job type="Say" key="KRIBB_LOGO_LOOK_01"/>
			</Action>

			<Action multiple="use" type="CommandCharacter" chr="danny" rollover="ui.casual_use_only">
				<Job type="Move" x="344" y="265"/>
				<Job type="SetOrientation" direction="NE"/>
				<Job type="Say" key="KRIBB_LOGO_TAKE_01"/>
				<Job type="Animate" ani="Take"/>
				<Job type="PlaySound" sound="kribbs_logo_take"/>
				<Job type="AddItem" item="kribb_logo" var="taken_logo" value="1"/>
				<Job type="Animate" ani="TakeBack"/>
			</Action>
		</Action>
	</if>

	<Action color="FF6600" type="CommandCharacter" chr="danny" rollover="RO_KRIBB_PLAQUE">
		<Job type="Move" x="344" y="265"/>
		<Job type="SetOrientation" direction="N"/>
		<Job type="Say" key="KRIBB_PLAQUE_LOOK_01"/>
	</Action>

	<Action color="0066FF" type="Multiple" rollover="RO_KRIBB_STATUE">
		<Action multiple="look" type="CommandCharacter" chr="danny">
			<Job type="Move" x="344" y="265"/>
			<Job type="SetOrientation" direction="N"/>
			<Job type="Say" key="KRIBB_STATUE_LOOK_01"/>
		</Action>
		<Action multiple="use" type="CommandCharacter" chr="danny">
			<Job type="Move" x="344" y="265"/>
			<Job type="SetOrientation" direction="N"/>
			<Job type="Say" key="KRIBB_STATUE_USE_01"/>
		</Action>
	</Action>

	<Action color="FF00FF" type="Reference" ref="M::who_is_there" rollover="RO_GOTO_UNDERGROUND|r"/>

	<Action name="M::who_is_there" type="Composite">
		<Action condition="$current_character == danny" type="Reference" ref="M::danny_cant_go_under"/>
		<Action condition="$current_character == luna" type="Reference" ref="M::luna_goes_under"/>
	</Action>

	<Action name="M::danny_cant_go_under" type="CommandCharacter" chr="danny">
		<Job type="Move" x="192" y="224"/>
		<Job type="SetOrientation" direction="E"/>
		<Job condition="not $underground_visited" type="Dialog" dialog="SEQ_DANNY_CANT_GO_UNDER"/>
		<Job condition="$underground_visited" type="CallAction" ref="M::guard_comment"/>
		<Job condition="$underground_visited" type="Pause" time="0.3"/>
		<Job condition="$underground_visited" type="SetOrientation" direction="W"/>
	</Action>

	<Action name="M::guard_comment" type="CommandCharacter" chr="policeman">
		<Job type="Say" key="GUARD_COMMENT_01"/>
	</Action>

	<Action name="M::luna_goes_under" type="CommandCharacter" chr="luna">
		<Job type="Move" x="192" y="224"/>
		<Job type="SetOrientation" direction="W"/>
		<Job type="Say" key="LUNA_GOES_UNDER_01"/>
		<Job type="SetOrientation" direction="E"/>
		<Job type="SetVar" var="luna_entered_from" value="varion.LCorridor"/>
		<Job type="SwitchScene" scene="varion.Laboratory" pos="730,160,SW"/>

	</Action>

	<!-- foreground -->
    <Object type="ImageBox" image="LCorridor-Foreground" x="0" y="0" />

</Scene>
