<scene name="MallBackdoor" numVictoryConditions="1" numSteps="6">
	<inventory>
		<object name="Tape" memberName="HUD_tape" acquired="0" visible="0"/>
		<object name="Cutter" memberName="HUD_cutter" acquired="0" visible="0">
			<onUseObject name="CoatHanger">
				<action target="RemoveCutterLock" name="UnlockPart" param="OnCoatHanger"/>
				<action target="Scene" name="RemoveFromInventory" param="CoatHanger"/>
				<action target="Scene" name="AddToInventory" param="CoatHangerWire"/>				
				<action target="Scene" name="StepComplete" param=""/>
			</onUseObject>
		</object>
		<object name="CoatHanger" memberName="HUD_coat hanger" acquired="0" visible="0">
			<onUseObject name="Cutter">
				<action target="RemoveCutterLock" name="UnlockPart" param="OnCoatHanger"/>
				<action target="Scene" name="RemoveFromInventory" param="CoatHanger"/>
				<action target="Scene" name="AddToInventory" param="CoatHangerWire"/>				
				<action target="Scene" name="StepComplete" param=""/>
			</onUseObject>
		</object>
		<object name="CoatHangerCut" memberName="HUD_coat hanger cut" acquired="0" visible="0"/>
		<object name="CoatHangerWire" memberName="HUD_coat hanger wire" acquired="0" visible="0"/>
		<object name="Button" memberName="HUD_button" acquired="0" visible="0"/>
	</inventory>
	
	<finalStates>
		<finalState objName="BoxWindow" state="done"/>
		<finalState objName="ShelfWindow" state="done"/>
		<finalState objName="Wires" state="complete"/>
		<finalState objName="Button" state="done"/>
		<finalState objName="Door" state="done"/>
	</finalStates>
	
	<slidersMap>
		<slider layerName="slider_L74_Debris" id="bridge16"/>
	</slidersMap>
	
	<animations>
		<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>
	
	<locks>
		<lock name="RemoveCutterLock">
			<parts>
				<part name="OnCoatHanger" state="locked"/>
				<part name="OnWires" state="locked"/>
			</parts>
			<onUnlocked>
				<action target="Scene" name="RemoveFromInventory" param="Cutter"/>
			</onUnlocked>
		</lock>		
	</locks>
	
	<zoomWindows>
		<zoomWindow name="BoxWindow" file="ZoomWindows\MallBackdoor_Z1.dir" visible="0" hotspot="point(697, 617)"/>
		<zoomWindow name="ShelfWindow" file="ZoomWindows\MallBackdoor_Z2.dir" visible="0" hotspot="point(175, 447)"/>
	</zoomWindows>
	
	<objects>
		<object name="Ambience">
			<states>
				<state name="Ambience">
					<onStateEnter>
						<action target="Scene" name="PlaySound" param="S-31"/>
					</onStateEnter>
				</state>
			</states>
		</object>

		<object name="BoxWindow">
			<clickStrategy type="rect" left="635" top="575" right="760" bottom="660"/>
			<states>
				<state name="notAvailable">
					<onEvent name="reveal">
						<action target="Scene" name="RevealHotspot" param="BoxWindow"/>
						<action target="BoxWindow" 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="BoxWindow"/>
					</onClick>
				</state>
				
				<state name="done">
				</state>
			</states>
		</object>
		
		<object name="ShelfWindow">
			<clickStrategy type="rect" left="105" top="380" right="245" bottom="515"/>
			<states>
				<state name="notAvailable">
					<onEvent name="reveal">
						<action target="Scene" name="RevealHotspot" param="ShelfWindow"/>
						<action target="ShelfWindow" 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="ShelfWindow"/>
					</onClick>
					
					<onEvent name="coatHanger_acquired">
						<action target="Scene" name="HideLayer" param="coat hanger"/>
					</onEvent>
				</state>
				
				<state name="done">
					<onStateEnter>
						<action target="Scene" name="HideLayer" param="coat hanger"/>
					</onStateEnter>
				</state>
			</states>
		</object>
		
		<object name="Wires">
			<clickStrategy type="alpha" layer="wire fixed01"/>
			<states>
				<state name="crazy">
					<onStateEnter>
						<action target="Scene" name="HideLayer" param="wire fixed01"/>
						<action target="Scene" name="HideLayer" param="wire fixed02 (coat hanger wire)"/>
						<action target="Scene" name="HideLayer" param="wire fixed03 (tape)"/>
					</onStateEnter>
					
					<onMouseOver>
						<action target="Scene" name="SetCursor" param="puzzle"/>
					</onMouseOver>
					
					<onClick>
						<action target="Scene" name="ShowDialog" param="wire_click"/>
						<action target="ShelfWindow" name="SendEvent" param="reveal"/>
					</onClick>
					
					<onUseObject name="Cutter">
						<action target="RemoveCutterLock" name="UnlockPart" param="OnWires"/>
						<action target="Wires" name="SetState" param="straightened"/>
						<action target="Scene" name="StepComplete" param=""/>
					</onUseObject>
				</state>
				
				<state name="straightened">
					<onStateEnter>
						<action target="Scene" name="ShowLayer" param="wire fixed01"/>
					</onStateEnter>
					
					<onMouseOver>
						<action target="Scene" name="SetCursor" param="puzzle"/>
					</onMouseOver>
					
					<onClick>
						<action target="Scene" name="ShowDialog" param="wire_click"/>
						<action target="ShelfWindow" name="SendEvent" param="reveal"/>
					</onClick>
					
					<onUseObject name="CoatHangerWire">
						<action target="Scene" name="RemoveFromInventory" param="CoatHangerWire"/>
						<action target="Wires" name="SetState" param="withWire"/>
						<action target="Scene" name="StepComplete" param=""/>
					</onUseObject>
				</state>
				
				<state name="withWire">
					<onStateEnter>
						<action target="Scene" name="ShowLayer" param="wire fixed02 (coat hanger wire)"/>
					</onStateEnter>
					
					<onMouseOver>
						<action target="Scene" name="SetCursor" param="puzzle"/>
					</onMouseOver>
					
					<onClick>
						<action target="Scene" name="ShowDialog" param="wire_click"/>
						<action target="ShelfWindow" name="SendEvent" param="reveal"/>
					</onClick>
					
					<onUseObject name="Tape">
						<action target="Scene" name="RemoveFromInventory" param="Tape"/>
						<action target="Wires" name="SetState" param="complete"/>
						<action target="Scene" name="PlaySound" param="p-098"/>
						<action target="Scene" name="StepComplete" param=""/>
					</onUseObject>
				</state>
				
				<state name="complete">
					<onStateEnter>
						<action target="Scene" name="ShowLayer" param="wire fixed03 (tape)"/>
					</onStateEnter>
					
					<onEvent name="button_pushed">
						<action target="Door" name="SendEvent" param="open"/>
						<action target="Scene" name="StepComplete" param=""/>
					</onEvent>
				</state>
			</states>
		</object>
		
		<object name="Button">
			<clickStrategy type="rect" left="819" top="373" right="853" bottom="430"/>
			<states>
				<state name="damaged">
					<onStateEnter>
						<action target="Scene" name="HideLayer" param="button fixed"/>
					</onStateEnter>
					
					<onMouseOver>
						<action target="Scene" name="SetCursor" param="puzzle"/>
					</onMouseOver>
					
					<onClick>
						<action target="Scene" name="ShowDialog" param="button_broken"/>
						<action target="BoxWindow" name="SendEvent" param="reveal"/>
					</onClick>
					
					<onUseObject name="Button">
						<action target="Scene" name="RemoveFromInventory" param="Button"/>
						<action target="Button" name="SetState" param="withButton"/>
						<action target="Scene" name="StepComplete" param=""/>
					</onUseObject>
				</state>
				
				<state name="withButton">
					<onStateEnter>
						<action target="Scene" name="ShowLayer" param="button fixed"/>
					</onStateEnter>
					
					<onMouseOver>
						<action target="Scene" name="SetCursor" param="interactive"/>
					</onMouseOver>
					
					<onClick>
						<action target="Wires" name="SendEvent" param="button_pushed"/>
						<action target="BoxWindow" name="SendEvent" param="reveal"/>
						<action target="Scene" name="PlaySound" param="p-097"/>
					</onClick>
				</state>
				
				<state name="done">
					<onStateEnter>
						<action target="Scene" name="ShowLayer" param="button fixed"/>
					</onStateEnter>
				</state>
			</states>
		</object>
		
		<object name="Door">
			<clickStrategy type="alpha" layer="door open glow"/>
			<states>
				<state name="closed">
					<onStateEnter>
						<action target="Scene" name="HideLayer" param="door open"/>
						<action target="Scene" name="HideLayer" param="door open light"/>
						<action target="Scene" name="HideLayer" param="door open glow"/>
					</onStateEnter>
					
					<onEvent name="open">
						<action target="Door" name="SetState" param="open"/>
						<action target="Scene" name="PlaySound" param="p-099_2"/>
					</onEvent>
				</state>
				
				<state name="open">
					<onStateEnter>
						<action target="Scene" name="ShowLayer" param="door open"/>
						<action target="Scene" name="ShowLayer" param="door open light"/>
						<action target="Scene" name="ShowLayer" param="door open glow"/>
					</onStateEnter>
					
					<onMouseOver>
						<action target="Scene" name="SetCursor" param="exit"/>
					</onMouseOver>
					
					<onClick>
						<action target="Door" name="SetState" param="ddone"/>
						<action target="Scene" name="StartAnimation" param="DavidAnim"/>
						<action target="Scene" name="RegisterVictoryCondition" param="" delay="1500"/>
					</onClick>
				</state>
				
				<state name="ddone">
				</state>
				
				<state name="done">
					<onStateEnter>
						<action target="Scene" name="ShowLayer" param="door open"/>
						<action target="Scene" name="ShowLayer" param="door open light"/>
						<action target="Scene" name="ShowLayer" param="door open glow"/>
					</onStateEnter>
					
					<onMouseOver>
						<action target="Scene" name="SetCursor" param="exit"/>
					</onMouseOver>
					
					<onClick>
						<action target="Scene" name="ReplayExit" param=""/>
					</onClick>
				</state>
			</states>
		</object>
	</objects>
</scene>

