<scene name="Room23" numVictoryConditions="1">
	<inventory>
		<object name="Extinguisher" memberName="HUD_extinguisher" acquired="0" visible="1">
			<onUseObject name="Valve">
				<action target="Scene" name="RemoveFromInventory" param="Extinguisher"/>
				<action target="Scene" name="RemoveFromInventory" param="Valve"/>
				<action target="Scene" name="AddToInventory" param="ExtinguisherAndValve"/>
				<action target="Scene" name="PlaySound" param="attach_valve_to_extinguisher"/>
			</onUseObject>
		</object>
		<object name="Valve" memberName="HUD_valve" acquired="0" visible="1">
			<onUseObject name="Extinguisher">
				<action target="Scene" name="RemoveFromInventory" param="Extinguisher"/>
				<action target="Scene" name="RemoveFromInventory" param="Valve"/>
				<action target="Scene" name="AddToInventory" param="ExtinguisherAndValve"/>
				<action target="Scene" name="PlaySound" param="attach_valve_to_extinguisher"/>
			</onUseObject>
		</object>
		<object name="Key" memberName="HUD_key" acquired="0" visible="1"/>
		<object name="Bag" memberName="HUD_bag" acquired="0" visible="1">
			<onUseObject name="Coins">
				<action target="Scene" name="RemoveFromInventory" param="Coins"/>
				<action target="Scene" name="RemoveFromInventory" param="Bag"/>
				<action target="Scene" name="AddToInventory" param="BagWithCoins"/>
			</onUseObject>
		</object>
		<object name="Coins" memberName="HUD_coins" acquired="0" visible="1">
			<onUseObject name="Bag">
				<action target="Scene" name="RemoveFromInventory" param="Coins"/>
				<action target="Scene" name="RemoveFromInventory" param="Bag"/>
				<action target="Scene" name="AddToInventory" param="BagWithCoins"/>
			</onUseObject>
		</object>		
		<object name="Statue" memberName="HUD_statue" acquired="0" visible="1"/>
		<object name="ExtinguisherAndValve" memberName="HUD_extinguisherAndValve" acquired="0" visible="0"/>		
		<object name="BagWithCoins" memberName="HUD_bag" acquired="0" visible="0"/>
	</inventory>
	
	<finalStates>
		<finalState objName="Extinguisher" state="acquired"/>
		<finalState objName="Valve" state="acquired"/>
		<finalState objName="Bag" state="acquired"/>
		<finalState objName="Coins" state="acquired"/>
		<finalState objName="HotPipe" state="hotNoKey"/>
		<finalState objName="Statue" state="acquired"/>
		<finalState objName="Door" state="unlocked"/>
	</finalStates>
	
	<zoomWindows>
		<zoomWindow name="PipeWindow" file="ZoomWindows\Room23_PipeWindow.dir" x="150" y="240" visible="0"/>
	</zoomWindows>
	
	<objects>
		<object name="Extinguisher">
			<clickStrategy type="rect" left="402" top="85" right="430" bottom="155"/>
			<states>
				<state name="clickable">
					<onStateEnter>
						<action target="Scene" name="HideLayer" param="Extinguisher"/>
						<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="Extinguisher"/>
						<action target="Extinguisher" name="SetState" param="acquired"/>
						<action target="Scene" name="PlaySound" param="pick_up_fire_extinguisher"/>
						<action target="Scene" name="ShowDialog" param="extinguisher_click"/>
					</onClick>
				</state>
				
				<state name="acquired">
					<onStateEnter><action target="Scene" name="ShowLayer" param="Extinguisher"/></onStateEnter>
				</state>
			</states>
		</object>
		
		<object name="Valve">
			<clickStrategy type="alpha" layer="Valve"/>
			<states>
				<state name="clickable">
					<onStateEnter><action target="Scene" name="HideLayer" param="Valve"/></onStateEnter>
					
					<onMouseOver>
						<action target="Scene" name="SetCursor" param="interactive"/>
					</onMouseOver>					
					
					<onClick>
						<action target="Scene" name="AddToInventory" param="Valve"/>
						<action target="Valve" name="SetState" param="acquired"/>
						<action target="Scene" name="PlaySound" param="Item_Pickup_Metal_small"/>
					</onClick>
				</state>
				
				<state name="acquired">
					<onStateEnter><action target="Scene" name="ShowLayer" param="Valve"/></onStateEnter>
				</state>
			</states>
		</object>
		
		<object name="Bag">
			<clickStrategy type="alpha" layer="Bag"/>
			<states>
				<state name="clickable">
					<onStateEnter><action target="Scene" name="HideLayer" param="Bag"/></onStateEnter>
					
					<onMouseOver>
						<action target="Scene" name="SetCursor" param="interactive"/>
					</onMouseOver>					
					
					<onClick>
						<action target="Scene" name="AddToInventory" param="Bag"/>
						<action target="Bag" name="SetState" param="acquired"/>
						<action target="Scene" name="PlaySound" param="Item_Pickup_Cloth_small"/>
					</onClick>
				</state>
				
				<state name="acquired">
					<onStateEnter><action target="Scene" name="ShowLayer" param="Bag"/></onStateEnter>
				</state>
			</states>
		</object>
		
		<object name="Coins">
			<clickStrategy type="alpha" layer="Coins"/>
			<states>
				<state name="clickable">
					<onStateEnter><action target="Scene" name="HideLayer" param="Coins"/></onStateEnter>
					
					<onMouseOver>
						<action target="Scene" name="SetCursor" param="interactive"/>
					</onMouseOver>					
					
					<onClick>
						<action target="Scene" name="AddToInventory" param="Coins"/>
						<action target="Coins" name="SetState" param="acquired"/>
						<action target="Scene" name="PlaySound" param="pick_up_coin"/>
						<action target="Scene" name="ShowDialog" param="coin_click"/>
					</onClick>
				</state>
				
				<state name="acquired">
					<onStateEnter><action target="Scene" name="ShowLayer" param="Coins"/></onStateEnter>
				</state>
			</states>
		</object>
		
		<object name="HotPipe">
			<clickStrategy type="alpha" layer="HotPipe"/>
			<states>
				<state name="hotWithKey">
					<onStateEnter>
						<action target="Scene" name="ShowLayer" param="HotPipe"/>
						<action target="Scene" name="ShowLayer" param="HotKey"/>
						<action target="Scene" name="HideLayer" param="Key"/>
					</onStateEnter>
					
					<onMouseOver>
						<action target="Scene" name="SetCursor" param="zoom"/>
					</onMouseOver>										
					
					<onClick><action target="Scene" name="OpenWindow" param="PipeWindow"/></onClick>
					
					<onUseObject name="ExtinguisherAndValve">
						<action target="Scene" name="OpenWindow" param="PipeWindow"/>
						<action target="HotPipe" name="SetState" param="coolWithKey"/>
						<action target="Scene" name="PlaySound" param="extinguisher_shot1"/>
					</onUseObject>
					
					<onEvent name="keyAcquired">
						<action target="HotPipe" name="SetState" param="hotNoKey"/>
						<action target="Scene" name="CloseWindow" param="PipeWindow" delay="60"/>
						<action target="Scene" name="PlaySound" param="take_the_key3"/>
						<action target="Scene" name="RemoveFromInventory" param="ExtinguisherAndValve"/>
					</onEvent>
				</state>
				
				<state name="coolWithKey">
					<onStateEnter>
						<action target="Scene" name="HideLayer" param="HotPipe"/>
						<action target="Scene" name="HideLayer" param="HotKey"/>
						<action target="Scene" name="HideLayer" param="Key"/>
					</onStateEnter>
					
					<onMouseOver>
						<action target="Scene" name="SetCursor" param="zoom"/>
					</onMouseOver>										
					
					<onClick><action target="Scene" name="OpenWindow" param="PipeWindow"/></onClick>
					
					<onEvent name="timerExpired">
						<action target="HotPipe" name="SetState" param="hotWithKey"/>
					</onEvent>
					
					<onEvent name="keyAcquired">
						<action target="HotPipe" name="SetState" param="coolNoKey"/>
						<action target="Scene" name="CloseWindow" param="PipeWindow" delay="60"/>
						<action target="Scene" name="PlaySound" param="take_the_key3"/>
						<action target="Scene" name="RemoveFromInventory" param="ExtinguisherAndValve"/>
					</onEvent>
				</state>
				
				<state name="hotNoKey">
					<onStateEnter>
						<action target="Scene" name="ShowLayer" param="HotPipe"/>
						<action target="Scene" name="HideLayer" param="HotKey"/>
						<action target="Scene" name="ShowLayer" param="Key"/>
					</onStateEnter>
					<!--
					<onMouseOver>
						<action target="Scene" name="SetCursor" param="zoom"/>
					</onMouseOver>										
					
					<onClick><action target="Scene" name="OpenWindow" param="PipeWindow"/></onClick>
					
					<onUseObject name="ExtinguisherAndValve">
						<action target="Scene" name="OpenWindow" param="PipeWindow"/>
						<action target="HotPipe" name="SetState" param="coolNoKey"/>
					</onUseObject>
					-->
				</state>
				
				<state name="coolNoKey">
					<onStateEnter>
						<action target="Scene" name="HideLayer" param="HotPipe"/>
						<action target="Scene" name="HideLayer" param="HotKey"/>
						<action target="Scene" name="ShowLayer" param="Key"/>
					</onStateEnter>
					<!--
					<onMouseOver>
						<action target="Scene" name="SetCursor" param="zoom"/>
					</onMouseOver>										
					
					<onClick><action target="Scene" name="OpenWindow" param="PipeWindow"/></onClick>
					-->
					<onEvent name="timerExpired">
						<action target="HotPipe" name="SetState" param="hotNoKey"/>
					</onEvent>					
				</state>
			</states>
		</object>
		
		<object name="Statue">
			<clickStrategy type="alpha" layer="Statue"/>
			<states>
				<state name="inScene">
					<onStateEnter><action target="Scene" name="HideLayer" param="Statue"/></onStateEnter>
					
					<onMouseOver>
						<action target="Scene" name="SetCursor" param="interactive"/>
					</onMouseOver>
					
					<onClick>
						<action target="Scene" name="ShowDialog" param="statue_click"/>
					</onClick>

					<onUseObject name="Bag">
						<action target="Scene" name="ShowDialog" param="bag_too_light"/>
					</onUseObject>
					
					<onUseObject name="BagWithCoins">
						<action target="Scene" name="RemoveFromInventory" param="BagWithCoins"/>
						<action target="Statue" name="SetState" param="acquired"/>
						<action target="Scene" name="AddToInventory" param="Statue"/>
						<action target="Door" name="SendEvent" param="statueAcquired"/>
						<action target="Scene" name="PlaySound" param="swap_bag_with_artefact"/>
					</onUseObject>
				</state>
				
				<state name="acquired">
					<onStateEnter><action target="Scene" name="ShowLayer" param="Statue"/></onStateEnter>
				</state>
			</states>
		</object>
		
		<object name="Door">
			<clickStrategy type="rect" left="560" top="95" right="800" bottom="360"/>
			<states>
				<state name="waitForStatue">
					<onStateEnter>
						<action target="Scene" name="HideLayer" param="NextRoom"/>
						<action target="Scene" name="HideLayer" param="OpenDoor"/>
					</onStateEnter>
					
					<onMouseOver>
						<action target="Scene" name="SetCursor" param="noExit"/>
					</onMouseOver>										
					
					<onEvent name="statueAcquired">
						<action target="Door" name="SetState" param="locked"/>
					</onEvent>
					
					<onUseObject name="Key">
						<action target="Scene" name="ShowDialog" param="need_statue"/>
					</onUseObject>
				</state>
				
				<state name="locked">
					<onStateEnter>
						<action target="Scene" name="HideLayer" param="NextRoom"/>
						<action target="Scene" name="HideLayer" param="OpenDoor"/>
					</onStateEnter>
					
					<onMouseOver>
						<action target="Scene" name="SetCursor" param="noExit"/>
					</onMouseOver>										
					
					<onUseObject name="Key">
						<action target="Door" name="SetState" param="unlocked"/>
						<action target="Scene" name="RemoveFromInventory" param="Key"/>
					</onUseObject>
				</state>
				
				<state name="unlocked">					
					<onStateEnter>
						<action target="Scene" name="ShowLayer" param="NextRoom"/>
						<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>
