<scene name="Room33" numVictoryConditions="1">
	<inventory>
		<object name="BlowpipePiece1" memberName="HUD_blowpipePiece1" acquired="0" visible="1">
			<onUseObject name="BlowpipePiece2">
				<action target="Scene" name="RemoveFromInventory" param="BlowpipePiece1"/>
				<action target="Scene" name="RemoveFromInventory" param="BlowpipePiece2"/>
				<action target="Scene" name="AddToInventory" param="Blowpipe"/>
				<action target="Scene" name="PlaySound" param="connent_blowpipes"/>
			</onUseObject>
		</object>
		<object name="BlowpipePiece2" memberName="HUD_blowpipePiece1" acquired="0" visible="1">
			<onUseObject name="BlowpipePiece1">
				<action target="Scene" name="RemoveFromInventory" param="BlowpipePiece1"/>
				<action target="Scene" name="RemoveFromInventory" param="BlowpipePiece2"/>
				<action target="Scene" name="AddToInventory" param="Blowpipe"/>
				<action target="Scene" name="PlaySound" param="connent_blowpipes"/>
			</onUseObject>
		</object>
		<object name="Dart" memberName="HUD_dart" acquired="0" visible="1">
			<onUseObject name="Blowpipe">
				<action target="Scene" name="RemoveFromInventory" param="Dart"/>
				<action target="Scene" name="RemoveFromInventory" param="Blowpipe"/>
				<action target="Scene" name="AddToInventory" param="LoadedBlowpipe"/>
				<action target="Scene" name="PlaySound" param="dart_to_blowpipe"/>
			</onUseObject>
		</object>
		<object name="IDCard" memberName="HUD_IDCard" acquired="0" visible="1"/>
		<object name="MagneticCard" memberName="HUD_magneticCard" acquired="0" visible="1"/>
		<object name="Paperclips" memberName="HUD_clips" acquired="0" visible="1"/>
		<object name="Blowpipe" memberName="HUD_blowpipe" acquired="0" visible="0">
			<onUseObject name="Dart">
				<action target="Scene" name="RemoveFromInventory" param="Dart"/>
				<action target="Scene" name="RemoveFromInventory" param="Blowpipe"/>
				<action target="Scene" name="AddToInventory" param="LoadedBlowpipe"/>
				<action target="Scene" name="PlaySound" param="dart_to_blowpipe"/>
			</onUseObject>
		</object>		
		<object name="LoadedBlowpipe" memberName="HUD_blowpipe" acquired="0" visible="0"/>
	</inventory>
	
	<finalStates>
		<finalState objName="BlowpipePiece1" state="acquired"/>
		<finalState objName="BlowpipeCase" state="noBlowpipe"/>
		<finalState objName="DartCase" state="noDart"/>
		<finalState objName="IDCard" state="acquired"/>
		<finalState objName="MagneticCard" state="acquired"/>
		<finalState objName="Paperclips" state="acquired"/>
		<finalState objName="CardReader" state="unlocked"/>
		<finalState objName="Door" state="open"/>
	</finalStates>
	
	<zoomWindows>
		<zoomWindow name="BlowpipeCaseWindow" file="ZoomWindows\Room33_BlowpipeCaseWindow.dir" x="150" y="210" visible="0"/>
		<zoomWindow name="DartCaseWindow" file="ZoomWindows\Room33_DartCaseWindow.dir" x="210" y="320" visible="0"/>
		<zoomWindow name="CardReaderWindow" file="ZoomWindows\Room33_CardReaderWindow.dir" x="485" y="310" visible="0"/>
		<zoomWindow name="MagneticCardWindow" file="ZoomWindows\Room33_MagneticCardWindow.dir" x="610" y="235" visible="0"/>
	</zoomWindows>
	
	<objects>
		<object name="BlowpipePiece1">
			<clickStrategy type="alpha" layer="BlowpipePiece"/>
			<states>
				<state name="clickable">
					<onStateEnter>
						<action target="Scene" name="ShowLayer" param="BlowpipePiece"/>
						<action target="Scene" name="PlaySound" param="indoor_small"/>
					</onStateEnter>
					
					<onMouseOver>
						<action target="Scene" name="SetCursor" param="interactive"/>
					</onMouseOver>
					
					<onClick>
						<action target="Scene" name="AddToInventory" param="BlowpipePiece1"/>
						<action target="BlowpipePiece1" name="SetState" param="acquired"/>
						<action target="Scene" name="PlaySound" param="Item_Pickup_Metal_small"/>
					</onClick>
				</state>
				
				<state name="acquired">
					<onStateEnter><action target="Scene" name="HideLayer" param="BlowpipePiece"/></onStateEnter>
				</state>
			</states>
		</object>
		
		<object name="BlowpipeCase">
			<clickStrategy type="alpha" layer="BlowpipeCase"/>
			<states>
				<state name="withBlowpipe">
					<onStateEnter><action target="Scene" name="ShowLayer" param="BlowpipeCase"/></onStateEnter>
					
					<onMouseOver>
						<action target="Scene" name="SetCursor" param="zoom"/>
					</onMouseOver>					
					
					<onClick><action target="Scene" name="OpenWindow" param="BlowpipeCaseWindow"/></onClick>
				</state>
				
				<state name="noBlowpipe">
					<onStateEnter>
						<action target="Scene" name="CloseWindow" param="BlowpipeCaseWindow" delay="60"/>
						<action target="Scene" name="HideLayer" param="BlowpipeCase"/>
						<action target="Scene" name="PlaySound" param="Item_Pickup_Metal_small"/>
					</onStateEnter>
				</state>
			</states>
		</object>
		
		<object name="DartCase">
			<clickStrategy type="alpha" layer="DartCaseNoDart"/>
			<states>
				<state name="withDart">
					<onStateEnter>
						<action target="Scene" name="ShowLayer" param="DartCaseBrokenGlass"/>
						<action target="Scene" name="HideLayer" param="DartCaseNoDart"/>
					</onStateEnter>
					
					<onMouseOver>
						<action target="Scene" name="SetCursor" param="zoom"/>
					</onMouseOver>					
					
					<onClick><action target="Scene" name="OpenWindow" param="DartCaseWindow"/></onClick>
				</state>
				
				<state name="noDart">
					<onStateEnter>
						<action target="Scene" name="CloseWindow" param="DartCaseWindow" delay="60"/>
						<action target="Scene" name="ShowLayer" param="DartCaseBrokenGlass"/>
						<action target="Scene" name="ShowLayer" param="DartCaseNoDart"/>
						<action target="Scene" name="PlaySound" param="take_a_dart"/>
					</onStateEnter>
				</state>
			</states>
		</object>
		
		<object name="IDCard">
			<clickStrategy type="alpha" layer="IDCard"/>
			<states>
				<state name="clickable">
					<onStateEnter><action target="Scene" name="ShowLayer" param="IDCard"/></onStateEnter>
					
					<onMouseOver>
						<action target="Scene" name="SetCursor" param="interactive"/>
					</onMouseOver>
					
					<onClick>
						<action target="Scene" name="AddToInventory" param="IDCard"/>
						<action target="IDCard" name="SetState" param="acquired"/>
						<action target="Scene" name="PlaySound" param="Item_Pickup_Metal_small"/>
					</onClick>
				</state>
				
				<state name="acquired">
					<onStateEnter><action target="Scene" name="HideLayer" param="IDCard"/></onStateEnter>
				</state>
			</states>
		</object>

		<object name="MagneticCard">
			<clickStrategy type="alpha" layer="MagneticCard"/>
			<states>
				<state name="clickable">
					<onStateEnter><action target="Scene" name="ShowLayer" param="MagneticCard"/></onStateEnter>
					
					<onMouseOver>
						<action target="Scene" name="SetCursor" param="zoom"/>
					</onMouseOver>					
					
					<onClick>
						<action target="Scene" name="OpenWindow" param="MagneticCardWindow"/>
						<action target="Scene" name="ShowDialog" param="card_click"/>
					</onClick>
					
					<onUseObject name="Blowpipe">
						<action target="Scene" name="ShowDialog" param="empty_blowpipe"/>
					</onUseObject>
					
					<onUseObject name="LoadedBlowpipe">
						<action target="Scene" name="OpenWindow" param="MagneticCardWindow"/>
						<action target="Scene" name="RemoveFromInventory" param="LoadedBlowpipe"/>
						<action target="Scene" name="AddToInventory" param="MagneticCard"/>
						<action target="MagneticCard" name="SetState" param="acquired"/>
						<action target="Scene" name="PlaySound" param="Item_Pickup_Metal_small"/>
						<action target="Scene" name="PlaySound" param="blowpipe_shot"/>
						<action target="Scene" name="PlaySound" param="magnetic_card_fall"/>
					</onUseObject>
				</state>
				
				<state name="acquired">
					<onStateEnter>
						<action target="Scene" name="CloseWindow" param="MagneticCardWindow" delay="60"/>
						<action target="Scene" name="HideLayer" param="MagneticCard"/>
					</onStateEnter>
					<!--
					<onMouseOver>
						<action target="Scene" name="SetCursor" param="zoom"/>
					</onMouseOver>					
					
					<onClick>
						<action target="Scene" name="OpenWindow" param="MagneticCardWindow"/>
					</onClick>					
					-->
				</state>
			</states>
		</object>
		
		<object name="Paperclips">
			<clickStrategy type="alpha" layer="Clips"/>
			<states>
				<state name="clickable">
					<onStateEnter>
						<action target="Scene" name="ShowLayer" param="Clips"/>
					</onStateEnter>
					
					<onMouseOver>
						<action target="Scene" name="SetCursor" param="interactive"/>
					</onMouseOver>					
					
					<onClick>
						<action target="Paperclips" name="SetState" param="acquired"/>
						<action target="Scene" name="AddToInventory" param="Paperclips"/>
					</onClick>
				</state>
				
				<state name="acquired">
					<onStateEnter>
						<action target="Scene" name="HideLayer" param="Clips"/>
					</onStateEnter>
				</state>
			</states>
		</object>
		
		<object name="CardReader">
			<clickStrategy type="rect" left="470" top="290" right="500" bottom="336"/>
			<states>
				<state name="broken">
					<onMouseOver>
						<action target="Scene" name="SetCursor" param="zoom"/>
					</onMouseOver>
					
					<onClick>
						<action target="Scene" name="OpenWindow" param="CardReaderWindow"/>
						<action target="Scene" name="ShowDialog" param="cardreader_click"/>
					</onClick>
				</state>
				
				<state name="waitForCard">
					<onStateEnter>
						<action target="Scene" name="PlaySound" param="cable_connect1"/>
					</onStateEnter>
					
					<onMouseOver>
						<action target="Scene" name="SetCursor" param="zoom"/>
					</onMouseOver>					
					
					<onClick><action target="Scene" name="OpenWindow" param="CardReaderWindow"/></onClick>
					<onUseObject name="MagneticCard">
						<action target="Scene" name="RemoveFromInventory" param="MagneticCard"/>
						<action target="Scene" name="OpenWindow" param="CardReaderWindow"/>
						<action target="CardReader" name="SetState" param="enterCode"/>
					</onUseObject>					
				</state>
				
				<state name="enterCode">
					<onMouseOver>
						<action target="Scene" name="SetCursor" param="zoom"/>
					</onMouseOver>
					
					<onClick><action target="Scene" name="OpenWindow" param="CardReaderWindow"/></onClick>
					
					<onEvent name="accessGranted">
						<action target="CardReader" name="SetState" param="unlocked"/>
						<action target="Door" name="SetState" param="open"/>
						<action target="Scene" name="PlaySound" param="door_unlock"/>						
					</onEvent>
				</state>
				
				<state name="unlocked">
					<onStateEnter>
						<action target="Scene" name="CloseWindow" param="CardReaderWindow" delay="60"/>
					</onStateEnter>
				</state>
			</states>
		</object>
		
		<object name="Door">
			<clickStrategy type="rect" left="310" top="175" right="440" bottom="450"/>
			<states>
				<state name="locked">
					<onStateEnter>
						<action target="Scene" name="HideLayer" param="OpenDoor"/>
					</onStateEnter>
					
					<onMouseOver>
						<action target="Scene" name="SetCursor" param="noExit"/>
					</onMouseOver>
					
					<onClick>
						<action target="Scene" name="ShowDialog" param="door_click"/>
					</onClick>
				</state>
				
				<state name="open">
					<onStateEnter>
						<action target="Scene" name="ShowLayer" param="OpenDoor"/>
					</onStateEnter>
					
					<onMouseOver>
						<action target="Scene" name="SetCursor" param="exit"/>
					</onMouseOver>
					
					<onClick>
						<action target="Scene" name="RegisterVictoryCondition" param=""/>						
					</onClick>
				</state>
			</states>
		</object>
	</objects>
</scene>

