<scene name="RoofDebris" numVictoryConditions="1" numSteps="5">
	<inventory>
		<object name="Paint1" memberName="HUD_paint bucket02" acquired="0" visible="0"/>
		<object name="Paint2" memberName="HUD_paint bucket01" acquired="0" visible="0"/>
		<object name="Chain" memberName="HUD_chain" acquired="0" visible="0"/>
		<object name="Harness" memberName="HUD_harness" acquired="0" visible="0"/>
		<object name="Clip" memberName="HUD_clip" acquired="0" visible="0"/>
	</inventory>
	
	<finalStates>
		<finalState objName="Ambience" state="done"/>
		<finalState objName="VentWindow" state="done"/>
		<finalState objName="CleaningBasketWindow" state="done"/>
		<finalState objName="Chimney" state="harnessed"/>
		<finalState objName="Antenna" state="complete"/>
		<finalState objName="ExitArea" state="replayExit"/>
	</finalStates>
	
	<slidersMap>
		<slider layerName="slider_R48_Debris" id="bridge4"/>
		<slider layerName="slider_L19__Debris" id="bridge5"/>
	</slidersMap>
	
	<animations>
		<animation name="AntennaAnim" type="loop">
			<frames>
				<frame memberName="antene04_anim" frameDelay="180"/>
				<frame memberName="antene05_anim" frameDelay="160"/>
				<frame memberName="antene06_anim" frameDelay="120"/>
				<frame memberName="antene07_anim" frameDelay="40"/>
				<frame memberName="antene08_anim" frameDelay="120"/>
				<frame memberName="antene09_anim" frameDelay="160"/>
				<frame memberName="antene10_anim" frameDelay="180"/>
				<frame memberName="antene09_anim" frameDelay="160"/>
				<frame memberName="antene08_anim" frameDelay="120"/>
				<frame memberName="antene07_anim" frameDelay="40"/>
				<frame memberName="antene06_anim" frameDelay="120"/>
				<frame memberName="antene05_anim" frameDelay="160"/>				
			</frames>
		</animation>
		
		<animation name="ClipAnim" type="loop">
			<frames>
				<frame memberName="clip04_anim" frameDelay="80"/>
				<frame memberName="clip05_anim" frameDelay="80"/>
				<frame memberName="clip06_anim" frameDelay="80"/>
				<frame memberName="clip07_anim" frameDelay="80"/>
				<frame memberName="clip08_anim" frameDelay="80"/>
				<frame memberName="clip09_anim" frameDelay="80"/>
				<frame memberName="clip10_anim" frameDelay="80"/>
				<frame memberName="clip10_anim" frameDelay="80"/>
				<frame memberName="clip09_anim" frameDelay="80"/>
				<frame memberName="clip08_anim" frameDelay="80"/>
				<frame memberName="clip07_anim" frameDelay="80"/>
				<frame memberName="clip06_anim" frameDelay="80"/>
				<frame memberName="clip05_anim" frameDelay="80"/>
				<frame memberName="clip04_anim" frameDelay="80"/>
			</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="VentWindow" file="ZoomWindows\RoofDebris_Z1.dir" visible="0" hotspot="point(650, 540)"/>
		<zoomWindow name="CleaningBasketWindow" file="ZoomWindows\RoofDebris_Z2.dir" visible="0" hotspot="point(235, 410)"/>
	</zoomWindows>
	
	<locks>
		<lock name="AntennaLock">
			<parts>
				<part name="Clip" state="locked"/>
				<part name="Harness" state="locked"/>
				<!--<part name="Chain" state="locked"/>-->
			</parts>
			<onUnlocked>
				<action target="Antenna" name="SetState" param="waitForChain"/>
			</onUnlocked>
		</lock>		
	</locks>
	
	<objects>
		<object name="Ambience">
			<states>
				<state name="Ambience">
					<onStateEnter>
						<action target="Scene" name="PlaySound" param="S-30"/>
						<action target="Scene" name="PlaySound" param="p-037"/>
					</onStateEnter>
				</state>
				
				<state name="done">
					<onStateEnter>
						<action target="Scene" name="PlaySound" param="S-30"/>
					</onStateEnter>
				</state>
			</states>
		</object>

		<object name="VentWindow">
			<clickStrategy type="rect" left="575" top="525" right="725" bottom="555"/>
			<states>
				<state name="notAvailable">
					<onEvent name="reveal">
						<action target="Scene" name="RevealHotspot" param="VentWindow"/>
						<action target="VentWindow" 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="VentWindow"/>
					</onClick>
				</state>
				
				<state name="done">
				</state>
			</states>
		</object>
		
		<object name="CleaningBasketWindow">
			<clickStrategy type="rect" left="155" top="380" right="315" bottom="440"/>
			<states>
				<state name="notAvailable">
					<onEvent name="reveal">
						<action target="Scene" name="RevealHotspot" param="CleaningBasketWindow"/>
						<action target="CleaningBasketWindow" 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="CleaningBasketWindow"/>
					</onClick>
				</state>
				
				<state name="done">
				</state>
			</states>
		</object>
		
		<object name="Chimney">
			<clickStrategy type="rect" left="650" top="360" right="790" bottom="480"/>
			<states>
				<state name="waitingForHarness">
					<onStateEnter>
						<action target="Scene" name="HideLayer" param="harness"/>
					</onStateEnter>
					
					<onMouseOver>
						<action target="Scene" name="SetCursor" param="puzzle"/>
					</onMouseOver>
					
					<onClick>
						<action target="Scene" name="ShowDialog" param="chimney_click"/>
					</onClick>
					
					<onUseObject name="Harness">
						<action target="Scene" name="RemoveFromInventory" param="Harness"/>
						<action target="AntennaLock" name="UnlockPart" param="Harness"/>
						<action target="Chimney" name="SetState" param="harnessed"/>
						<action target="Scene" name="PlaySound" param="p-038"/>
						<action target="Scene" name="StepComplete" param=""/>
					</onUseObject>
				</state>
				
				<state name="harnessed">
					<onStateEnter>
						<action target="Scene" name="ShowLayer" param="harness"/>
					</onStateEnter>
				</state>
			</states>
		</object>
		
		<object name="Antenna">
			<clickStrategy type="rect" left="320" top="0" right="500" bottom="520"/>
			<states>
				<state name="visible">
					<onStateEnter>
						<!--<action target="Scene" name="HideLayer" param="clip01"/>-->
						<action target="Scene" name="HideLayer" param="antene fixed"/>
						<action target="Scene" name="HideLayer" param="paint bucket02"/>
						<action target="Scene" name="HideLayer" param="paint bucket01"/>
						<action target="Scene" name="StartAnimation" param="AntennaAnim"/>
					</onStateEnter>
					
					<onMouseOver>
						<action target="Scene" name="SetCursor" param="puzzle"/>
					</onMouseOver>
					
					<onClick>
						<action target="Scene" name="ShowDialog" param="antenna_click"/>
						<action target="VentWindow" name="SendEvent" param="reveal"/>
						<action target="CleaningBasketWindow" name="SendEvent" param="reveal"/>
					</onClick>
					
					<onUseObject name="Clip">
						<!--<action target="Scene" name="ShowLayer" param="clip01"/>-->
						<action target="Scene" name="RemoveFromInventory" param="Clip"/>
						<action target="Antenna" name="SetState" param="withClip"/>
						<action target="AntennaLock" name="UnlockPart" param="Clip"/>
						<action target="Scene" name="PlaySound" param="p-039"/>
						<action target="Scene" name="StepComplete" param=""/>
					</onUseObject>
				</state>
				
				<state name="withClip">
					<onStateEnter>
						<action target="Scene" name="StartAnimation" param="ClipAnim"/>
					</onStateEnter>
					
					<onMouseOver>
						<action target="Scene" name="SetCursor" param="puzzle"/>
					</onMouseOver>
					
					<onClick>
						<action target="Scene" name="ShowDialog" param="antenna_clip_click"/>
						<action target="VentWindow" name="SendEvent" param="reveal"/>
						<action target="CleaningBasketWindow" name="SendEvent" param="reveal"/>
					</onClick>
				</state>
				
				<state name="waitForChain">
					<onMouseOver>
						<action target="Scene" name="SetCursor" param="puzzle"/>
					</onMouseOver>
					
					<onClick>
						<action target="Scene" name="ShowDialog" param="antenna_need_chain"/>
						<action target="VentWindow" name="SendEvent" param="reveal"/>
						<action target="CleaningBasketWindow" name="SendEvent" param="reveal"/>
					</onClick>
					
					<onUseObject name="Chain">
						<action target="Scene" name="RemoveFromInventory" param="Chain"/>
						<action target="Antenna" name="SetState" param="secured"/>
						<!--<action target="AntennaLock" name="UnlockPart" param="Chain"/>-->
						<action target="Scene" name="PlaySound" param="p-040"/>
						<action target="Scene" name="StepComplete" param=""/>
					</onUseObject>
				</state>
				
				<state name="secured">
					<onStateEnter>
						<action target="Scene" name="StopSound" param="p-037"/>
						<action target="Scene" name="ShowLayer" param="antene fixed"/>
						<!--<action target="Scene" name="HideLayer" param="antene01"/>-->
						<!--<action target="Scene" name="HideLayer" param="clip01"/>-->
						<action target="Scene" name="StopAnimation" param="AntennaAnim" delay="500"/>
					</onStateEnter>
					
					<onMouseOver>
						<action target="Scene" name="SetCursor" param="puzzle"/>
					</onMouseOver>
					
					<onClick>
						<action target="Scene" name="ShowDialog" param="tower_secured_click"/>
						<action target="VentWindow" name="SendEvent" param="reveal"/>
						<action target="CleaningBasketWindow" name="SendEvent" param="reveal"/>
					</onClick>
					
					<onUseObject name="Paint1">
						<action target="Scene" name="RemoveFromInventory" param="Paint1"/>
						<action target="Antenna" name="SetState" param="withPaint1"/>
						<action target="Scene" name="PlaySound" param="p-041"/>
						<action target="Scene" name="StepComplete" param=""/>
					</onUseObject>
					
					<onUseObject name="Paint2">
						<action target="Scene" name="RemoveFromInventory" param="Paint2"/>
						<action target="Antenna" name="SetState" param="withPaint2"/>
						<action target="Scene" name="PlaySound" param="p-041"/>
						<action target="Scene" name="StepComplete" param=""/>
					</onUseObject>
				</state>
				
				<state name="withPaint1">
					<onStateEnter>
						<action target="Scene" name="ShowLayer" param="paint bucket01"/>
					</onStateEnter>
					
					<onMouseOver>
						<action target="Scene" name="SetCursor" param="puzzle"/>
					</onMouseOver>
					
					<onClick>
						<action target="Scene" name="ShowDialog" param="one_can_click"/>
						<action target="VentWindow" name="SendEvent" param="reveal"/>
						<action target="CleaningBasketWindow" name="SendEvent" param="reveal"/>
					</onClick>
					
					<onUseObject name="Paint2">
						<action target="Scene" name="RemoveFromInventory" param="Paint2"/>
						<action target="Antenna" name="SetState" param="complete"/>
						<action target="ExitArea" name="SendEvent" param="antenna_secured"/>
						<action target="Scene" name="PlaySound" param="p-041"/>
						<action target="Scene" name="StepComplete" param=""/>
					</onUseObject>
				</state>
				
				<state name="withPaint2">
					<onStateEnter>
						<action target="Scene" name="ShowLayer" param="paint bucket02"/>
					</onStateEnter>
					
					<onMouseOver>
						<action target="Scene" name="SetCursor" param="puzzle"/>
					</onMouseOver>
					
					<onClick>
						<action target="Scene" name="ShowDialog" param="one_can_click"/>
						<action target="VentWindow" name="SendEvent" param="reveal"/>
						<action target="CleaningBasketWindow" name="SendEvent" param="reveal"/>
					</onClick>
					
					<onUseObject name="Paint1">
						<action target="Scene" name="RemoveFromInventory" param="Paint1"/>
						<action target="Antenna" name="SetState" param="complete"/>
						<action target="ExitArea" name="SendEvent" param="antenna_secured"/>
						<action target="Scene" name="PlaySound" param="p-041"/>
						<action target="Scene" name="StepComplete" param=""/>
					</onUseObject>
				</state>
				
				<state name="complete">
					<onStateEnter>
						<!--<action target="Scene" name="HideLayer" param="antene01"/>-->
						<action target="Scene" name="ShowLayer" param="paint bucket01"/>
						<action target="Scene" name="ShowLayer" param="paint bucket02"/>
						<action target="Scene" name="ShowLayer" param="antene fixed"/>
					</onStateEnter>
				</state>
			</states>
		</object>
		
		<object name="ExitArea">
			<clickStrategy type="rect" left="510" top="280" right="640" bottom="420"/>
			<states>
				<state name="notAvailable">
					<onMouseOver>
						<action target="Scene" name="SetCursor" param="noExit"/>
					</onMouseOver>
					
					<onClick>
						<action target="Scene" name="ShowDialog" param="exit_click"/>
					</onClick>
					
					<onEvent name="antenna_secured">
						<action target="ExitArea" name="SetState" param="available"/>
					</onEvent>
				</state>
				
				<state name="available">
					<onMouseOver>
						<action target="Scene" name="SetCursor" param="exit"/>
					</onMouseOver>
					
					<onClick>
						<action target="ExitArea" name="SetState" param="done"/>
						<action target="Scene" name="StartAnimation" param="DavidAnim"/>
						<action target="Scene" name="RegisterVictoryCondition" param="" delay="3500"/>
					</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>

