<scene name="Room20" numVictoryConditions="1">
	<inventory>
		<object name="Crop" memberName="HUD_crop" acquired="0" visible="1"/>
		<object name="Sicle" memberName="HUD_sicle" acquired="0" visible="1"/>
		<object name="Nitrogen" memberName="HUD_nitrogen" acquired="0" visible="1"/>
	</inventory>
	
	<finalStates>
		<finalState objName="Crop" state="acquired"/>
		<finalState objName="Case" state="noSicle"/>
		<finalState objName="Sarcophagus" state="noNitrogen"/>
		<finalState objName="Pipe" state="fixed"/>
		<finalState objName="Door" state="open"/>
	</finalStates>
	
	<animations>
		<animation name="WaterAnim" type="loop" xpos="339" ypos="339">
			<frames>
				<frame memberName="water1_anim" frameDelay="2"/>
				<frame memberName="water2_anim" frameDelay="2"/>
				<frame memberName="water3_anim" frameDelay="2"/>
				<frame memberName="water4_anim" frameDelay="2"/>
				<frame memberName="water5_anim" frameDelay="2"/>
				<frame memberName="water6_anim" frameDelay="2"/>
				<frame memberName="water7_anim" frameDelay="2"/>
				<frame memberName="water8_anim" frameDelay="2"/>
				<frame memberName="water9_anim" frameDelay="2"/>
				<frame memberName="water10_anim" frameDelay="2"/>
				<frame memberName="water11_anim" frameDelay="2"/>
				<frame memberName="water12_anim" frameDelay="2"/>
				<frame memberName="water13_anim" frameDelay="2"/>
				<frame memberName="water14_anim" frameDelay="2"/>
				<frame memberName="water15_anim" frameDelay="2"/>
				<frame memberName="water16_anim" frameDelay="2"/>
				<frame memberName="water17_anim" frameDelay="2"/>
				<frame memberName="water18_anim" frameDelay="2"/>
				<frame memberName="water19_anim" frameDelay="2"/>
			</frames>
		</animation>
		
		<animation name="SparkAnim" type="loop" xpos="458" ypos="405">
			<frames>
				<frame memberName="spark1_anim" frameDelay="2"/>
				<frame memberName="spark2_anim" frameDelay="2"/>
				<frame memberName="spark3_anim" frameDelay="2"/>
				<frame memberName="spark4_anim" frameDelay="2"/>
				<frame memberName="spark5_anim" frameDelay="2"/>
				<frame memberName="spark6_anim" frameDelay="2"/>
				<frame memberName="spark7_anim" frameDelay="2"/>
				<frame memberName="spark8_anim" frameDelay="2"/>
				<frame memberName="spark9_anim" frameDelay="2"/>
				<frame memberName="spark10_anim" frameDelay="2"/>
				<frame memberName="spark11_anim" frameDelay="2"/>
				<frame memberName="spark12_anim" frameDelay="2"/>
				<frame memberName="spark13_anim" frameDelay="2"/>
				<frame memberName="spark14_anim" frameDelay="2"/>
				<frame memberName="spark15_anim" frameDelay="2"/>
				<frame memberName="spark16_anim" frameDelay="2"/>
				<frame memberName="spark17_anim" frameDelay="2"/>
				<frame memberName="spark18_anim" frameDelay="2"/>
				<frame memberName="spark19_anim" frameDelay="2"/>
				<frame memberName="spark20_anim" frameDelay="2"/>
				<frame memberName="spark21_anim" frameDelay="2"/>
				<frame memberName="spark22_anim" frameDelay="2"/>
				<frame memberName="spark23_anim" frameDelay="2"/>
				<frame memberName="spark24_anim" frameDelay="2"/>
				<frame memberName="spark25_anim" frameDelay="2"/>
				<frame memberName="spark26_anim" frameDelay="2"/>
				<frame memberName="spark27_anim" frameDelay="2"/>
				<frame memberName="spark28_anim" frameDelay="2"/>
				<frame memberName="spark29_anim" frameDelay="2"/>
				<frame memberName="spark30_anim" frameDelay="2"/>
			</frames>
		</animation>
	</animations>
	
	<zoomWindows>
		<zoomWindow name="CaseWindow" file="ZoomWindows\Room20_CaseWindow.dir" x="630" y="365" visible="0"/>
		<zoomWindow name="SarcophagusWindow" file="ZoomWindows\Room20_SarcophagusWindow.dir" x="230" y="400" visible="0"/>
		<zoomWindow name="PipeWindow" file="ZoomWindows\Room20_PipeWindow.dir" x="280" y="270" visible="0"/>
	</zoomWindows>
	
	<objects>
		<object name="Crop">
			<clickStrategy type="rect" left="300" top="500" right="335" bottom="520"/>			
			<states>
				<state name="clickable">
					<onStateEnter>
						<action target="Scene" name="HideLayer" param="Crop"/>
						<action target="Scene" name="PlaySound" param="indoor_small"/>
						<action target="Scene" name="PlaySound" param="traffic"/>
						<action target="Scene" name="PlaySound" param="electricity"/>
					</onStateEnter>
					
					<onMouseOver>
						<action target="Scene" name="SetCursor" param="interactive"/>
					</onMouseOver>
					
					<onClick>
						<action target="Scene" name="AddToInventory" param="Crop"/>
						<action target="Crop" 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="Crop"/></onStateEnter>
				</state>
			</states>
		</object>
		
		<object name="Case">
			<clickStrategy type="rect" left="650" top="325" right="800" bottom="525"/>
			<states>
				<state name="closed">
					<onStateEnter><action target="Scene" name="HideLayer" param="Case"/></onStateEnter>
					
					<onMouseOver>
						<action target="Scene" name="SetCursor" param="zoom"/>
					</onMouseOver>					
					
					<onClick>
						<action target="Scene" name="OpenWindow" param="CaseWindow"/>
						<action target="Case" name="SetState" param="open"/>
					</onClick>
				</state>
				
				<state name="open">
					<onStateEnter><action target="Scene" name="ShowLayer" param="Case"/></onStateEnter>
					
					<onMouseOver>
						<action target="Scene" name="SetCursor" param="zoom"/>
					</onMouseOver>					
					
					<onClick><action target="Scene" name="OpenWindow" param="CaseWindow"/></onClick>
				</state>
				
				<state name="noSicle">
					<onStateEnter>
						<action target="Scene" name="CloseWindow" param="CaseWindow" delay="60"/>
						<action target="Scene" name="ShowLayer" param="Case"/>
						<action target="Scene" name="PlaySound" param="Item_Pickup_Metal_big"/>
					</onStateEnter>
				</state>
			</states>
		</object>
	
		<object name="Sarcophagus">
			<clickStrategy type="rect" left="130" top="340" right="265" bottom="470"/>
			<states>
				<state name="closed">
					<onStateEnter><action target="Scene" name="HideLayer" param="Sarcophagus"/></onStateEnter>
					
					<onMouseOver>
						<action target="Scene" name="SetCursor" param="zoom"/>
					</onMouseOver>					
					
					<onClick>
						<action target="Scene" name="OpenWindow" param="SarcophagusWindow"/>
						<action target="Scene" name="ShowDialog" param="tomb_click"/>
					</onClick>
					
					<onUseObject name="Sicle">
						<action target="Scene" name="OpenWindow" param="SarcophagusWindow"/>
						<action target="Scene" name="RemoveFromInventory" param="Sicle"/>
						<action target="Sarcophagus" name="SetState" param="withSicle"/>
						<action target="Scene" name="PlaySound" param="put_sickle"/>
					</onUseObject>
					
					<onUseObject name="Crop">
						<action target="Scene" name="OpenWindow" param="SarcophagusWindow"/>
						<action target="Scene" name="RemoveFromInventory" param="Crop"/>
						<action target="Sarcophagus" name="SetState" param="withCrop"/>
						<action target="Scene" name="PlaySound" param="put_crop"/>
					</onUseObject>
				</state>
				
				<state name="withSicle">
					<onStateEnter><action target="Scene" name="HideLayer" param="Sarcophagus"/></onStateEnter>
					
					<onMouseOver>
						<action target="Scene" name="SetCursor" param="zoom"/>
					</onMouseOver>					
					
					<onClick><action target="Scene" name="OpenWindow" param="SarcophagusWindow"/></onClick>
					
					<onUseObject name="Crop">
						<action target="Scene" name="OpenWindow" param="SarcophagusWindow"/>
						<action target="Scene" name="RemoveFromInventory" param="Crop"/>
						<action target="Sarcophagus" name="SetState" param="withCropAndSicle"/>
					</onUseObject>
				</state>
				
				<state name="withCrop">
					<onStateEnter><action target="Scene" name="HideLayer" param="Sarcophagus"/></onStateEnter>
					
					<onMouseOver>
						<action target="Scene" name="SetCursor" param="zoom"/>
					</onMouseOver>
										
					<onClick><action target="Scene" name="OpenWindow" param="SarcophagusWindow"/></onClick>
					
					<onUseObject name="Sicle">
						<action target="Scene" name="OpenWindow" param="SarcophagusWindow"/>
						<action target="Scene" name="RemoveFromInventory" param="Sicle"/>
						<action target="Sarcophagus" name="SetState" param="withCropAndSicle"/>
					</onUseObject>
				</state>
				
				<state name="withCropAndSicle">
					<onStateEnter><action target="Scene" name="HideLayer" param="Sarcophagus"/></onStateEnter>
					
					<onMouseOver>
						<action target="Scene" name="SetCursor" param="zoom"/>
					</onMouseOver>					
					
					<onClick>
						<action target="Scene" name="OpenWindow" param="SarcophagusWindow"/>
						<action target="Sarcophagus" name="SetState" param="open"/>
					</onClick>
				</state>
				
				<state name="open">
					<onStateEnter><action target="Scene" name="ShowLayer" param="Sarcophagus"/></onStateEnter>
					
					<onMouseOver>
						<action target="Scene" name="SetCursor" param="zoom"/>
					</onMouseOver>					
					
					<onClick><action target="Scene" name="OpenWindow" param="SarcophagusWindow"/></onClick>
				</state>
				
				<state name="noNitrogen">
					<onStateEnter>
						<action target="Scene" name="CloseWindow" param="SarcophagusWindow" delay="60"/>
						<action target="Scene" name="ShowLayer" param="Sarcophagus"/>
						<action target="Scene" name="PlaySound" param="take_bandage"/>
					</onStateEnter>
				</state>
			</states>
		</object>
		
		<object name="Pipe">			
			<clickStrategy type="rect" left="260" top="250" right="300" bottom="300"/>
			<states>
				<state name="broken">
					<onStateEnter>
						<action target="Scene" name="ShowLayer" param="FallingWater"/>
						<action target="Scene" name="HideLayer" param="Water"/>
						<action target="Scene" name="StartAnimation" param="WaterAnim"/>
					</onStateEnter>
					
					<onMouseOver>
						<action target="Scene" name="SetCursor" param="zoom"/>
					</onMouseOver>					
					
					<onClick>
						<action target="Scene" name="OpenWindow" param="PipeWindow"/>
						<action target="Scene" name="ShowDialog" param="pipe_click"/>
					</onClick>
					
					<onUseObject name="Nitrogen">
						<action target="Scene" name="OpenWindow" param="PipeWindow"/>
						<action target="Pipe" name="SetState" param="fixed"/>
						<action target="Door" name="SendEvent" param="waterStopped"/>
						<!--<action target="Scene" name="PlaySound" param="use_bandage_on_pipe"/>-->
						<action target="Scene" name="PlaySound" param="extinguisher_shot1"/>
						<action target="Scene" name="PlaySound" param="water_stops"/>
					</onUseObject>
				</state>
				
				<state name="fixed">
					<onStateEnter>
						<action target="Scene" name="CloseWindow" param="PipeWindow" delay="120"/>
						<action target="Scene" name="ShowLayer" param="FallingWater"/>
						<action target="Scene" name="ShowLayer" param="Water"/>
						<action target="Scene" name="StopAnimation" param="WaterAnim"/>
					</onStateEnter>
				</state>
			</states>
		</object>
		
		<object name="Door">
			<clickStrategy type="alpha" layer="OpenDoor"/>
			<states>
				<state name="blocked">
					<onStateEnter>
						<action target="Scene" name="HideLayer" param="OpenDoor"/>
						<action target="Scene" name="StartAnimation" param="SparkAnim"/>
					</onStateEnter>
					
					<onMouseOver>
						<action target="Scene" name="SetCursor" param="noExit"/>
					</onMouseOver>

					<onClick>
						<action target="Scene" name="ShowDialog" param="door_click"/>
					</onClick>
					
					<onEvent name="waterStopped">
						<action target="Door" name="SetState" param="open"/>
						<action target="Scene" name="StopAnimation" param="SparkAnim"/>
					</onEvent>
				</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>
