<scene name="TankerTruck" numVictoryConditions="1" numSteps="4">
	<inventory>
		<object name="Wrench" memberName="HUD_wrench" acquired="0" visible="0"/>
		<object name="Sand" memberName="HUD_sand" acquired="0" visible="0"/>
		<object name="Hose" memberName="HUD_hose" acquired="0" visible="0"/>
	</inventory>
	
	<finalStates>
		<finalState objName="GasStationWindow" state="done"/>
		<finalState objName="TruckWindow" state="done"/>
		<finalState objName="TankFire" state="noFire"/>
		<finalState objName="GasLeak" state="withSand"/>
		<finalState objName="Hydrant" state="flowing"/>
		<finalState objName="ExitArea" state="replayExit"/>
	</finalStates>
	
	<slidersMap>
		<slider layerName="slider_R31_Wheel" id="bridge1"/>
	</slidersMap>
	
	<animations>
		<animation name="FireAnim" type="loop" xpos="842" ypos="515" zpos="6" member="Generic Flame Loop"/>
		<animation name="GasLeakAnim" type="loop" xpos="598" ypos="564" zpos="6" member="Fuel Spill"/>
		<animation name="GasLeakSprayAnim" type="loop" xpos="639" ypos="582" zpos="6" member="Spraying Fuel Loop"/>
		<animation name="WaterAnim" type="loop" xpos="882" ypos="532" zpos="7" member="Hose Spray"/>
		
		<animation name="DripAnim" type="loop" xpos="224" ypos="660">
			<frames>
				<frame memberName="Truck Dripping Hydrant_000_anim" frameDelay="60"/>
				<frame memberName="Truck Dripping Hydrant_001_anim" frameDelay="60"/>
				<frame memberName="Truck Dripping Hydrant_002_anim" frameDelay="60"/>
				<frame memberName="Truck Dripping Hydrant_003_anim" frameDelay="60"/>
				<frame memberName="Truck Dripping Hydrant_004_anim" frameDelay="60"/>
				<frame memberName="Truck Dripping Hydrant_005_anim" frameDelay="60"/>
				<frame memberName="Truck Dripping Hydrant_006_anim" frameDelay="60"/>
				<frame memberName="Truck Dripping Hydrant_007_anim" frameDelay="60"/>
				<frame memberName="Truck Dripping Hydrant_008_anim" frameDelay="60"/>
				<frame memberName="Truck Dripping Hydrant_009_anim" frameDelay="60"/>
				<frame memberName="Truck Dripping Hydrant_010_anim" frameDelay="60"/>
				<frame memberName="Truck Dripping Hydrant_011_anim" frameDelay="60"/>
				<frame memberName="Truck Dripping Hydrant_012_anim" frameDelay="60"/>
				<frame memberName="Truck Dripping Hydrant_013_anim" frameDelay="3000"/>
			</frames>
		</animation>
		
		<animation name="Light1Anim" type="loop">
			<frames>
				<frame memberName="light 01_anim" frameDelay="1800" blend="100"/>
				<frame memberName="light 01_anim" frameDelay="100" blend="20"/>
				<frame memberName="light 01_anim" frameDelay="200" blend="100"/>
				<frame memberName="light 01_anim" frameDelay="100" blend="20"/>
			</frames>
		</animation>
		
		<animation name="Light2Anim" type="loop">
			<frames>
				<frame memberName="light 02_anim" frameDelay="1800" blend="100"/>
				<frame memberName="light 02_anim" frameDelay="100" blend="20"/>
				<frame memberName="light 02_anim" frameDelay="200" blend="100"/>
				<frame memberName="light 02_anim" frameDelay="100" blend="20"/>
			</frames>
		</animation>
		
		<animation name="Light3Anim" type="loop">
			<frames>
				<frame memberName="light 03_anim" frameDelay="2000" blend="100"/>
				<frame memberName="light 03_anim" frameDelay="50" blend="20"/>
				<frame memberName="light 03_anim" frameDelay="200" blend="100"/>
				<frame memberName="light 03_anim" frameDelay="100" blend="20"/>
			</frames>
		</animation>
		
		<animation name="Light4Anim" type="loop">
			<frames>
				<frame memberName="light 04_anim" frameDelay="2000" blend="100"/>
				<frame memberName="light 04_anim" frameDelay="50" blend="20"/>
				<frame memberName="light 04_anim" frameDelay="200" blend="100"/>
				<frame memberName="light 04_anim" frameDelay="100" blend="20"/>
			</frames>
		</animation>
		
		<animation name="Light5Anim" type="loop">
			<frames>
				<frame memberName="light 05_anim" frameDelay="2000" blend="100"/>
				<frame memberName="light 05_anim" frameDelay="50" blend="20"/>
				<frame memberName="light 05_anim" frameDelay="200" blend="100"/>
				<frame memberName="light 05_anim" frameDelay="100" blend="20"/>
			</frames>
		</animation>
		
		<animation name="DavidAnim" type="once" zpos="200" crossfade="1">
			<frames>
				<frame memberName="d1_anim" frameDelay="500"/>
				<frame memberName="d2_anim" frameDelay="500"/>
				<frame memberName="d3_anim" frameDelay="500"/>
			</frames>
		</animation>
	</animations>
	
	<zoomWindows>
		<zoomWindow name="GasStationWindow" file="ZoomWindows\TankerTruck_Z1.dir" visible="0" hotspot="point(680, 489)"/>
		<zoomWindow name="TruckWindow" file="ZoomWindows\TankerTruck_Z2.dir" visible="0" hotspot="point(302, 450)"/>
	</zoomWindows>
	
	<locks>
		<lock name="SceneCompleteLock">
			<parts>
				<part name="Hose" state="locked"/>
				<part name="Sand" state="locked"/>
			</parts>
			<onUnlocked>
				<action target="ExitArea" name="SetState" param="available"/>
			</onUnlocked>
		</lock>		
	</locks>
	
	<objects>
		<object name="Ambience">
			<states>
				<state name="Ambience">
					<onStateEnter>
						<action target="Scene" name="PlaySound" param="S-30"/>
					</onStateEnter>
				</state>
			</states>
		</object>

		<object name="GasStationWindow">
			<clickStrategy type="rect" left="640" top="420" right="725" bottom="555"/>
			<states>
				<state name="notAvailable">
					<onEvent name="reveal">
						<action target="Scene" name="RevealHotspot" param="GasStationWindow"/>
						<action target="GasStationWindow" name="SetState" param="clickable"/>
					</onEvent>
				</state>
				
				<state name="clickable">
					<onMouseOver>
						<action target="Scene" name="SetCursor" param="zoom"/>
					</onMouseOver>

					<onClick>
						<action target="Scene" name="OpenWindow" param="GasStationWindow"/>
					</onClick>
				</state>
				
				<state name="done">
				</state>
			</states>
		</object>
		
		<object name="TruckWindow">
			<clickStrategy type="rect" left="230" top="370" right="375" bottom="530"/>
			<states>
				<state name="notAvailable">
					<onEvent name="reveal">
						<action target="Scene" name="RevealHotspot" param="TruckWindow"/>
						<action target="TruckWindow" name="SetState" param="clickable"/>
					</onEvent>
				</state>
				
				<state name="clickable">
					<onMouseOver>
						<action target="Scene" name="SetCursor" param="zoom"/>
					</onMouseOver>

					<onClick>
						<action target="Scene" name="OpenWindow" param="TruckWindow"/>
					</onClick>
				</state>
				
				<state name="done">
				</state>
			</states>
		</object>
		
		<object name="TankFire">
			<states>
				<state name="onFire">
					<onStateEnter>
						<action target="Scene" name="PlaySound" param="p-021"/>
						<action target="Scene" name="StartAnimation" param="FireAnim"/>
					</onStateEnter>
					
					<onEvent name="fireOut">
						<action target="TankFire" name="SetState" param="noFire"/>
					</onEvent>
				</state>
				
				<state name="noFire">
					<onStateEnter>
						<action target="Scene" name="StopSound" param="p-021"/>
						<action target="Scene" name="StopAnimation" param="FireAnim"/>
					</onStateEnter>
				</state>
			</states>
		</object>
		
		<object name="GasLeak">
			<clickStrategy type="rect" left="550" top="580" right="800" bottom="620"/>
			<states>
				<state name="creeping">
					<onStateEnter>
						<action target="Scene" name="HideLayer" param="sand"/>
						<action target="Scene" name="StartAnimation" param="GasLeakAnim"/>
						<action target="Scene" name="StartAnimation" param="GasLeakSprayAnim"/>
												
						<!--<action target="Scene" name="StartAnimation" param="GasLeakReflectionAnim"/>-->
					</onStateEnter>
					
					<onMouseOver>
						<action target="Scene" name="SetCursor" param="puzzle"/>
					</onMouseOver>
					
					<onClick>
						<action target="Scene" name="ShowDialog" param="gas_click"/>
						<action target="GasStationWindow" name="SendEvent" param="reveal"/>
					</onClick>
					
					<onUseObject name="Sand">
						<action target="Scene" name="RemoveFromInventory" param="Sand"/>
						<action target="GasLeak" name="SetState" param="withSand"/>
						<!--<action target="Scene" name="StopAnimation" param="GasLeakReflectionAnim"/>-->
						<action target="Hydrant" name="SendEvent" param="sand_used"/>
						<action target="Scene" name="PlaySound" param="p-017"/>
						<action target="SceneCompleteLock" name="UnlockPart" param="Sand"/>
						<action target="Scene" name="StepComplete" param=""/>
					</onUseObject>
				</state>
				
				<state name="withSand">
					<onStateEnter>
						<action target="Scene" name="StopAnimation" param="GasLeakAnim"/>
						<action target="Scene" name="ShowLayer" param="sand"/>
					</onStateEnter>
				</state>
			</states>
		</object>
		
		<object name="Hydrant">
			<clickStrategy type="alpha" layer="hydrant cover"/>
			<states>
				<state name="unusable">
					<onStateEnter>
						<action target="Scene" name="ShowLayer" param="hydrant cover"/>
						<action target="Scene" name="HideLayer" param="hydrant cover sidewalk"/>
						<action target="Scene" name="HideLayer" param="hose"/>
					</onStateEnter>
					
					<onMouseOver>
						<action target="Scene" name="SetCursor" param="puzzle"/>
					</onMouseOver>
					
					<onClick>
						<action target="Scene" name="ShowDialog" param="no_hydrant"/>
						<action target="TruckWindow" name="SendEvent" param="reveal"/>
					</onClick>
					
					<onUseObject name="Hose">
						<action target="Scene" name="ShowDialog" param="no_hydrant"/>
					</onUseObject>
					
					<onUseObject name="Wrench">
						<action target="Scene" name="ShowDialog" param="no_hydrant"/>
					</onUseObject>
					
					<onEvent name="sand_used">
						<action target="Hydrant" name="SetState" param="withCap"/>
					</onEvent>
				</state>
				
				<state name="withCap">
					<onStateEnter>
						<action target="Scene" name="ShowLayer" param="hydrant cover"/>
						<action target="Scene" name="HideLayer" param="hydrant cover sidewalk"/>
						<action target="Scene" name="HideLayer" param="hose"/>
					</onStateEnter>
					
					<onMouseOver>
						<action target="Scene" name="SetCursor" param="puzzle"/>
					</onMouseOver>
					
					<onClick>
						<action target="Scene" name="ShowDialog" param="hydrant_click"/>
						<action target="TruckWindow" name="SendEvent" param="reveal"/>
					</onClick>
					
					<onUseObject name="Hose">
						<action target="Scene" name="ShowDialog" param="remove_cap"/>
					</onUseObject>
					
					<onUseObject name="Wrench">
						<action target="Hydrant" name="SetState" param="noCap"/>
						<action target="Scene" name="PlaySound" param="p-018"/>
						<action target="Scene" name="StepComplete" param=""/>
					</onUseObject>
				</state>
				
				<state name="noCap">
					<onStateEnter>
						<action target="Scene" name="HideLayer" param="hydrant cover"/>
						<action target="Scene" name="ShowLayer" param="hydrant cover sidewalk"/>
					</onStateEnter>
					
					<onMouseOver>
						<action target="Scene" name="SetCursor" param="puzzle"/>
					</onMouseOver>
					
					<onClick>
						<action target="Scene" name="ShowDialog" param="no_cap_click"/>
						<action target="TruckWindow" name="SendEvent" param="reveal"/>
					</onClick>
					
					<onUseObject name="Hose">
						<action target="Scene" name="RemoveFromInventory" param="Hose"/>
						<action target="Hydrant" name="SetState" param="withHose"/>
						<action target="Scene" name="PlaySound" param="p-019"/>
						<action target="Scene" name="StepComplete" param=""/>
					</onUseObject>
				</state>
				
				<state name="withHose">
					<onStateEnter>
						<action target="Scene" name="ShowLayer" param="hose"/>
					</onStateEnter>
					
					<onMouseOver>
						<action target="Scene" name="SetCursor" param="puzzle"/>
					</onMouseOver>
					
					<onClick>
						<action target="Scene" name="ShowDialog" param="hose_click"/>
						<action target="TruckWindow" name="SendEvent" param="reveal"/>
					</onClick>
					
					<onUseObject name="Wrench">
						<action target="Scene" name="RemoveFromInventory" param="Wrench"/>
						<action target="TankFire" name="SendEvent" param="fireOut"/>
						<action target="Hydrant" name="SetState" param="flowing"/>
						<action target="Scene" name="StartAnimation" param="WaterAnim"/>
						<action target="SceneCompleteLock" name="UnlockPart" param="Hose"/>
						<action target="Scene" name="PlaySound" param="p-020"/>
						<action target="Scene" name="PlaySound" param="p-022"/>
						<action target="Scene" name="StepComplete" param=""/>
						<action target="Scene" name="StartAnimation" param="DavidAnim" delay="1000"/>
						<action target="Scene" name="RegisterVictoryCondition" param="" delay="2500"/>
					</onUseObject>
				</state>
				
				<state name="flowing">
					<onStateEnter>
						<action target="Scene" name="HideLayer" param="hydrant cover"/>
						<action target="Scene" name="ShowLayer" param="hydrant cover sidewalk"/>
						<action target="Scene" name="ShowLayer" param="hose"/>
					</onStateEnter>
				</state>
			</states>
		</object>
		
		<object name="ExitArea">
			<clickStrategy type="rect" left="420" top="370" right="555" bottom="555"/>
			<states>
			<!--
				<state name="notAvailable">
					<onMouseOver>
						<action target="Scene" name="SetCursor" param="noExit"/>
					</onMouseOver>
					
					<onClick>
						<action target="Scene" name="ShowDialog" param="exit_click"/>
					</onClick>
				</state>
				
				<state name="available">
					<onMouseOver>
						<action target="Scene" name="SetCursor" param="exit"/>
					</onMouseOver>
					
					<onClick>
						<action target="Scene" name="StartAnimation" param="DavidAnim"/>
						<action target="Scene" name="RegisterVictoryCondition" param="" delay="1500"/>
						<action target="ExitArea" name="SetState" param="done"/>
					</onClick>
				</state>
			-->	
				<state name="done">
				</state>
				
				<state name="replayExit">
					<onMouseOver>
						<action target="Scene" name="SetCursor" param="exit"/>
					</onMouseOver>
					
					<onClick>
						<action target="Scene" name="ReplayExit" param=""/>
					</onClick>
				</state>
			</states>
		</object>
	</objects>
</scene>

