<scene name="Room37" numVictoryConditions="1">
	<inventory>
		<object name="PrintedPaper" memberName="HUD_printedPaper" acquired="1" visible="1"/>
		<object name="Fuse" memberName="HUD_fuse" acquired="0" visible="1"/>
	</inventory>
	
	<zoomWindows>
		<zoomWindow name="ScannerWindow" file="ZoomWindows\Room37_ScannerWindow.dir" x="330" y="300" visible="0"/>
		<zoomWindow name="ChartWindow" file="ZoomWindows\Room37_ChartWindow.dir" x="330" y="300" visible="0"/>
		<zoomWindow name="ComputerWindow" file="ZoomWindows\Room37_ComputerWindow.dir" x="330" y="300" visible="0"/>
	</zoomWindows>
	
	<animations>
		<animation name="GrateAnim" type="once" xpos="330" ypos="300" zpos="22">
			<frames>
				<frame memberName="grate12_anim" frameDelay="150"/>
				<frame memberName="grate11_anim" frameDelay="150"/>
				<frame memberName="grate10_anim" frameDelay="150"/>
				<frame memberName="grate9_anim" frameDelay="150"/>
				<frame memberName="grate8_anim" frameDelay="150"/>
				<frame memberName="grate7_anim" frameDelay="150"/>
				<frame memberName="grate6_anim" frameDelay="150"/>
				<frame memberName="grate5_anim" frameDelay="150"/>
				<frame memberName="grate4_anim" frameDelay="150"/>
				<frame memberName="grate3_anim" frameDelay="150"/>
				<frame memberName="grate2_anim" frameDelay="150"/>
				<frame memberName="grate1_anim" frameDelay="150"/>				
			</frames>
		</animation>
	</animations>
	
	<objects>
		<object name="Fuse">
			<clickStrategy type="alpha" layer="Fuse2"/>
			<states>
				<state name="clickable">
					<onStateEnter>
						<action target="Scene" name="ShowLayer" param="Fuse2"/>
						<action target="Scene" name="PlaySound" param="indoor_small"/>
						<action target="Scene" name="PlaySound" param="traffic"/>
						<action target="Scene" name="PlaySound" param="circuit2"/>
					</onStateEnter>
					
					<onMouseOver>
						<action target="Scene" name="SetCursor" param="interactive"/>
					</onMouseOver>
					
					<onClick>
						<action target="Scene" name="AddToInventory" param="Fuse"/>
						<action target="Fuse" 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="Fuse2"/>
					</onStateEnter>
				</state>
			</states>
		</object>
		
		<object name="Fusebox">
			<clickStrategy type="alpha" layer="OpenFuseBox"/>
			<states>
				<state name="closed">
					<onStateEnter>
						<action target="Scene" name="HideLayer" param="OpenFuseBox"/>
						<action target="Scene" name="HideLayer" param="FixedFuseBox"/>
					</onStateEnter>
					
					<onMouseOver>
						<action target="Scene" name="SetCursor" param="interactive"/>
					</onMouseOver>
					
					<onClick>
						<action target="Fusebox" name="SetState" param="open"/>
						<action target="Scene" name="ShowDialog" param="fuse_box_click"/>
					</onClick>
				</state>
				
				<state name="open">
					<onStateEnter>
						<action target="Scene" name="ShowLayer" param="OpenFuseBox"/>
						<action target="Scene" name="HideLayer" param="FixedFuseBox"/>
					</onStateEnter>
					
					<onMouseOver>
						<action target="Scene" name="SetCursor" param="interactive"/>
					</onMouseOver>
					
					<onUseObject name="Fuse">
						<action target="Scene" name="RemoveFromInventory" param="Fuse"/>
						<action target="Fusebox" name="SetState" param="fixed"/>
						<action target="Scanner" name="SendEvent" param="powerOn"/>
						<action target="Computer" name="SendEvent" param="powerOn"/>
						<action target="Scene" name="PlaySound" param="use_the_fuse_in_fusebox"/>
					</onUseObject>
				</state>
				
				<state name="fixed">
					<onStateEnter>
						<action target="Scene" name="HideLayer" param="OpenFuseBox"/>
						<action target="Scene" name="ShowLayer" param="FixedFuseBox"/>
					</onStateEnter>
				</state>
			</states>
		</object>
		
		<object name="Computer">
			<clickStrategy type="rect" left="28" top="304" right="70" bottom="338"/>
			<states>
				<state name="noPower">
					<onEvent name="powerOn">
						<action target="Computer" name="SetState" param="idle"/>
					</onEvent>
					
					<onMouseOver>
						<action target="Scene" name="SetCursor" param="zoom"/>
					</onMouseOver>						
					
					<onClick>
						<action target="Scene" name="OpenWindow" param="ComputerWindow"/>
						<action target="Scene" name="ShowDialog" param="computer_click"/>
					</onClick>
				</state>
				
				<state name="idle">
					<onMouseOver>
						<action target="Scene" name="SetCursor" param="zoom"/>
					</onMouseOver>
					
					<onClick>
						<action target="Scene" name="OpenWindow" param="ComputerWindow"/>
						<action target="Scene" name="ShowDialog" param="view_login"/>
					</onClick>
					
					<onEvent name="nameSelected">
						<action target="Computer" name="SetState" param="complete"/>
						<action target="Scanner" name="SendEvent" param="nameSelected"/>
					</onEvent>
				</state>
				
				<state name="complete">
					
				</state>
			</states>			
		</object>
		
		<object name="Scanner">
			<!--<clickStrategy type="alpha" layer="OpenScanner"/>-->
			<clickStrategy type="rect" left="58" top="340" right="104" bottom="354"/>
			<states>
				<state name="noPower">
					<onStateEnter>
						<action target="Scene" name="HideLayer" param="OpenScanner"/>
					</onStateEnter>
					
					<onMouseOver>
						<action target="Scene" name="SetCursor" param="zoom"/>
					</onMouseOver>
					
					<onClick>
						<action target="Scene" name="OpenWindow" param="ScannerWindow"/>
						<action target="Scene" name="ShowDialog" param="scanner_click"/>
					</onClick>
					
					<onEvent name="powerOn">
						<action target="Scanner" name="SetState" param="useless"/>
					</onEvent>
				</state>
				
				<state name="useless">
					<onStateEnter>
						<action target="Scene" name="HideLayer" param="OpenScanner"/>
					</onStateEnter>
					
					<onMouseOver>
						<action target="Scene" name="SetCursor" param="zoom"/>
					</onMouseOver>
					
					<onClick>
						<action target="Scene" name="ShowDialog" param="view_scanner"/>
						<action target="Scene" name="OpenWindow" param="ScannerWindow"/>
					</onClick>
					
					<onEvent name="nameSelected">
						<action target="Scanner" name="SetState" param="idle"/>
					</onEvent>
				</state>
				
				<state name="idle">
					<onStateEnter>
						<action target="Scene" name="HideLayer" param="OpenScanner"/>
					</onStateEnter>
					
					<onMouseOver>
						<action target="Scene" name="SetCursor" param="zoom"/>
					</onMouseOver>
					
					<onClick>
						<action target="Scene" name="OpenWindow" param="ScannerWindow"/>
						<action target="Scanner" name="SetState" param="open"/>
					</onClick>
				</state>
				
				<state name="open">
					<onStateEnter>
						<action target="Scene" name="ShowLayer" param="OpenScanner"/>
					</onStateEnter>
					
					<onMouseOver>
						<action target="Scene" name="SetCursor" param="zoom"/>
					</onMouseOver>
					
					<onClick>
						<action target="Scene" name="OpenWindow" param="ScannerWindow"/>
					</onClick>
					
					<onUseObject name="PrintedPaper">
						<action target="Scene" name="RemoveFromInventory" param="PrintedPaper"/>
						<action target="Scanner" name="SetState" param="withPaper"/>
					</onUseObject>
				</state>
				
				<state name="withPaper">
					<onStateEnter>
						<action target="Scene" name="HideLayer" param="OpenScanner"/>
					</onStateEnter>
					
					<onMouseOver>
						<action target="Scene" name="SetCursor" param="zoom"/>
					</onMouseOver>
					
					<onClick>
						<action target="Scene" name="OpenWindow" param="ScannerWindow"/>
					</onClick>

					<onEvent name="scanComplete">
						<action target="Door" name="SendEvent" param="unlockDoor"/>
					</onEvent>
				</state>
			</states>
		</object>
		<!--
		<object name="Door">
			<clickStrategy type="alpha" layer="OpenDoor"/>
			<states>
				<state name="locked">
					<onStateEnter>
						<action target="Scene" name="HideLayer" param="OpenDoor"/>
					</onStateEnter>
					
					<onMouseEnter>
						<action target="Scene" name="SetCursor" param="noExit"/>
					</onMouseEnter>
					
					<onClick>
						<action target="Scene" name="ShowDialog" param="door_click"/>
					</onClick>
					
					<onEvent name="unlock">
						<action target="Door" name="SetState" param="unlocked"/>
					</onEvent>
				</state>
				
				<state name="unlocked">
					<onStateEnter>
						<action target="Scene" name="ShowLayer" param="OpenDoor"/>
						<action target="Scene" name="PlaySound" param="door_unlock"/>
					</onStateEnter>
					
					<onMouseEnter>
						<action target="Scene" name="SetCursor" param="exit"/>
					</onMouseEnter>
					
					<onClick>
						<action target="Scene" name="RegisterVictoryCondition" param=""/>
					</onClick>
				</state>
			</states>
		</object>
		-->
		
		<object name="Door">
			<clickStrategy type="alpha" layer="OpenDoor"/>
			<states>
				<state name="secured">
					<onStateEnter>
						<action target="Scene" name="StartAnimation" param="GrateAnim"/>
						<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>
					
					<onEvent name="unlockDoor">
						<action target="Door" name="SetState" param="unlocked"/>
					</onEvent>
					
					<onEvent name="grateDown">
						<action target="Door" name="SetState" param="secured_grateDown"/>
					</onEvent>
				</state>
				
				<state name="secured_grateDown">
					<onMouseOver>
						<action target="Scene" name="SetCursor" param="noExit"/>
					</onMouseOver>
					
					<onClick>
						<action target="Scene" name="ShowDialog" param="door_click"/>
					</onClick>
					
					<onEvent name="unlockDoor">
						<action target="Door" name="SetState" param="unlocked_grateDown"/>
					</onEvent>
					
					<onEvent name="grateRaised">
						<action target="Door" name="SetState" param="secured"/>
					</onEvent>
				</state>
				
				<state name="unlocked">
					<onStateEnter>
						<action target="Scene" name="StopAnimation" param="GrateAnim"/>
						<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>
					
					<onEvent name="grateDown">
						<action target="Door" name="SetState" param="unlocked_grateDown"/>
					</onEvent>
				</state>
				
				<state name="unlocked_grateDown">
					<onMouseOver>
						<action target="Scene" name="SetCursor" param="noExit"/>
					</onMouseOver>
					
					<onEvent name="grateRaised">
						<action target="Door" name="SetState" param="unlocked"/>
					</onEvent>
				</state>
			</states>
		</object>
		
		<object name="LightLevel1">
			<states>
				<state name="off">
					<onStateEnter>
						<action target="Scene" name="ShowLayer" param="LightLevel1"/>						
					</onStateEnter>
				</state>
				
				<state name="on">
					<onStateEnter>
						<action target="Scene" name="HideLayer" param="LightLevel1"/>						
					</onStateEnter>
				</state>				
			</states>
		</object>
		
		<object name="LightLevel2">
			<states>
				<state name="off">
					<onStateEnter>
						<action target="Scene" name="ShowLayer" param="LightLevel2"/>						
					</onStateEnter>
				</state>
				
				<state name="on">
					<onStateEnter>
						<action target="Scene" name="HideLayer" param="LightLevel2"/>						
					</onStateEnter>
				</state>
			</states>
		</object>
	</objects>
</scene>

