<?xml version="1.0" ?>

<Scene name="Router" hide_ui="1">

	<Audio source="maszlow_interior"/>

	<Action color="00FF00" type="SwitchScene" scene="EngineRoom" rollover="RO_ROUTER_2_ENGINE|u"/>
	<Action color="0000FF" type="SwitchScene" scene="EngineRoom" rollover="RO_ROUTER_2_ENGINE|d"/>
	<Action color="00FFFF" type="SwitchScene" scene="EngineRoom" rollover="RO_ROUTER_2_ENGINE|l"/>
	<Action color="FFFF00" type="SwitchScene" scene="EngineRoom" rollover="RO_ROUTER_2_ENGINE|r"/>

	<if t="$red == 2 and $green == 1 and $blue == 2 and $yellow == 3">
		<Action type="SetVar" var="combination_correct" value="1" reset="0"/>
	</if>

	<if t="$combination_correct and not $router_solved">
	    <Action color="FF0099" type="Composite" rollover="RO_ACTIVATE_ROUTER|x">
			<Action type="LockScene"/>
			<Action type="PlaySound" sound="start_router"/>
		    <Action type="SetVar" var="router_solved" value="1" reset="0"/>
		    <Action type="SetVar" var="router_cutscene" value="1" reset="0"/>
			<Action type="DebugPrint" text="Switching to EngineRoom..."/>
			<Action type="SwitchScene" scene="ship.EngineRoom"/>
		</Action>
		<else>
			<Action color="FF0099" type="Composite" rollover="RO_ACTIVATE_ROUTER|x">
				<Action type="Say" key="ROUTER_NOT_SOLVED"/>
				<!-- resetiranje handleova na krivu kombinaciju zakomentirano
				<Action type="SetVar" var="red" value="1" reset="0"/>
				<Action type="SetVar" var="green" value="2" reset="0"/>
				<Action type="SetVar" var="blue" value="3" reset="0"/>
				<Action type="SetVar" var="yellow" value="2" reset="0"/>
				<Action type="ResetScene"/>
				-->
			</Action>
		</else>
	</if>


	<if t="$red == 1">
        <Object type="ImageBox" image="R_1" x="143" y="192" />
		<Action color="99CC00" type="Composite" rollover="RO_MOVE_LEVER|r">
			<Action type="PlaySound" sound="lever"/>
			<Action type="SetVar" var="red" value="2"/>
		</Action>
	</if>

	<if t="$red == 2">
        <Object type="ImageBox" image="R_2" x="195" y="186" />
		<Action color="99CC00" type="Composite" rollover="RO_MOVE_LEVER|r">
			<Action type="PlaySound" sound="lever"/>
			<Action type="SetVar" var="red" value="3"/>
		</Action>
		<Action color="990000" type="Composite" rollover="RO_MOVE_LEVER|l" >
			<Action type="PlaySound" sound="lever"/>
			<Action type="SetVar" var="red" value="1"/>
		</Action>
	</if>

	<if t="$red == 3">
        <Object type="ImageBox" image="R_3" x="211" y="188" />
		<Action color="990000" type="Composite" rollover="RO_MOVE_LEVER|l" >
			<Action type="PlaySound" sound="lever"/>
			<Action type="SetVar" var="red" value="2"/>
		</Action>
	</if>

	<if t="$green == 1">
        <Object type="ImageBox" image="G_1" x="291" y="55" />
		<Action color="66CC00" type="Composite" rollover="RO_MOVE_LEVER|d" >
			<Action type="PlaySound" sound="lever"/>
			<Action type="SetVar" var="green" value="2"/>
		</Action>
	</if>

	<if t="$green == 2">
        <Object type="ImageBox" image="G_2" x="290" y="113" />
		<Action color="66CC00" type="Composite" rollover="RO_MOVE_LEVER|d" >
			<Action type="PlaySound" sound="lever"/>
			<Action type="SetVar" var="green" value="3"/>
		</Action>
		<Action color="660000" type="Composite" rollover="RO_MOVE_LEVER|u" >
			<Action type="PlaySound" sound="lever"/>
			<Action type="SetVar" var="green" value="1"/>
		</Action>
	</if>

	<if t="$green == 3">
        <Object type="ImageBox" image="G_3" x="288" y="126" />
		<Action color="660000" type="Composite" rollover="RO_MOVE_LEVER|u" >
			<Action type="PlaySound" sound="lever"/>
			<Action type="SetVar" var="green" value="2"/>
		</Action>
	</if>

	<if t="$blue == 1">
        <Object type="ImageBox" image="B_1" x="121" y="82" />
		<Action color="CCCC00" type="Composite" rollover="RO_MOVE_LEVER|d" >
			<Action type="PlaySound" sound="lever"/>
			<Action type="SetVar" var="blue" value="2"/>
		</Action>
	</if>

	<if t="$blue == 2">
        <Object type="ImageBox" image="B_2" x="121" y="132" />
		<Action color="CCCC00" type="Composite" rollover="RO_MOVE_LEVER|d" >
			<Action type="PlaySound" sound="lever"/>
			<Action type="SetVar" var="blue" value="3"/>
		</Action>
		<Action color="CC0000" type="Composite" rollover="RO_MOVE_LEVER|u" >
			<Action type="PlaySound" sound="lever"/>
			<Action type="SetVar" var="blue" value="1"/>
		</Action>
	</if>

	<if t="$blue == 3">
        <Object type="ImageBox" image="B_3" x="118" y="146" />
		<Action color="CC0000" type="Composite" rollover="RO_MOVE_LEVER|u" >
			<Action type="PlaySound" sound="lever"/>
			<Action type="SetVar" var="blue" value="2"/>
		</Action>
	</if>

	<if t="$yellow == 1">
        <Object type="ImageBox" image="Y_1" x="130" y="51" />
		<Action color="FFCC00" type="Composite" rollover="RO_MOVE_LEVER|r" >
			<Action type="PlaySound" sound="lever"/>
			<Action type="SetVar" var="yellow" value="2"/>
		</Action>
	</if>

	<if t="$yellow == 2">
        <Object type="ImageBox" image="Y_2" x="181" y="44" />
		<Action color="FFCC00" type="Composite" rollover="RO_MOVE_LEVER|r" >
			<Action type="PlaySound" sound="lever"/>
			<Action type="SetVar" var="yellow" value="3"/>
		</Action>
		<Action color="FF0000" type="Composite" rollover="RO_MOVE_LEVER|l" >
			<Action type="PlaySound" sound="lever"/>
			<Action type="SetVar" var="yellow" value="1"/>
		</Action>
	</if>

	<if t="$yellow == 3">
        <Object type="ImageBox" image="Y_3" x="194" y="42" />
		<Action color="FF0000" type="Composite" rollover="RO_MOVE_LEVER|l" >
			<Action type="PlaySound" sound="lever"/>
			<Action type="SetVar" var="yellow" value="2"/>
		</Action>
	</if>


</Scene>