<scene name="Subway" numVictoryConditions="1" numSteps="4">
	<inventory>
		<object name="Coin" memberName="HUD_Coin" acquired="0" visible="0"/>
		<object name="Knife" memberName="HUD_Knife" acquired="0" visible="0"/>
		<object name="Wrench" memberName="HUD_Wrench" acquired="0" visible="0"/>
		<object name="Mat" memberName="HUD_Mat" acquired="0" visible="0"/>
	</inventory>
	
	<finalStates>
		<finalState objName="BenchWindow" state="unfastened"/>
		<finalState objName="TracksWindow" state="done"/>
		<finalState objName="Mat" state="acquired"/>
		<finalState objName="MatOnBus" state="done"/>
		<finalState objName="Wrench" state="acquired"/>
		<finalState objName="MatOnTurnstile" state="replayExit"/>
	</finalStates>
	
	<slidersMap>
		<slider layerName="slider_R59_Debris" id="bridge20"/>
		<slider layerName="owner_puppy" id="puppy_owner" rect="rect(706, 89, 798, 459)"/>
	</slidersMap>
	
	<animations>
		<animation name="Electricity1Anim" type="once" xpos="432" ypos="360" zpos="200" member="Subway Electricity 1"/>
		<animation name="Electricity2Anim" type="once" xpos="420" ypos="349" zpos="200" member="Subway Electricity 2"/>
		<animation name="Electricity3Anim" type="once" xpos="424" ypos="394" zpos="200" member="Subway Electricity 3"/>
		<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="BenchWindow" file="ZoomWindows\Subway_Z1.dir" visible="0" hotspot="point(600, 445)"/>
		<zoomWindow name="TracksWindow" file="ZoomWindows\Subway_Z2.dir" visible="0" hotspot="point(200, 577)"/>
	</zoomWindows>
	
	<objects>
		<object name="Ambience">
			<states>
				<state name="Ambience">
					<onStateEnter>
						<action target="Scene" name="PlaySound" param="S-31"/>
					</onStateEnter>
				</state>
			</states>
		</object>

		<object name="BenchWindow">
			<clickStrategy type="rect" left="550" top="415" right="650" bottom="475"/>
			<states>
				<state name="notAvailable">
					<onStateEnter>
						<action target="Scene" name="HideLayer" param="Bench"/>
					</onStateEnter>
					
					<onEvent name="reveal">
						<action target="Scene" name="RevealHotspot" param="BenchWindow"/>
						<action target="BenchWindow" 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="BenchWindow"/>
					</onClick>
					
					<onEvent name="bolts_removed">
						<action target="Scene" name="CloseWindow" param="BenchWindow"/>
						<action target="BenchWindow" name="SetState" param="unfastened" delay="500"/>
						<action target="Scene" name="PlaySound" param="use_pole_to_stuck_the_ball" delay="500"/>
						<action target="MatOnTurnstile" name="SendEvent" param="bench_upright"/>
					</onEvent>
				</state>
				
				<state name="unfastened">
					<onStateEnter>
						<action target="Scene" name="ShowLayer" param="Bench"/>
					</onStateEnter>
				</state>
			</states>
		</object>
		
		<object name="TracksWindow">
			<clickStrategy type="rect" left="0" top="519" right="400" bottom="635"/>
			<states>
				<state name="notAvailable">
					<onEvent name="reveal">
						<action target="Scene" name="RevealHotspot" param="TracksWindow"/>
						<action target="TracksWindow" 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="TracksWindow"/>
					</onClick>
				</state>
				
				<state name="done">
				</state>
			</states>
		</object>
		
		<object name="Mat">
			<clickStrategy type="alpha" layer="MatFloor"/>
			<states>
				<state name="attached">
					<onMouseOver>
						<action target="Scene" name="SetCursor" param="puzzle"/>
					</onMouseOver>
					
					<onClick>
						<action target="Scene" name="ShowDialog" param="mat_click"/>
						<action target="TracksWindow" name="SendEvent" param="reveal"/>
					</onClick>
					
					<onUseObject name="Knife">
						<action target="Scene" name="RemoveFromInventory" param="Knife"/>
						<action target="Scene" name="AddToInventory" param="Mat"/>
						<action target="Mat" name="SetState" param="acquired"/>
						<action target="Scene" name="PlaySound" param="p-116"/>
						<action target="Scene" name="StepComplete" param=""/>
					</onUseObject>
				</state>
				
				<state name="acquired">
					<onStateEnter>
						<action target="Scene" name="HideLayer" param="MatFloor"/>
					</onStateEnter>
				</state>
			</states>
		</object>
		
		<object name="MatOnBus">
			<clickStrategy type="rect" left="85" top="287" right="144" bottom="342"/>
			<states>
				<state name="noMat">
					<onStateEnter>
						<action target="Scene" name="HideLayer" param="MatSubway"/>
					</onStateEnter>
					
					<onMouseOver>
						<action target="Scene" name="SetCursor" param="puzzle"/>
					</onMouseOver>
					
					<onClick>
						<action target="Scene" name="ShowDialog" param="try_to_get_wrench"/>
					</onClick>
					
					<onUseObject name="Mat">
						<action target="Scene" name="RemoveFromInventory" param="Mat"/>
						<action target="MatOnBus" name="SetState" param="withMat"/>
						<action target="Wrench" name="SendEvent" param="mat_placed"/>
						<action target="Scene" name="PlaySound" param="p-117"/>
					</onUseObject>
				</state>
				
				<state name="withMat">
					<onStateEnter>
						<action target="Scene" name="ShowLayer" param="MatSubway"/>
					</onStateEnter>
					
					<onMouseOver>
						<action target="Scene" name="SetCursor" param="interactive"/>
					</onMouseOver>
					
					<onClick>
						<action target="Scene" name="AddToInventory" param="Mat"/>
						<action target="MatOnBus" name="SetState" param="noMat"/>
						<action target="Wrench" name="SendEvent" param="mat_removed"/>
					</onClick>
				</state>
				
				<state name="done">
					<onStateEnter>
						<action target="Scene" name="HideLayer" param="MatSubway"/>
					</onStateEnter>
				</state>
			</states>
		</object>
		
		<object name="Wrench">
			<clickStrategy type="rect" left="80" top="253" right="115" bottom="280"/>
			<states>
				<state name="noMat">
					<onEvent name="mat_placed">
						<action target="Wrench" name="SetState" param="withMat"/>
					</onEvent>
				</state>
				
				<state name="withMat">
					<onMouseOver>
						<action target="Scene" name="SetCursor" param="interactive"/>
					</onMouseOver>
					
					<onClick>
						<action target="Scene" name="AddToInventory" param="Wrench"/>
						<action target="Wrench" name="SetState" param="acquired"/>
						<action target="Scene" name="PlaySound" param="Item_Pickup_Metal_small"/>
						<action target="Scene" name="StepComplete" param=""/>
					</onClick>
					
					<onEvent name="mat_removed">
						<action target="Wrench" name="SetState" param="noMat"/>
					</onEvent>
				</state>
				
				<state name="acquired">
					<onStateEnter>
						<action target="Scene" name="HideLayer" param="Wrench"/>
					</onStateEnter>
				</state>
			</states>
		</object>
		
		<object name="MatOnTurnstile">
			<clickStrategy type="rect" left="340" top="265" right="510" bottom="475"/>
			<states>
				<state name="noMat">
					<onStateEnter>
						<action target="Scene" name="HideLayer" param="MatEntry"/>
					</onStateEnter>
					
					<onMouseOver>
						<action target="Scene" name="SetCursor" param="puzzle"/>
					</onMouseOver>
					
					<onClick>
						<action target="Scene" name="ShowDialog" param="turnstile_click"/>
						<action target="BenchWindow" name="SendEvent" param="reveal"/>
					</onClick>
					
					<onEvent name="bench_upright">
						<action target="MatOnTurnstile" name="SetState" param="benchPlaced"/>
						<action target="Scene" name="PlaySound" param="p-119"/>
						<action target="Scene" name="StepComplete" param=""/>
					</onEvent>
					
					<onUseObject name="Coin">
						<action target="Scene" name="RemoveFromInventory" param="Coin"/>
						<action target="Scene" name="ShowDialog" param="use_coin"/>
						<action target="Scene" name="PlaySound" param="p-118"/>
					</onUseObject>
				</state>
				
				<state name="benchPlaced">
					<onMouseOver>
						<action target="Scene" name="SetCursor" param="puzzle"/>
					</onMouseOver>
					
					<onClick>
						<action target="Scene" name="ShowDialog" param="turnstile_click"/>
						<action target="BenchWindow" name="SendEvent" param="reveal"/>
					</onClick>
					
					<onUseObject name="Mat">
						<action target="Scene" name="RemoveFromInventory" param="Mat"/>
						<action target="MatOnTurnstile" name="SetState" param="matPlaced"/>
						<action target="Scene" name="PlaySound" param="p-117"/>
						<action target="Scene" name="StepComplete" param=""/>
					</onUseObject>
					
					<onUseObject name="Coin">
						<action target="Scene" name="RemoveFromInventory" param="Coin"/>
						<action target="Scene" name="ShowDialog" param="use_coin"/>
					</onUseObject>
				</state>
				
				<state name="matPlaced">
					<onStateEnter>
						<action target="Scene" name="ShowLayer" param="MatEntry"/>
					</onStateEnter>
					
					<onMouseOver>
						<action target="Scene" name="SetCursor" param="exit"/>
					</onMouseOver>
					
					<onClick>
						<action target="MatOnTurnstile" name="SetState" param="done"/>
						<action target="BenchWindow" name="SendEvent" param="reveal"/>
						<action target="Scene" name="StartAnimation" param="DavidAnim"/>
						<action target="Scene" name="RegisterVictoryCondition" param="" delay="1500"/>
					</onClick>
					
					<onUseObject name="Coin">
						<action target="Scene" name="RemoveFromInventory" param="Coin"/>
						<action target="Scene" name="ShowDialog" param="use_coin"/>
					</onUseObject>
				</state>
				
				<state name="done">
					<onStateEnter>
						<action target="Scene" name="ShowLayer" param="MatEntry"/>
					</onStateEnter>
				</state>
				
				<state name="replayExit">
					<onStateEnter>
						<action target="Scene" name="ShowLayer" param="MatEntry"/>
					</onStateEnter>
					
					<onMouseOver>
						<action target="Scene" name="SetCursor" param="exit"/>
					</onMouseOver>
					
					<onClick>
						<action target="Scene" name="ReplayExit" param=""/>
					</onClick>
				</state>
			</states>
		</object>
	</objects>
</scene>