<scene name="Room6" numVictoryConditions="1">
	<inventory>
		<object name="Diamond" memberName="HUD_diamond" acquired="0" visible="1"/>
		<object name="Magnet" memberName="HUD_magnet" acquired="0" visible="1"/>	
		<object name="Coin" memberName="HUD_coin" acquired="0" visible="1"/>		
		<object name="Soda" memberName="HUD_soda" acquired="0" visible="1"/>		
	</inventory>
	
	<finalStates>
		<finalState objName="Diamond" state="acquired"/>
		<finalState objName="Magnet" state="magnetGone"/>
		<finalState objName="MagnetHole" state="visible"/>
		<finalState objName="Coin" state="acquired"/>
		<finalState objName="Soda" state="noSoda"/>
		<finalState objName="Panel" state="sparking"/>
		<finalState objName="Laser" state="disabled"/>
		<finalState objName="OpenDoor" state="open"/>
	</finalStates>
	
	<animations>
		<animation name="PopLight1Anim" type="loop">
			<frames>
				<frame memberName="popLight1_anim" frameDelay="360" blend="0"/>
				<frame memberName="popLight1_anim" frameDelay="4" blend="50"/>
				<frame memberName="popLight1_anim" frameDelay="8" blend="20"/>
				<frame memberName="popLight1_anim" frameDelay="4" blend="50"/>								
				<frame memberName="popLight1_anim" frameDelay="180" blend="100"/>
			</frames>
		</animation>
		
		<animation name="PopLight2Anim" type="loop">
			<frames>
				<frame memberName="popLight2_anim" frameDelay="320" blend="0"/>
				<frame memberName="popLight2_anim" frameDelay="4" blend="50"/>
				<frame memberName="popLight2_anim" frameDelay="8" blend="30"/>
				<frame memberName="popLight2_anim" frameDelay="4" blend="50"/>								
				<frame memberName="popLight2_anim" frameDelay="160" blend="100"/>
			</frames>
		</animation>
	</animations>
	
	<zoomWindows>
		<zoomWindow name="DiamondWindow" file="ZoomWindows\Room6_DiamondWindow.dir" x="200" y="360" visible="0"/>
		<zoomWindow name="MagnetWindow" file="ZoomWindows\Room6_MagnetWindow.dir" x="340" y="340" visible="0"/>
		<zoomWindow name="SodaMachineWindow" file="ZoomWindows\Room6_SodaMachineWindow.dir" x="660" y="340" visible="0"/>
		<zoomWindow name="PanelWindow" file="ZoomWindows\Room6_PanelWindow.dir" x="440" y="300" visible="0"/>
	</zoomWindows>
	
	<objects>
		<object name="Diamond">
			<clickStrategy type="alpha" layer="Diamond"/>
			<states>
				<state name="clickable">
					<onStateEnter>
						<action target="Scene" name="ShowLayer" param="Diamond"/>
						<action target="Scene" name="PlaySound" param="indoor_small"/>
						<action target="Scene" name="PlaySound" param="circuit"/>
						<action target="Scene" name="StartAnimation" param="PopLight1Anim"/>
						<action target="Scene" name="StartAnimation" param="PopLight2Anim"/>
					</onStateEnter>
					
					<onMouseOver>
						<action target="Scene" name="SetCursor" param="zoom"/>
					</onMouseOver>
					
					<onClick>
						<action target="Scene" name="OpenWindow" param="DiamondWindow"/>
					</onClick>
				</state>

				<state name="acquired">
					<onStateEnter>
						<action target="Scene" name="HideLayer" param="Diamond"/>
						<action target="Scene" name="PlaySound" param="Item_Pickup_Glass_small"/>
						<action target="Scene" name="CloseWindow" param="DiamondWindow"/>
					</onStateEnter>
				</state>
			</states>
		</object>
		
		<object name="Magnet">
			<!--<clickStrategy type="alpha" layer="Magnet"/>-->
			<clickStrategy type="rect" left="305" top="260" right="370" bottom="360"/>
			<states>
				<state name="clickable">
					<onStateEnter>
						<action target="Scene" name="ShowLayer" param="Magnet"/>
					</onStateEnter>
					
					<onMouseOver>
						<action target="Scene" name="SetCursor" param="zoom"/>
					</onMouseOver>
					
					<onClick>
						<action target="Scene" name="OpenWindow" param="MagnetWindow"/>
						<action target="Scene" name="ShowDialog" param="magnet_click"/>
					</onClick>
					
					<onUseObject name="Diamond">
						<action target="Scene" name="RemoveFromInventory" param="Diamond"/>
						<action target="Scene" name="OpenWindow" param="MagnetWindow"/>
						<action target="Magnet" name="SetState" param="holeCut"/>
						<action target="MagnetHole" name="SetState" param="visible"/>
						<action target="Scene" name="PlaySound" param="cutting_glass"/>
					</onUseObject>
				</state>
				
				<state name="holeCut">
					<onStateEnter>
						<action target="Scene" name="ShowLayer" param="Magnet"/>
					</onStateEnter>
					
					<onMouseOver>
						<action target="Scene" name="SetCursor" param="zoom"/>
					</onMouseOver>
					
					<onClick>
						<action target="Scene" name="OpenWindow" param="MagnetWindow"/>
					</onClick>
				</state>
				
				<state name="magnetGone">
					<onStateEnter>
						<action target="Scene" name="HideLayer" param="Magnet"/>
						<action target="Scene" name="PlaySound" param="Item_Pickup_Metal_small"/>
						<action target="Scene" name="CloseWindow" param="MagnetWindow"/>
					</onStateEnter>
				</state>
			</states>			
		</object>
		
		<object name="MagnetHole">
			<states>
				<state name="invisible">
					<onStateEnter>
						<action target="Scene" name="HideLayer" param="MagnetHole"/>
					</onStateEnter>
				</state>
					
				<state name="visible">
					<onStateEnter>
						<action target="Scene" name="ShowLayer" param="MagnetHole"/>						
					</onStateEnter>
				</state>
			</states>
		</object>
		
		<object name="Coin">
			<!--<clickStrategy type="alpha" layer="Coin"/>		-->
			<clickStrategy type="rect" left="510" top="365" right="810" bottom="510"/>
			<states>
				<state name="waitForMagnet">
					<onStateEnter>
						<action target="Scene" name="ShowLayer" param="Coin"/>
					</onStateEnter>
					
					<onMouseOver>
						<action target="Scene" name="SetCursor" param="interactive"/>
					</onMouseOver>
					
					<onClick>						
						<action target="Scene" name="ShowDialog" param="coin_click"/>					
					</onClick>
					
					<onUseObject name="Magnet">
						<action target="Scene" name="RemoveFromInventory" param="Magnet"/>
						<action target="Scene" name="AddToInventory" param="Coin"/>
						<action target="Coin" name="SetState" param="acquired"/>
						<action target="Scene" name="PlaySound" param="use_magnet_on_coin"/>
					</onUseObject>
				</state>
				
				<state name="acquired">
					<onStateEnter>
						<action target="Scene" name="HideLayer" param="Coin"/>
					</onStateEnter>
				</state>
			</states>
		</object>
		
		<object name="Soda">
			<clickStrategy type="rect" left="665" top="200" right="810" bottom="355"/>			
			<states>
				<state name="waitForCoin">
					<onStateEnter>
						<action target="Scene" name="HideLayer" param="Soda"/>
					</onStateEnter>
					
					<onMouseOver>
						<action target="Scene" name="SetCursor" param="zoom"/>
					</onMouseOver>
					
					<onClick>
						<action target="Scene" name="OpenWindow" param="SodaMachineWindow"/>
					</onClick>
					
					<onUseObject name="Coin">
						<action target="Scene" name="OpenWindow" param="SodaMachineWindow"/>
						<action target="Soda" name="SetState" param="withSoda"/>
						<action target="Scene" name="RemoveFromInventory" param="Coin"/>
						<action target="Scene" name="PlaySound" param="soda_machine"/>
					</onUseObject>
				</state>
				
				<state name="withSoda">
					<onStateEnter>
						<action target="Scene" name="ShowLayer" param="Soda"/>
					</onStateEnter>
					
					<onMouseOver>
						<action target="Scene" name="SetCursor" param="zoom"/>
					</onMouseOver>
					
					<onClick>
						<action target="Scene" name="OpenWindow" param="SodaMachineWindow"/>
					</onClick>
				</state>
				
				<state name="noSoda">
					<onStateEnter>
						<action target="Scene" name="HideLayer" param="Soda"/>
						<action target="Scene" name="PlaySound" param="take_can"/>
						<action target="Scene" name="CloseWindow" param="SodaMachineWindow"/>
					</onStateEnter>
				</state>
			</states>
		</object>
		
		<object name="Panel">
			<clickStrategy type="rect" left="420" top="270" right="465" bottom="330"/>
			<states>
				<state name="active">
					<onClick>
						<action target="Scene" name="OpenWindow" param="PanelWindow"/>
					</onClick>
					
					<onMouseOver>
						<action target="Scene" name="SetCursor" param="interactive"/>
					</onMouseOver>
					
					<onClick>
						<action target="Scene" name="ShowDialog" param="crank_click"/>
					</onClick>
					
					<onUseObject name="Soda">
						<action target="Scene" name="OpenWindow" param="PanelWindow"/>
						<action target="Scene" name="RemoveFromInventory" param="Soda"/>
						<action target="Panel" name="SetState" param="sparking"/>
						<action target="Laser" name="SetState" param="disabled"/>
						<action target="OpenDoor" name="SetState" param="open"/>						
						<action target="Scene" name="PlaySound" param="use_the_can"/>
					</onUseObject>
				</state>
				
				<state name="sparking">
					<onStateEnter>
						<action target="Scene" name="CloseWindow" param="PanelWindow" delay="60"/>
					</onStateEnter>
				</state>
			</states>
		</object>
		
		<object name="Laser">
			<states>
				<state name="active">
					<onStateEnter>
						<action target="Scene" name="HideLayer" param="Laser"/>
					</onStateEnter>
				</state>
				
				<state name="disabled">
					<onStateEnter>
						<action target="Scene" name="ShowLayer" param="Laser"/>
					</onStateEnter>
				</state>
			</states>
		</object>
		
		<object name="OpenDoor">
			<clickStrategy type="rect" left="520" top="190" right="650" bottom="350"/>			
			<states>
				<state name="closed">
					<onStateEnter>
						<action target="Scene" name="HideLayer" param="OpenDoor"/>
					</onStateEnter>
					
					<onMouseOver>
						<action target="Scene" name="SetCursor" param="noExit"/>
					</onMouseOver>
				</state>
				
				<state name="open">
					<onStateEnter>
						<action target="Scene" name="ShowLayer" param="OpenDoor"/>
						<action target="Scene" name="PlaySound" param="door_slide_open"/>
					</onStateEnter>
					
					<onMouseOver>
						<action target="Scene" name="SetCursor" param="exit"/>
					</onMouseOver>
					
					<onClick>
						<action target="Scene" name="RegisterVictoryCondition" param=""/>
					</onClick>
				</state>
			</states>
		</object>		
	</objects>
</scene>
