<scene name="Room19" numVictoryConditions="1">
	<inventory>
		<object name="Pole" memberName="HUD_pole" acquired="0" visible="1">
			<onUseObject name="Mirror">
				<action target="Scene" name="RemoveFromInventory" param="Pole"/>
				<action target="Scene" name="RemoveFromInventory" param="Mirror"/>
				<action target="Scene" name="AddToInventory" param="PoleAndMirror"/>
				<action target="Scene" name="PlaySound" param="attach_mirror_to_pole"/>
			</onUseObject>
		</object>
		<object name="Mirror" memberName="HUD_mirror" acquired="0" visible="1">
			<onUseObject name="Pole">
				<action target="Scene" name="RemoveFromInventory" param="Pole"/>
				<action target="Scene" name="RemoveFromInventory" param="Mirror"/>
				<action target="Scene" name="AddToInventory" param="PoleAndMirror"/>
				<action target="Scene" name="PlaySound" param="attach_mirror_to_pole"/>
			</onUseObject>
		</object>
		<object name="Cable" memberName="HUD_cable" acquired="0" visible="1"/>
		<object name="Sticker" memberName="HUD_sticker" acquired="0" visible="1">
			<onUseObject name="PoleAndMirror">
				<action target="Scene" name="RemoveFromInventory" param="Sticker"/>
				<action target="Scene" name="RemoveFromInventory" param="PoleAndMirror"/>
				<action target="Scene" name="AddToInventory" param="PoleMirrorSticker"/>
			</onUseObject>
		</object>
		<object name="PoleAndMirror" memberName="HUD_poleAndMirror" acquired="0" visible="0">
			<onUseObject name="Sticker">
				<action target="Scene" name="RemoveFromInventory" param="Sticker"/>
				<action target="Scene" name="RemoveFromInventory" param="PoleAndMirror"/>
				<action target="Scene" name="AddToInventory" param="PoleMirrorSticker"/>
			</onUseObject>
		</object>
		<object name="PoleMirrorSticker" memberName="HUD_poleMirrorSticker" acquired="0" visible="0"/>
	</inventory>
	
	<finalStates>
		<finalState objName="Pole" state="acquired"/>
		<finalState objName="Bag" state="noMirror"/>
		<finalState objName="Cable" state="acquired"/>
		<finalState objName="MachinePlug" state="withCable"/>
		<finalState objName="Machine" state="gameComplete"/>
		<finalState objName="Sticker" state="acquired"/>
		<finalState objName="Numbers" state="idle"/>
		<finalState objName="OpenDoor" state="open"/>
	</finalStates>
	
	<zoomWindows>
		<zoomWindow name="BagWindow" file="ZoomWindows\Room19_BagWindow.dir" x="280" y="462" visible="0"/>
		<zoomWindow name="MachinePlugWindow" file="ZoomWindows\Room19_MachinePlugWindow.dir" x="150" y="460" visible="0"/>
		<zoomWindow name="MachineWindow" file="ZoomWindows\Room19_MachineWindow.dir" x="230" y="310" visible="0"/>
		<zoomWindow name="NumbersWindow" file="ZoomWindows\Room19_NumbersWindow.dir" x="500" y="165" visible="0"/>
	</zoomWindows>
	
	<objects>
		<object name="Pole">
			<clickStrategy type="alpha" layer="Pole"/>
			<states>
				<state name="clickable">
					<onStateEnter>
						<action target="Scene" name="HideLayer" param="Pole"/>
						<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="Pole"/>
						<action target="Pole" name="SetState" param="acquired"/>
						<action target="Scene" name="PlaySound" param="Item_Pickup_Wood_big"/>
					</onClick>
				</state>
				
				<state name="acquired">
					<onStateEnter><action target="Scene" name="ShowLayer" param="Pole"/></onStateEnter>
				</state>
			</states>
		</object>
		
		<object name="Bag">
			<clickStrategy type="alpha" layer="OpenBag"/>
			<states>
				<state name="closed">
					<onStateEnter>
						<action target="Scene" name="HideLayer" param="OpenBagWithMirror"/>
						<action target="Scene" name="HideLayer" param="OpenBag"/>
					</onStateEnter>
					
					<onMouseOver>
						<action target="Scene" name="SetCursor" param="zoom"/>
					</onMouseOver>					
					
					<onClick>
						<action target="Scene" name="OpenWindow" param="BagWindow"/>
						<action target="Bag" name="SetState" param="open"/>
					</onClick>
				</state>
				
				<state name="open">
					<onStateEnter>
						<action target="Scene" name="ShowLayer" param="OpenBagWithMirror"/>
						<action target="Scene" name="HideLayer" param="OpenBag"/>
					</onStateEnter>
					
					<onMouseOver>
						<action target="Scene" name="SetCursor" param="zoom"/>
					</onMouseOver>					
					
					<onClick><action target="Scene" name="OpenWindow" param="BagWindow"/></onClick>
				</state>
				
				<state name="noMirror">
					<onStateEnter>
						<action target="Scene" name="CloseWindow" param="BagWindow" delay="60"/>
						<action target="Scene" name="HideLayer" param="OpenBagWithMirror"/>
						<action target="Scene" name="ShowLayer" param="OpenBag"/>
						<action target="Scene" name="PlaySound" param="take_the_mirror"/>
					</onStateEnter>
				</state>
			</states>
		</object>
		
		<object name="Cable">
			<clickStrategy type="alpha" layer="Cable"/>
			<states>
				<state name="clickable">
					<onStateEnter><action target="Scene" name="HideLayer" param="Cable"/></onStateEnter>
					
					<onMouseOver>
						<action target="Scene" name="SetCursor" param="interactive"/>
					</onMouseOver>					
					
					<onClick>
						<action target="Scene" name="AddToInventory" param="Cable"/>
						<action target="Cable" name="SetState" param="acquired"/>
						<action target="Scene" name="PlaySound" param="take_the_cable"/>
					</onClick>
				</state>
				
				<state name="acquired">
					<onStateEnter><action target="Scene" name="ShowLayer" param="Cable"/></onStateEnter>
				</state>
			</states>
		</object>
		
		<object name="MachinePlug">
			<clickStrategy type="alpha" layer="MachinePlug"/>
			<states>
				<state name="noCable">
					<onStateEnter><action target="Scene" name="HideLayer" param="MachinePlug"/></onStateEnter>
					
					<onMouseOver>
						<action target="Scene" name="SetCursor" param="zoom"/>
					</onMouseOver>
					
					<onClick><action target="Scene" name="OpenWindow" param="MachinePlugWindow"/></onClick>
					
					<onUseObject name="Cable">
						<action target="Scene" name="OpenWindow" param="MachinePlugWindow"/>
						<action target="Scene" name="RemoveFromInventory" param="Cable"/>
						<action target="MachinePlug" name="SetState" param="withCable"/>
						<action target="Machine" name="SetState" param="on"/>
						<action target="Scene" name="PlaySound" param="plug_the_cable"/>
					</onUseObject>
				</state>
				
				<state name="withCable">
					<onStateEnter>
						<action target="Scene" name="CloseWindow" param="MachinePlugWindow" delay="60"/>
						<action target="Scene" name="ShowLayer" param="MachinePlug"/>
					</onStateEnter>
				</state>
			</states>
		</object>
		
		<object name="Machine">
			<clickStrategy type="rect" left="150" top="220" right="300" bottom="390"/>			
			<states>
				<state name="off">
					<onStateEnter>
						<action target="Scene" name="HideLayer" param="MachineOn"/>
						<action target="Scene" name="HideLayer" param="WhiteScreen"/>
						<action target="Scene" name="HideLayer" param="MachineScreen"/>
						<action target="Scene" name="ShowLayer" param="BlackScreen"/>
					</onStateEnter>
					
					<onMouseOver>
						<action target="Scene" name="SetCursor" param="zoom"/>
					</onMouseOver>
					
					<onClick>
						<action target="Scene" name="OpenWindow" param="MachineWindow"/>
						<action target="Scene" name="ShowDialog" param="click_machine"/>
					</onClick>
				</state>
				
				<state name="on">
					<onStateEnter>
						<action target="Scene" name="ShowLayer" param="MachineOn"/>
						<action target="Scene" name="HideLayer" param="WhiteScreen"/>
						<action target="Scene" name="ShowLayer" param="MachineScreen"/>
						<action target="Scene" name="HideLayer" param="BlackScreen"/>
					</onStateEnter>
					
					<onMouseOver>
						<action target="Scene" name="SetCursor" param="zoom"/>
					</onMouseOver>
					
					<onClick>
						<action target="Scene" name="OpenWindow" param="MachineWindow"/>
						<action target="Scene" name="ShowDialog" param="zoom_machine"/>
					</onClick>
					
					<onEvent name="gameComplete">
						<action target="Machine" name="SetState" param="gameComplete"/>
						<action target="Sticker" name="SetState" param="visible"/>
					</onEvent>
				</state>
				
				<state name="gameComplete">
					<onStateEnter>
						<action target="Scene" name="CloseWindow" param="MachineWindow" delay="60"/>
						<action target="Scene" name="ShowLayer" param="MachineOn"/>
						<action target="Scene" name="HideLayer" param="WhiteScreen"/>
						<action target="Scene" name="ShowLayer" param="MachineScreen"/>
						<action target="Scene" name="HideLayer" param="BlackScreen"/>
						<action target="Scene" name="PlaySound" param="QOM_win_item_sound"/>
					</onStateEnter>
				</state>
			</states>
		</object>
		
		<object name="Sticker">
			<clickStrategy type="alpha" layer="Sticker"/>
			<states>
				<state name="invisible">
					<onStateEnter><action target="Scene" name="HideLayer" param="Sticker"/></onStateEnter>
				</state>
				
				<state name="visible">
					<onStateEnter><action target="Scene" name="ShowLayer" param="Sticker"/></onStateEnter>
					
					<onMouseOver>
						<action target="Scene" name="SetCursor" param="interactive"/>
					</onMouseOver>					
					
					<onClick>
						<action target="Scene" name="AddToInventory" param="Sticker"/>
						<action target="Sticker" name="SetState" param="acquired"/>
					</onClick>
				</state>
				
				<state name="acquired">
					<onStateEnter><action target="Scene" name="HideLayer" param="Sticker"/></onStateEnter>
				</state>
			</states>
		</object>
		
		<object name="Numbers">
			<clickStrategy type="rect" left="440" top="110" right="580" bottom="190"/>
			<states>
				<state name="idle">
					<onMouseOver>
						<action target="Scene" name="SetCursor" param="interactive"/>
					</onMouseOver>
					
					<onClick>
						<action target="Scene" name="ShowDialog" param="click_ventilation"/>
					</onClick>
					
					<onUseObject name="PoleMirrorSticker">
						<action target="Scene" name="OpenWindow" param="NumbersWindow"/>
						<action target="OpenDoor" name="SetState" param="open"/>
					</onUseObject>
				</state>
			</states>
		</object>
		
		<object name="OpenDoor">
			<clickStrategy type="alpha" layer="OpenDoor"/>
			<states>
				<state name="closed">
					<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="click_door"/>
					</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>
