<scene name="Room16" numVictoryConditions="1">
	<inventory>
		<object name="Keys" memberName="HUD_keys" acquired="0" visible="1"/>
		<object name="Hammer" memberName="HUD_hammer" acquired="0" visible="1"/>
		<object name="Chair" memberName="HUD_chair" acquired="0" visible="1"/>
		<object name="Board" memberName="HUD_board" acquired="0" visible="1"/>
		<object name="Pole1" memberName="HUD_pole1" acquired="0" visible="1"/>
		<object name="Pole2" memberName="HUD_pole2" acquired="0" visible="1"/>		
	</inventory>
	
	<finalStates>
		<finalState objName="Keys" state="acquired"/>
		<finalState objName="HammerCase" state="noHammer"/>
		<finalState objName="Chair" state="acquired"/>
		<finalState objName="Pedestal2" state="withChair"/>
		<finalState objName="Pedestal1" state="JustToHideTheLayer"/>
		<finalState objName="Pole1" state="acquired"/>
		<finalState objName="Pole2" state="noPole"/>
		<finalState objName="Board" state="acquired"/>
		<finalState objName="EndOfHall" state="withPole2"/>
	</finalStates>
	
	<zoomWindows>
		<zoomWindow name="HammerCaseWindow" file="ZoomWindows\Room16_HammerCaseWindow.dir" x="610" y="380" visible="0"/>
		<!--<zoomWindow name="Pedestal1Window" file="ZoomWindows\Room16_Pedestal1Window.dir" x="260" y="380" visible="0"/>-->
		<zoomWindow name="Pedestal2Window" file="ZoomWindows\Room16_Pedestal2Window.dir" x="395" y="280" visible="0"/>
		<zoomWindow name="Pole2Window" file="ZoomWindows\Room16_Pole2Window.dir" x="426" y="210" visible="0"/>
		<zoomWindow name="EndOfHallWindow" file="ZoomWindows\Room16_EndOfHallWindow.dir" x="460" y="330" visible="0"/>
	</zoomWindows>
	
	<objects>
		<object name="Keys">
			<clickStrategy type="alpha" layer="Keys"/>
			<states>
				<state name="clickable">
					<onStateEnter>
						<action target="Scene" name="HideLayer" param="Keys"/>
						<action target="Scene" name="PlaySound" param="indoor_big"/>
					</onStateEnter>
					
					<onMouseOver>
						<action target="Scene" name="SetCursor" param="interactive"/>
					</onMouseOver>					
					
					<onClick>
						<action target="Scene" name="AddToInventory" param="Keys"/>
						<action target="Keys" name="SetState" param="acquired"/>
						<action target="Scene" name="PlaySound" param="take_the_key3"/>
					</onClick>
				</state>
				
				<state name="acquired">
					<onStateEnter><action target="Scene" name="ShowLayer" param="Keys"/></onStateEnter>
				</state>
			</states>
		</object>
		
		<object name="HammerCase">
			<clickStrategy type="alpha" layer="HammerCase"/>
			<states>
				<state name="locked">
					<onStateEnter><action target="Scene" name="HideLayer" param="HammerCase"/></onStateEnter>
					
					<onMouseOver>
						<action target="Scene" name="SetCursor" param="zoom"/>
					</onMouseOver>
					
					<onClick>
						<action target="Scene" name="OpenWindow" param="HammerCaseWindow"/>
						<action target="Scene" name="ShowDialog" param="need_a_key"/>						
					</onClick>
					
					<onUseObject name="Keys">
						<action target="Scene" name="OpenWindow" param="HammerCaseWindow"/>
						<action target="Scene" name="RemoveFromInventory" param="Keys"/>
						<action target="HammerCase" name="SetState" param="open"/>
						<action target="Scene" name="PlaySound" param="showcase1_open"/>
					</onUseObject>
				</state>
				
				<state name="open">
					<onStateEnter><action target="Scene" name="ShowLayer" param="HammerCase"/></onStateEnter>
					
					<onMouseOver>
						<action target="Scene" name="SetCursor" param="zoom"/>
					</onMouseOver>
					
					<onClick><action target="Scene" name="OpenWindow" param="HammerCaseWindow"/></onClick>
				</state>
				
				<state name="noHammer">
					<onStateEnter>
						<action target="Scene" name="CloseWindow" param="HammerCaseWindow" delay="60"/>
						<action target="Scene" name="ShowLayer" param="HammerCase"/>
						<action target="Scene" name="PlaySound" param="Item_Pickup_Metal_small"/>
					</onStateEnter>
				</state>
			</states>
		</object>
		
		<object name="Chair">
			<clickStrategy type="alpha" layer="Chair"/>
			<states>
				<state name="clickable">
					<onStateEnter><action target="Scene" name="HideLayer" param="Chair"/></onStateEnter>
					
					<onMouseOver>
						<action target="Scene" name="SetCursor" param="interactive"/>
					</onMouseOver>					
					
					<onClick>
						<action target="Scene" name="AddToInventory" param="Chair"/>
						<action target="Chair" 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="Chair"/></onStateEnter>
				</state>
			</states>
		</object>
		
		<object name="Pedestal2">
			<clickStrategy type="alpha" layer="ChairOnPedestal2"/>
			<states>
				<state name="withStatue">
					<onStateEnter>
						<action target="Scene" name="HideLayer" param="HeadOnPedestal"/>
						<action target="Scene" name="HideLayer" param="HeadOnGround"/>
						<action target="Scene" name="HideLayer" param="ChairOnPedestal2"/>
					</onStateEnter>
					
					<onMouseOver>
						<action target="Scene" name="SetCursor" param="zoom"/>
					</onMouseOver>					
					
					<onClick>
						<action target="Scene" name="OpenWindow" param="Pedestal2Window"/>
						<action target="Pedestal2" name="SetState" param="noStatue"/>
						<action target="Scene" name="PlaySound" param="drop_the_statue"/>
						<action target="Scene" name="ShowDialog" param="move_statue"/>
					</onClick>
				</state>
				
				<state name="noStatue">
					<onStateEnter>
						<action target="Scene" name="ShowLayer" param="HeadOnPedestal"/>
						<action target="Scene" name="ShowLayer" param="HeadOnGround"/>
						<action target="Scene" name="HideLayer" param="ChairOnPedestal2"/>
					</onStateEnter>
					
					<onMouseOver>
						<action target="Scene" name="SetCursor" param="zoom"/>
					</onMouseOver>					
					
					<onClick><action target="Scene" name="OpenWindow" param="Pedestal2Window"/></onClick>
					
					<onUseObject name="Chair">
						<action target="Scene" name="OpenWindow" param="Pedestal2Window"/>
						<action target="Scene" name="RemoveFromInventory" param="Chair"/>
						<action target="Pedestal2" name="SetState" param="withChair"/>
						<action target="Pole2" name="SendEvent" param="chairPlaced"/>
						<action target="Scene" name="PlaySound" param="place_chair"/>
					</onUseObject>					
				</state>
				
				<state name="withChair">
					<onStateEnter>
						<action target="Scene" name="CloseWindow" param="Pedestal2Window" delay="60"/>
						<action target="Scene" name="ShowLayer" param="HeadOnPedestal"/>
						<action target="Scene" name="ShowLayer" param="HeadOnGround"/>
						<action target="Scene" name="ShowLayer" param="ChairOnPedestal2"/>
					</onStateEnter>
					<!--
					<onMouseOver>
						<action target="Scene" name="SetCursor" param="zoom"/>
					</onMouseOver>					
					
					<onClick>
						<action target="Scene" name="OpenWindow" param="Pedestal2Window"/>
						<action target="Scene" name="AddToInventory" param="Chair"/>
						<action target="Pedestal2" name="SetState" param="noChair"/>
						<action target="Pole2" name="SendEvent" param="chairRemoved"/>
					</onClick>
					-->
				</state>
				<!--
				<state name="noChair">
					<onStateEnter>
						<action target="Scene" name="ShowLayer" param="HeadOnPedestal"/>
						<action target="Scene" name="ShowLayer" param="HeadOnGround"/>
						<action target="Scene" name="HideLayer" param="ChairOnPedestal2"/>
					</onStateEnter>
					
					<onMouseOver>
						<action target="Scene" name="SetCursor" param="zoom"/>
					</onMouseOver>					
					
					<onClick><action target="Scene" name="OpenWindow" param="Pedestal2Window"/></onClick>
					
					<onUseObject name="Chair">
						<action target="Scene" name="OpenWindow" param="Pedestal2Window"/>
						<action target="Scene" name="RemoveFromInventory" param="Chair"/>
						<action target="Pedestal2" name="SetState" param="withChair"/>
						<action target="Pole2" name="SendEvent" param="chairPlaced"/>
						<action target="Scene" name="PlaySound" param="place_chair"/>
					</onUseObject>					
				</state>
				-->
			</states>
		</object>
		
		<object name="Pedestal1">
			<states>
				<state name="JustToHideTheLayer">
					<onStateEnter><action target="Scene" name="HideLayer" param="ChairOnPedestal1"/></onStateEnter>
				</state>
			</states>
		</object>
		
		<object name="Pole1">
			<clickStrategy type="alpha" layer="Pole3"/>
			<states>
				<state name="clickable">
					<onStateEnter><action target="Scene" name="HideLayer" param="Pole3"/></onStateEnter>
					
					<onMouseOver>
						<action target="Scene" name="SetCursor" param="interactive"/>
					</onMouseOver>					
					
					<onClick>
						<action target="Scene" name="AddToInventory" param="Pole1"/>
						<action target="Pole1" 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="Pole3"/></onStateEnter>
				</state>
			</states>
		</object>
		
		<object name="Pole2">
			<clickStrategy type="alpha" layer="Pole2"/>
			<states>
				<state name="outOfReach">
					<onStateEnter><action target="Scene" name="HideLayer" param="Pole2"/></onStateEnter>
					
					<onMouseOver>
						<action target="Scene" name="SetCursor" param="interactive"/>
					</onMouseOver>	
					
					<onClick><action target="Scene" name="ShowDialog" param="cant_reach"/></onClick>
					
					<onEvent name="chairPlaced">
						<action target="Pole2" name="SetState" param="inReach"/>
					</onEvent>					
				</state>
				
				<state name="inReach">
					<onStateEnter><action target="Scene" name="HideLayer" param="Pole2"/></onStateEnter>
					
					<onEvent name="chairRemoved">
						<action target="Pole2" name="SetState" param="outOfReach"/>
					</onEvent>
					
					<onMouseOver>
						<action target="Scene" name="SetCursor" param="zoom"/>
					</onMouseOver>					
					
					<onClick>
						<action target="Scene" name="OpenWindow" param="Pole2Window"/>
						<action target="Scene" name="ShowDialog" param="need_hammer"/>
					</onClick>
					
					<onUseObject name="Hammer">
						<action target="Scene" name="OpenWindow" param="Pole2Window"/>
						<action target="Scene" name="RemoveFromInventory" param="Hammer"/>
						<action target="Scene" name="AddToInventory" param="Pole2"/>
						<action target="Pole2" name="SetState" param="noPole"/>
						<action target="Scene" name="PlaySound" param="use_hammer"/>
					</onUseObject>
				</state>
				
				<state name="noPole">
					<onStateEnter>
						<action target="Scene" name="CloseWindow" param="Pole2Window" delay="60"/>
						<action target="Scene" name="ShowLayer" param="Pole2"/>
					</onStateEnter>
				</state>
			</states>
		</object>
		
		<object name="Board">
			<clickStrategy type="alpha" layer="Board"/>
			<states>
				<state name="clickable">
					<onStateEnter><action target="Scene" name="HideLayer" param="Board"/></onStateEnter>
					
					<onMouseOver>
						<action target="Scene" name="SetCursor" param="interactive"/>
					</onMouseOver>					
					
					<onClick>
						<action target="Scene" name="AddToInventory" param="Board"/>
						<action target="Board" name="SetState" param="acquired"/>
						<action target="Scene" name="PlaySound" param="take_the_wooden_board"/>
					</onClick>
				</state>
				
				<state name="acquired">
					<onStateEnter><action target="Scene" name="ShowLayer" param="Board"/></onStateEnter>
				</state>
			</states>
		</object>
		
		<object name="EndOfHall">
			<clickStrategy type="rect" left="410" top="260" right="520" bottom="380"/>
			<states>
				<state name="noObjects">
					<onStateEnter>
						<action target="Scene" name="HideLayer" param="PlacedBoard"/>
						<action target="Scene" name="HideLayer" param="PlacedPole1"/>
						<action target="Scene" name="HideLayer" param="PlacedPole2"/>
						<action target="Scene" name="HideLayer" param="PlacedPole3"/>						
					</onStateEnter>
					
					<onMouseOver>
						<action target="Scene" name="SetCursor" param="zoom"/>
					</onMouseOver>					
					
					<onClick>
						<action target="Scene" name="OpenWindow" param="EndOfHallWindow"/>
						<action target="Scene" name="ShowDialog" param="dangerous_exit"/>
						<action target="EndOfHall" name="SetState" param="clicked"/>
					</onClick>
					
					<onUseObject name="Board">
						<action target="Scene" name="OpenWindow" param="EndOfHallWindow"/>
						<action target="Scene" name="RemoveFromInventory" param="Board"/>
						<action target="EndOfHall" name="SetState" param="withBoard"/>
					</onUseObject>
				</state>
				
				<state name="clicked">
					<onStateEnter>
						<action target="Scene" name="HideLayer" param="PlacedBoard"/>
						<action target="Scene" name="HideLayer" param="PlacedPole1"/>
						<action target="Scene" name="HideLayer" param="PlacedPole2"/>
						<action target="Scene" name="HideLayer" param="PlacedPole3"/>						
					</onStateEnter>
					
					<onMouseOver>
						<action target="Scene" name="SetCursor" param="zoom"/>
					</onMouseOver>					
					
					<onClick>
						<action target="Scene" name="OpenWindow" param="EndOfHallWindow"/>
						<action target="Scene" name="ShowDialog" param="dangerous_exit"/>
					</onClick>
					
					<onUseObject name="Pole1">
						<action target="Scene" name="ShowDialog" param="need_wood"/>
					</onUseObject>
					
					<onUseObject name="Pole2">
						<action target="Scene" name="ShowDialog" param="need_wood"/>
					</onUseObject>					
					
					<onUseObject name="Board">
						<action target="Scene" name="OpenWindow" param="EndOfHallWindow"/>
						<action target="Scene" name="RemoveFromInventory" param="Board"/>
						<action target="EndOfHall" name="SetState" param="withBoard"/>
					</onUseObject>
				</state>
				
				<state name="withBoard">
					<onStateEnter>
						<action target="Scene" name="ShowLayer" param="PlacedBoard"/>
						<action target="Scene" name="HideLayer" param="PlacedPole1"/>
						<action target="Scene" name="HideLayer" param="PlacedPole2"/>
						<action target="Scene" name="HideLayer" param="PlacedPole3"/>						
					</onStateEnter>
					
					<onMouseOver>
						<action target="Scene" name="SetCursor" param="zoom"/>
					</onMouseOver>					
					
					<onClick><action target="Scene" name="OpenWindow" param="EndOfHallWindow"/></onClick>
					
					<onUseObject name="Pole1">
						<action target="Scene" name="OpenWindow" param="EndOfHallWindow"/>
						<action target="Scene" name="RemoveFromInventory" param="Pole1"/>
						<action target="EndOfHall" name="SetState" param="withPole1"/>
					</onUseObject>
					
					<onUseObject name="Pole2">
						<action target="Scene" name="OpenWindow" param="EndOfHallWindow"/>
						<action target="Scene" name="RemoveFromInventory" param="Pole2"/>
						<action target="EndOfHall" name="SetState" param="withPole1"/>
					</onUseObject>
				</state>
				
				<state name="withPole1">
					<onStateEnter>
						<action target="Scene" name="ShowLayer" param="PlacedBoard"/>
						<action target="Scene" name="ShowLayer" param="PlacedPole1"/>
						<action target="Scene" name="HideLayer" param="PlacedPole2"/>
						<action target="Scene" name="HideLayer" param="PlacedPole3"/>						
					</onStateEnter>
					
					<onMouseOver>
						<action target="Scene" name="SetCursor" param="zoom"/>
					</onMouseOver>					
					
					<onClick><action target="Scene" name="OpenWindow" param="EndOfHallWindow"/></onClick>
					
					<onUseObject name="Pole1">
						<action target="Scene" name="OpenWindow" param="EndOfHallWindow"/>
						<action target="Scene" name="RemoveFromInventory" param="Pole1"/>
						<action target="EndOfHall" name="SetState" param="withPole2"/>						
					</onUseObject>
					
					<onUseObject name="Pole2">
						<action target="Scene" name="OpenWindow" param="EndOfHallWindow"/>
						<action target="Scene" name="RemoveFromInventory" param="Pole2"/>
						<action target="EndOfHall" name="SetState" param="withPole2"/>						
					</onUseObject>
				</state>
				
				<state name="withPole2">
					<onStateEnter>
						<action target="Scene" name="CloseWindow" param="EndOfHallWindow" delay="60"/>
						<action target="Scene" name="ShowLayer" param="PlacedBoard"/>
						<action target="Scene" name="ShowLayer" param="PlacedPole1"/>
						<action target="Scene" name="ShowLayer" param="PlacedPole2"/>
						<action target="Scene" name="HideLayer" param="PlacedPole3"/>						
					</onStateEnter>
					
					<onMouseOver>
						<action target="Scene" name="SetCursor" param="exit"/>
					</onMouseOver>					
					
					<onClick><action target="Scene" name="RegisterVictoryCondition" param=""/></onClick>
				</state>
			</states>
		</object>
		
		<!--		
		<object name="Pedestal1">
			<clickStrategy type="alpha" layer="ChairOnPedestal1"/>
			<states>
				<state name="noChair">
					<onStateEnter><action target="Scene" name="HideLayer" param="ChairOnPedestal1"/></onStateEnter>
					<onClick><action target="Scene" name="OpenWindow" param="Pedestal1Window"/></onClick>
					
					<onUseObject name="Chair">
						<action target="Scene" name="OpenWindow" param="Pedestal1Window"/>
						<action target="Scene" name="RemoveFromInventory" param="Chair"/>
						<action target="Pedestal1" name="SetState" param="withChair"/>
					</onUseObject>
				</state>
				
				<state name="withChair">
					<onStateEnter><action target="Scene" name="ShowLayer" param="ChairOnPedestal1"/></onStateEnter>
					
					<onClick>
						<action target="Scene" name="OpenWindow" param="Pedestal1Window"/>
						<action target="Scene" name="AddToInventory" param="Chair"/>
						<action target="Pedestal1" name="SetState" param="noChair"/>
					</onClick>
				</state>
			</states>
		</object>
		-->
	</objects>
</scene>
