<?xml version="1.0" ?>

<Scene name="Elevator" zbase="382" zfactor="0.641">

	<Object type="LBAMap" name="Elevator_walk" filename="Elevator.lba" x="0" y="0"/>

	<Audio source="entrance"/>
	

	<!-- Images -->
	<if t="$elevator_door_opened == 0">
		<Object type="ImageBox" image="Right-Door" x="214" y="112" />
		<Object type="ImageBox" image="Left-Door" x="173" y="112" />
		<else>
			<Object type="ImageBox" image="Elevator_inside" x="171" y="110" />

			<if t="$elevator_door_opened == -1">
				<Object type="ImageBox" image="Right-Door" x="214" y="112">
					<Animator type="Mover" speed_x="50" speed_y="0"/>
				</Object>

				<Object type="ImageBox" image="Left-Door" x="173" y="112">
					<Animator type="Mover" speed_x="-50" speed_y="0"/>
				</Object>

				<Object type="ImageBox" image="Elevator" x="0" y="0" w="426"/>
			</if>

		</else>
	</if>

	<Object type="ImageBox" image="Mask" x="169" y="107" />

	<if t="not $taken_sprayer"> <Object type="ImageBox" image="Sprayer" x="292" y="177" /> </if>

	<if t="$brawe_scene == varion.Elevator">
		<Object type="Character2D" chr="brawe" x="0" y="0">
			<Property name="position_if:$prev_scene == varion.LCorridor" value="117,247,SE"/>
			<Property name="position_if:$prev_scene == varion.RCorridor" value="325,251,SW"/>
			<Property name="position_if:$prev_scene == varion.Barrier" value="218,298,N"/>
			<Property name="position_if:$prev_scene == varion.Laboratory" value="230,235,S"/>
		</Object>
	</if>

	<if t="$danny_scene == varion.Elevator">
		<Object type="Character2D" chr="danny" x="0" y="0">
			<Property name="position_if:$prev_scene == varion.LCorridor" value="117,247,SE"/>
			<Property name="position_if:$prev_scene == varion.RCorridor" value="325,251,SW"/>
			<Property name="position_if:$prev_scene == varion.Barrier" value="218,298,N"/>
			<Property name="position_if:$prev_scene == varion.Laboratory" value="230,235,S"/>
		</Object>
	</if>

	<!-- Actions -->
	<Action color="0000FF" type="CommandCharacter" chr="$current_character" rollover="RO_BACK_TO_LCORR|l">
		<Job condition="not $current_character == brawe" type="Move" x="43" y="220"/>
		<Job condition="not $current_character == brawe" type="SetOrientation" direction="NW"/>
		<Job condition="not $current_character == brawe" type="SwitchScene" scene="LCorridor"/>
		<Job condition="$current_character == brawe" type="Say" key="NOGO_VARION_01"/>
	</Action>
	<Action color="FF0000" type="CommandCharacter" chr="$current_character" rollover="RO_GOTO_RCORR|r">
		<Job type="Move" x="374" y="234"/>
		<Job type="SetOrientation" direction="NE"/>
		<Job type="SwitchScene" scene="RCorridor"/>
	</Action>
	<Action color="FFFF00" type="CommandCharacter" chr="$current_character" rollover="RO_BACK_TO_BARRIER|d">
		<Job condition="$current_character == danny" type="Move" x="218" y="298"/>
		<Job condition="$current_character == danny" type="SetOrientation" direction="S"/>
		<Job condition="$current_character == danny" type="SwitchScene" scene="Barrier"/>
		<Job condition="not $current_character == danny" type="Say" key="NOGO_VARION_01"/>
	</Action>

	<Action color="0066FF" type="ItemAction" rollover="RO_ELEVATOR_ID_PAD">
		<Action condition="not $elevator_door_opened" itemaction="noitem" type="Multiple">
			<Action multiple="look" type="CommandCharacter" chr="$current_character">
				<Job type="Move" x="139" y="248"/>
				<Job type="SetOrientation" direction="NE"/>
				<Job type="Say" key="ID_PAD_LOOK_01"/>
			</Action>
			<Action multiple="use" type="CommandCharacter" chr="$current_character" rollover="ui.casual_use_only">
				<Job type="Move" x="139" y="248"/>
				<Job type="SetOrientation" direction="NE"/>
				<Job type="Say" key="ID_PAD_USE_01"/>
			</Action>
		</Action>

		<Action itemaction="ID_card" type="CommandCharacter" chr="danny">
			<Job type="LockScene"/>
			<Job type="Move" x="150" y="235"/>
			<Job type="SetOrientation" direction="NE"/>
			<Job type="Say" key="ID_PAD_CARD_USE_PART1_01"/>
			<Job type="Animate" ani="Take"/>
			<Job type="Animate" ani="TakeBack"/>
			<Job type="PlaySound" sound="dirty_disc"/>
			<Job type="Pause" time="2"/>
			<Job type="StopSound" sound="dirty_disc"/>
			<Job type="UnlockScene"/>
			<Job type="Say" key="ID_PAD_CARD_USE_PART2_01"/>
		</Action>

		<Action itemaction="keycard" type="CommandCharacter" chr="$current_character">
			<Job type="Move" x="150" y="235"/>
			<Job type="SetOrientation" direction="NE"/>
			<Job type="LockScene"/>
			<Job type="Say" key="ID_PAD_KEYCARD_USE_01"/>
			<Job type="Animate" ani="Take"/>
			<Job type="PlaySound" sound="dirty_disc"/>
			<Job type="Pause" time="1"/>
			<Job type="StopSound" sound="dirty_disc"/>
			<Job type="Animate" ani="TakeBack"/>
			<!-- <Job type="RemoveItem" item="keycard" reset="0"/> -->
			<Job type="PlaySound" sound="elevator_open"/>
			<Job type="SetVar" var="elevator_door_opened" value="-1"/>
			<Job type="Pause" time="1.5"/>
			<Job type="SetVar" var="elevator_door_opened" value="1"/>			
			<Job type="Say" key="ELEVATOR_DOOR_OPENED_01"/>
			<Job type="Move" x="220" y="220"/>
			<Job type="SetOrientation" direction="S"/>
			<Job type="Pause" time="0.5"/>
			<Job condition="$current_character == brawe" type="SetVar" var="brawe_entered_from" value="varion.Elevator" reset="0"/>
			<Job condition="$current_character == luna" type="SetVar" var="luna_entered_from" value="varion.Elevator" reset="0"/>
			<Job condition="$current_character == danny" type="SetVar" var="danny_entered_from" value="varion.Elevator" reset="0"/>
			<Job type="UnlockScene"/>
			<Job type="SwitchScene" scene="varion.Laboratory" pos="420,115,S"/>
		</Action>
	</Action>

	<if t="not $elevator_door_opened">
		<Action color="FF00FF" type="Multiple" rollover="RO_ELEVATOR_DOOR">
			<Action multiple="look" type="CommandCharacter" chr="$current_character">
				<Job type="Move" x="230" y="235"/>
				<Job type="SetOrientation" direction="N"/>
				<Job type="Say" key="ELEVATOR_DOOR_LOOK_01"/>
			</Action>

			<Action multiple="use" type="CommandCharacter" chr="$current_character" rollover="ui.casual_use_only">
				<Job type="Move" x="230" y="235"/>
				<Job type="SetOrientation" direction="N"/>
				<Job type="Say" key="ELEVATOR_DOOR_USE_01"/>
			</Action>
		</Action>
	<else> <!-- elevator_door_opened -->
		<Action color="FF00FF" type="Composite" rollover="RO_ELEVATOR|u">
			<Action type="CommandCharacter" chr="$current_character">
				<Job type="Move" x="220" y="220"/>
				<Job type="SetOrientation" direction="N"/>
				<Job condition="$current_character == brawe" type="SetVar" var="brawe_entered_from" value="varion.Elevator" reset="0"/>
				<Job condition="$current_character == luna" type="SetVar" var="luna_entered_from" value="varion.Elevator" reset="0"/>
				<Job condition="$current_character == danny" type="SetVar" var="danny_entered_from" value="varion.Elevator" reset="0"/>
				<Job type="SetOrientation" direction="N"/>
				<Job type="SwitchScene" scene="varion.Laboratory" pos="420,115,S"/>
			</Action>
		</Action>

	</else>
	</if>

	<if t="not $taken_sprayer">
		<Action color="FF99FF" type="Multiple" rollover="RO_ELEVATOR_SPRAYER">
			<Action multiple="look" type="CommandCharacter" chr="danny">
				<Job type="Move" x="316" y="242"/>
				<Job type="SetOrientation" direction="NW"/>
				<Job type="Say" key="ELEVATOR_SPRAYER_LOOK_01"/>
			</Action>

			<Action multiple="use" type="CommandCharacter" chr="danny" rollover="ui.casual_use_only">
				<Job type="Move" x="316" y="242"/>
				<Job type="SetOrientation" direction="NW"/>
				<Job type="Say" key="ELEVATOR_SPRAYER_TAKE_01"/>
				<Job type="Animate" ani="Take"/>
				<Job type="AddItem" item="water_sprayer"/>
				<Job type="SetVar" var="taken_sprayer" value="1"/>
				<Job type="Animate" ani="TakeBack"/>
			</Action>
		</Action>

		<Action color="FF66FF" type="Multiple" rollover="RO_ELEVATOR_PLANT">
			<Action multiple="look" type="CommandCharacter" chr="$current_character">
				<Job type="Move" x="316" y="242"/>
				<Job type="SetOrientation" direction="N"/>
				<Job type="Say" key="ELEVATOR_PLANT_LOOK_01"/>
			</Action>
			<Action multiple="use" type="CommandCharacter" chr="$current_character">
				<Job type="Move" x="316" y="242"/>
				<Job type="SetOrientation" direction="N"/>
				<Job type="Say" key="ELEVATOR_PLANT_USE_01"/>
			</Action>
		</Action>
	<else> <!-- taken sprayer -->
		<Action color="FF66FF" type="Multiple" rollover="RO_ELEVATOR_PLANT">
			<Action multiple="look"  type="CommandCharacter" chr="$current_character">
				<Job type="Move" x="316" y="242"/>
				<Job type="SetOrientation" direction="N"/>
				<Job type="Say" key="ELEVATOR_PLANT_LOOK_01"/>
			</Action>
			<Action multiple="use" type="CommandCharacter" chr="$current_character">
				<Job type="Move" x="316" y="242"/>
				<Job type="SetOrientation" direction="N"/>
				<Job type="Say" key="ELEVATOR_PLANT_USE_01"/>
			</Action>
		</Action>

		<Action color="FF99FF" type="Multiple" rollover="RO_ELEVATOR_PLANT">
			<Action multiple="look" type="CommandCharacter" chr="$current_character">
				<Job type="Move" x="316" y="242"/>
				<Job type="SetOrientation" direction="N"/>
				<Job type="Say" key="ELEVATOR_PLANT_LOOK_01"/>
			</Action>
			<Action multiple="use" type="CommandCharacter" chr="$current_character">
				<Job type="Move" x="316" y="242"/>
				<Job type="SetOrientation" direction="N"/>
				<Job type="Say" key="ELEVATOR_PLANT_USE_01"/>
			</Action>
		</Action>
	</else>
	</if>

	<Action color="006600" type="Multiple" rollover="RO_ELEVATOR_SPEAKER">
		<Action multiple="look" type="CommandCharacter" chr="$current_character">
			<Job type="Move" x="232" y="263"/>
			<Job type="SetOrientation" direction="N"/>
			<Job type="Say" key="ELEVATOR_SPEAKER_LOOK_01"/>
		</Action>
		<Action multiple="use" type="CommandCharacter" chr="$current_character">
			<Job type="Move" x="232" y="263"/>
			<Job type="SetOrientation" direction="N"/>
			<Job type="Say" key="ELEVATOR_SPEAKER_USE_01"/>
		</Action>
		<Action multiple="talk" type="CommandCharacter" chr="$current_character">
			<Job type="Move" x="232" y="263"/>
			<Job type="SetOrientation" direction="N"/>
			<Job type="Say" key="ELEVATOR_SPEAKER_TALK_01"/>
		</Action>
	</Action>


	<!-- foreground -->
    <Object type="ImageBox" image="Elevator-Foreground1" x="0" y="0" />
    <Object type="ImageBox" image="Elevator-Foreground-2" x="223" y="0" />

</Scene>