<scene name="BusFence" numVictoryConditions="1" numSteps="4">
	<inventory>
		<object name="Umbrella" memberName="HUD_umbrella" acquired="0" visible="0"/>
		<object name="Gum1" memberName="HUD_gum1" acquired="0" visible="0"/>
		<object name="Gum2" memberName="HUD_gum2" acquired="0" visible="0"/>
		<object name="Gum3" memberName="HUD_gum3" acquired="0" visible="0"/>
		<object name="CellPhone" memberName="HUD_cell phone" acquired="0" visible="0"/>
	</inventory>
	
	<finalStates>
		<finalState objName="FloorWindow" state="done"/>
		<finalState objName="BagWindow" state="done"/>
		<finalState objName="GumZone" state="with3Gum"/>
		<finalState objName="Wires" state="done"/>
	</finalStates>
	
	<slidersMap>
		<slider layerName="slider_R44_Debris" id="puppy"/>
	</slidersMap>
	
	<animations>
		<animation name="Light1Anim" type="once">
			<frames>
				<frame memberName="light01 on_anim" frameDelay="500"/>
				<frame memberName="light01 on_anim" frameDelay="60" blend="0"/>
			</frames>
		</animation>
		
		<animation name="Light2Anim" type="once">
			<frames>
				<frame memberName="light02 on_anim" frameDelay="600"/>
				<frame memberName="light02 on_anim" frameDelay="60" blend="0"/>
			</frames>
		</animation>
		
		<animation name="Light3Anim" type="once">
			<frames>
				<frame memberName="light03 on_anim" frameDelay="700"/>
				<frame memberName="light03 on_anim" frameDelay="60" blend="0"/>
			</frames>
		</animation>
		
		<animation name="Light4Anim" type="once">
			<frames>
				<frame memberName="light04 on_anim" frameDelay="800"/>
				<frame memberName="light04 on_anim" frameDelay="60" blend="0"/>
			</frames>
		</animation>
		
		<animation name="Light5Anim" type="once">
			<frames>
				<frame memberName="light05 on_anim" frameDelay="900"/>
				<frame memberName="light05 on_anim" frameDelay="60" blend="0"/>
			</frames>
		</animation>
		
		<!--<animation name="BottomWireAnim" type="loop">
			<frames>
				<frame memberName="wire bottom 0000.png_anim" frameDelay="60"/>
				<frame memberName="wire bottom 0001.png_anim" frameDelay="60"/>
				<frame memberName="wire bottom 0002.png_anim" frameDelay="60"/>
				<frame memberName="wire bottom 0003.png_anim" frameDelay="60"/>
				<frame memberName="wire bottom 0004.png_anim" frameDelay="60"/>
				<frame memberName="wire bottom 0005.png_anim" frameDelay="60"/>
				<frame memberName="wire bottom 0006.png_anim" frameDelay="60"/>
				<frame memberName="wire bottom 0007.png_anim" frameDelay="60"/>
				<frame memberName="wire bottom 0008.png_anim" frameDelay="60"/>
				<frame memberName="wire bottom 0009.png_anim" frameDelay="60"/>
				<frame memberName="wire bottom 0010.png_anim" frameDelay="60"/>
				<frame memberName="wire bottom 0011.png_anim" frameDelay="60"/>
				<frame memberName="wire bottom 0012.png_anim" frameDelay="60"/>
				<frame memberName="wire bottom 0013.png_anim" frameDelay="60"/>
				<frame memberName="wire bottom 0014.png_anim" frameDelay="60"/>
				<frame memberName="wire bottom 0015.png_anim" frameDelay="60"/>
				<frame memberName="wire bottom 0016.png_anim" frameDelay="60"/>
				<frame memberName="wire bottom 0017.png_anim" frameDelay="60"/>
				<frame memberName="wire bottom 0018.png_anim" frameDelay="60"/>
				<frame memberName="wire bottom 0019.png_anim" frameDelay="60"/>
				<frame memberName="wire bottom 0020.png_anim" frameDelay="60"/>
				
			</frames>
		</animation>-->
		
		<animation name="BottomWireAnim" type="loop" xpos="603" ypos="328">
			<frames>
				<frame memberName="Inside Bus Sparks_000_anim" frameDelay="60"/>
				<frame memberName="Inside Bus Sparks_001_anim" frameDelay="60"/>
				<frame memberName="Inside Bus Sparks_002_anim" frameDelay="60"/>
				<frame memberName="Inside Bus Sparks_003_anim" frameDelay="60"/>
				<frame memberName="Inside Bus Sparks_004_anim" frameDelay="60"/>
				<frame memberName="Inside Bus Sparks_005_anim" frameDelay="60"/>
				<frame memberName="Inside Bus Sparks_006_anim" frameDelay="60"/>
				<frame memberName="Inside Bus Sparks_007_anim" frameDelay="60"/>
				<frame memberName="Inside Bus Sparks_008_anim" frameDelay="60"/>
				<frame memberName="Inside Bus Sparks_009_anim" frameDelay="60"/>
				<frame memberName="Inside Bus Sparks_010_anim" frameDelay="60"/>
				<frame memberName="Inside Bus Sparks_011_anim" frameDelay="60"/>
				<frame memberName="Inside Bus Sparks_012_anim" frameDelay="60"/>
				<frame memberName="Inside Bus Sparks_013_anim" frameDelay="60"/>
				<frame memberName="Inside Bus Sparks_014_anim" frameDelay="60"/>
				<frame memberName="Inside Bus Sparks_015_anim" frameDelay="60"/>
				<frame memberName="Inside Bus Sparks_016_anim" frameDelay="60"/>
				<frame memberName="Inside Bus Sparks_017_anim" frameDelay="60"/>
				<frame memberName="Inside Bus Sparks_018_anim" frameDelay="60"/>
				<frame memberName="Inside Bus Sparks_019_anim" frameDelay="60"/>
				<frame memberName="Inside Bus Sparks_020_anim" frameDelay="60"/>
				<frame memberName="Inside Bus Sparks_021_anim" frameDelay="60"/>
				<frame memberName="Inside Bus Sparks_022_anim" frameDelay="60"/>
				<frame memberName="Inside Bus Sparks_023_anim" frameDelay="60"/>
				<frame memberName="Inside Bus Sparks_024_anim" frameDelay="60"/>
				<frame memberName="Inside Bus Sparks_025_anim" frameDelay="60"/>
				<frame memberName="Inside Bus Sparks_026_anim" frameDelay="60"/>
				<frame memberName="Inside Bus Sparks_027_anim" frameDelay="60"/>
				<frame memberName="Inside Bus Sparks_028_anim" frameDelay="60"/>
				<frame memberName="Inside Bus Sparks_029_anim" frameDelay="60"/>
			</frames>
		</animation>
		
		<animation name="MiddleWireAnim" type="loop">
			<frames>				
				<frame memberName="wire middle 0000.png_anim" frameDelay="60"/>
				<frame memberName="wire middle 0001.png_anim" frameDelay="60"/>
				<frame memberName="wire middle 0002.png_anim" frameDelay="60"/>
				<frame memberName="wire middle 0003.png_anim" frameDelay="60"/>
				<frame memberName="wire middle 0004.png_anim" frameDelay="60"/>
				<frame memberName="wire middle 0005.png_anim" frameDelay="60"/>
				<frame memberName="wire middle 0006.png_anim" frameDelay="60"/>
				<frame memberName="wire middle 0007.png_anim" frameDelay="60"/>
				<frame memberName="wire middle 0008.png_anim" frameDelay="60"/>
				<frame memberName="wire middle 0009.png_anim" frameDelay="60"/>
				<frame memberName="wire middle 0010.png_anim" frameDelay="60"/>
				<frame memberName="wire middle 0011.png_anim" frameDelay="60"/>
				<frame memberName="wire middle 0012.png_anim" frameDelay="60"/>
				<frame memberName="wire middle 0013.png_anim" frameDelay="60"/>
				<frame memberName="wire middle 0014.png_anim" frameDelay="60"/>
				<frame memberName="wire middle 0015.png_anim" frameDelay="60"/>
				<frame memberName="wire middle 0016.png_anim" frameDelay="60"/>
				<frame memberName="wire middle 0017.png_anim" frameDelay="60"/>
				<frame memberName="wire middle 0018.png_anim" frameDelay="60"/>
				<frame memberName="wire middle 0019.png_anim" frameDelay="60"/>
				<frame memberName="wire middle 0020.png_anim" frameDelay="60"/>
				<!--<frame memberName="wire middle 0021.png_anim" frameDelay="50"/>-->
			</frames>
		</animation>
		
		<animation name="TopWireAnim" type="loop">
			<frames>				
				<frame memberName="wire top 0000.png_anim" frameDelay="60"/>
				<frame memberName="wire top 0001.png_anim" frameDelay="60"/>
				<frame memberName="wire top 0002.png_anim" frameDelay="60"/>
				<frame memberName="wire top 0003.png_anim" frameDelay="60"/>
				<frame memberName="wire top 0004.png_anim" frameDelay="60"/>
				<frame memberName="wire top 0005.png_anim" frameDelay="60"/>
				<frame memberName="wire top 0006.png_anim" frameDelay="60"/>
				<frame memberName="wire top 0007.png_anim" frameDelay="60"/>
				<frame memberName="wire top 0008.png_anim" frameDelay="60"/>
				<frame memberName="wire top 0009.png_anim" frameDelay="60"/>
				<frame memberName="wire top 0010.png_anim" frameDelay="60"/>
				<frame memberName="wire top 0011.png_anim" frameDelay="60"/>
				<frame memberName="wire top 0012.png_anim" frameDelay="60"/>
				<frame memberName="wire top 0013.png_anim" frameDelay="60"/>
				<frame memberName="wire top 0014.png_anim" frameDelay="60"/>
				<frame memberName="wire top 0015.png_anim" frameDelay="60"/>
				<frame memberName="wire top 0016.png_anim" frameDelay="60"/>
				<frame memberName="wire top 0017.png_anim" frameDelay="60"/>
				<frame memberName="wire top 0018.png_anim" frameDelay="60"/>
				<frame memberName="wire top 0019.png_anim" frameDelay="60"/>
				<frame memberName="wire top 0020.png_anim" frameDelay="60"/>
				<!--<frame memberName="wire top 0021.png_anim" frameDelay="50"/>-->
			</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="FloorWindow" file="ZoomWindows\BusInside_Z1.dir" visible="0" hotspot="point(285, 515)"/>
		<zoomWindow name="BagWindow" file="ZoomWindows\BusInside_Z2.dir" visible="0" hotspot="point(745, 590)"/>
	</zoomWindows>
	
	<objects>
		<object name="Ambience">
			<states>
				<state name="Ambience">
					<onStateEnter>
						<action target="Scene" name="PlaySound" param="S-31"/>
						<action target="Scene" name="PlaySound" param="p-105"/>
					</onStateEnter>
				</state>
			</states>
		</object>

		<object name="FloorWindow">
			<clickStrategy type="rect" left="140" top="350" right="430" bottom="680"/>
			<states>
				<state name="notAvailable">
					<onStateEnter>
						<action target="Scene" name="StartAnimation" param="BottomWireAnim"/>
						<action target="Scene" name="StartAnimation" param="MiddleWireAnim"/>
						<action target="Scene" name="StartAnimation" param="TopWireAnim"/>
					</onStateEnter>
					
					<onEvent name="reveal">
						<action target="Scene" name="RevealHotspot" param="FloorWindow"/>
						<action target="FloorWindow" 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="FloorWindow"/>	
					</onClick>
				</state>
				
				<state name="done">
				</state>
			</states>
		</object>
		
		<object name="BagWindow">
			<clickStrategy type="rect" left="680" top="530" right="810" bottom="650"/>
			<states>
				<state name="notAvailable">
					<onEvent name="reveal">
						<action target="Scene" name="RevealHotspot" param="BagWindow"/>
						<action target="BagWindow" 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="BagWindow"/>	
					</onClick>
				</state>
				
				<state name="done">
				</state>
			</states>
		</object>
		
		<object name="GumZone">
			<clickStrategy type="rect" left="690" top="240" right="730" bottom="320"/>
			<states>
				<state name="noGum">
					<onStateEnter>
						<action target="Scene" name="HideLayer" param="gum1"/>
						<action target="Scene" name="HideLayer" param="gum2"/>
						<action target="Scene" name="HideLayer" param="gum3"/>
					</onStateEnter>
					
					<onMouseOver>
						<action target="Scene" name="SetCUrsor" param="puzzle"/>
					</onMouseOver>
					
					<onClick>
						<action target="Scene" name="ShowDialog" param="gumZone_click"/>
						<action target="FloorWindow" name="SendEvent" param="reveal"/>
					</onClick>
					
					<onUseObject name="Gum1">
						<action target="Scene" name="RemoveFromInventory" param="Gum1"/>
						<action target="GumZone" name="SetState" param="with1Gum"/>
						<action target="Scene" name="StepComplete" param=""/>
					</onUseObject>
					
					<onUseObject name="Gum2">
						<action target="Scene" name="RemoveFromInventory" param="Gum2"/>
						<action target="GumZone" name="SetState" param="with1Gum"/>
						<action target="Scene" name="StepComplete" param=""/>
					</onUseObject>
					
					<onUseObject name="Gum3">
						<action target="Scene" name="RemoveFromInventory" param="Gum3"/>
						<action target="GumZone" name="SetState" param="with1Gum"/>
						<action target="Scene" name="StepComplete" param=""/>
					</onUseObject>
				</state>
				
				<state name="with1Gum">
					<onStateEnter>
						<action target="Scene" name="ShowLayer" param="gum1"/>
						<action target="Scene" name="HideLayer" param="gum2"/>
						<action target="Scene" name="HideLayer" param="gum3"/>
					</onStateEnter>
					
					<onMouseOver>
						<action target="Scene" name="SetCUrsor" param="puzzle"/>
					</onMouseOver>
					
					<onUseObject name="Gum1">
						<action target="Scene" name="RemoveFromInventory" param="Gum1"/>
						<action target="GumZone" name="SetState" param="with2Gum"/>
						<action target="Scene" name="StepComplete" param=""/>
					</onUseObject>
					
					<onUseObject name="Gum2">
						<action target="Scene" name="RemoveFromInventory" param="Gum2"/>
						<action target="GumZone" name="SetState" param="with2Gum"/>
						<action target="Scene" name="StepComplete" param=""/>
					</onUseObject>
					
					<onUseObject name="Gum3">
						<action target="Scene" name="RemoveFromInventory" param="Gum3"/>
						<action target="GumZone" name="SetState" param="with2Gum"/>
						<action target="Scene" name="StepComplete" param=""/>
					</onUseObject>
				</state>
				
				<state name="with2Gum">
					<onStateEnter>
						<action target="Scene" name="ShowLayer" param="gum1"/>
						<action target="Scene" name="ShowLayer" param="gum2"/>
						<action target="Scene" name="HideLayer" param="gum3"/>
					</onStateEnter>
					
					<onMouseOver>
						<action target="Scene" name="SetCUrsor" param="puzzle"/>
					</onMouseOver>
					
					<onUseObject name="Gum1">
						<action target="Scene" name="RemoveFromInventory" param="Gum1"/>
						<action target="GumZone" name="SetState" param="with3Gum"/>
						<action target="Scene" name="StepComplete" param=""/>
					</onUseObject>
					
					<onUseObject name="Gum2">
						<action target="Scene" name="RemoveFromInventory" param="Gum2"/>
						<action target="GumZone" name="SetState" param="with3Gum"/>
						<action target="Scene" name="StepComplete" param=""/>
					</onUseObject>
					
					<onUseObject name="Gum3">
						<action target="Scene" name="RemoveFromInventory" param="Gum3"/>
						<action target="GumZone" name="SetState" param="with3Gum"/>
						<action target="Scene" name="StepComplete" param=""/>
					</onUseObject>
				</state>
				
				<state name="with3Gum">
					<onStateEnter>
						<action target="Scene" name="ShowLayer" param="gum1"/>
						<action target="Scene" name="ShowLayer" param="gum2"/>
						<action target="Scene" name="ShowLayer" param="gum3"/>
						<action target="Wires" name="SendEvent" param="gumPlaced"/>
					</onStateEnter>
				</state>
			</states>
		</object>
		
		<object name="Wires">
			<clickStrategy type="rect" left="600" top="130" right="666" bottom="325"/>	
			<states>
				<state name="dangling">
					<onStateEnter>
						<action target="Scene" name="StartAnimation" param="BottomWireAnim"/>
						<action target="Scene" name="StartAnimation" param="MiddleWireAnim"/>
						<action target="Scene" name="StartAnimation" param="TopWireAnim"/>
						<action target="Scene" name="PlaySound" param="electricity2"/>
						<action target="Scene" name="HideLayer" param="wire_bottom_attached"/>
						<action target="Scene" name="HideLayer" param="wire_middle_attached"/>
						<action target="Scene" name="HideLayer" param="wire_top_attached"/>
					</onStateEnter>
					
					<onMouseOver>
						<action target="Scene" name="SetCursor" param="interactive"/>
					</onMouseOver>
					
					<onClick>
						<action target="Scene" name="ShowDialog" param="wires_click"/>
						<action target="BagWindow" name="SendEvent" param="reveal"/>
					</onClick>
					
					<onEvent name="gumPlaced">
						<action target="Wires" name="SetState" param="readyForUmbrella"/>
					</onEvent>
				</state>
				
				<state name="readyForUmbrella">
					<onMouseOver>
						<action target="Scene" name="SetCursor" param="puzzle"/>
					</onMouseOver>
					
					<onClick>
						<action target="Scene" name="ShowDialog" param="wires_click"/>
						<action target="BagWindow" name="SendEvent" param="reveal"/>
					</onClick>
					
					<onUseObject name="Umbrella">
						<action target="Scene" name="RemoveFromInventory" param="Umbrella"/>
						<action target="Wires" name="SetState" param="clickable"/>
						<action target="Scene" name="StepComplete" param=""/>
					</onUseObject>
				</state>
				
				<state name="clickable">
					<onStateEnter>
						<action target="Scene" name="StopAnimation" param="BottomWireAnim"/>
						<action target="Scene" name="StopAnimation" param="MiddleWireAnim"/>
						<action target="Scene" name="StopAnimation" param="TopWireAnim"/>
						<action target="Scene" name="ShowLayer" param="wire_bottom_attached"/>
						<action target="Scene" name="ShowLayer" param="wire_middle_attached"/>
						<action target="Scene" name="ShowLayer" param="wire_top_attached"/>
					</onStateEnter>
					
					<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="Wires" name="SetState" param="ddone"/>
					</onClick>
				</state>
				
				<state name="ddone">
				</state>
				
				<state name="done">
					<onStateEnter>
						<action target="Scene" name="StopAnimation" param="BottomWireAnim"/>
						<action target="Scene" name="StopAnimation" param="MiddleWireAnim"/>
						<action target="Scene" name="StopAnimation" param="TopWireAnim"/>
						<action target="Scene" name="ShowLayer" param="wire_bottom_attached"/>
						<action target="Scene" name="ShowLayer" param="wire_middle_attached"/>
						<action target="Scene" name="ShowLayer" param="wire_top_attached"/>
					</onStateEnter>
					
					<onMouseOver>
						<action target="Scene" name="SetCursor" param="exit"/>
					</onMouseOver>
					
					<onClick>
						<action target="Scene" name="ReplayExit" param=""/>
					</onClick>
				</state>
			</states>
		</object>
	</objects>
</scene>