<scene name="TheHouse" numVictoryConditions="1" numSteps="2">
	<inventory>
		<!--<object name="CellPhone" memberName="HUD_cellPhone" acquired="0" visible="1"/>
		<object name="Map" memberName="HUD_map" acquired="0" visible="1"/>-->
	</inventory>
	
	<finalStates>
		<finalState objName="CellPhone" state="found"/>
		<finalState objName="Map" state="found"/>
		<finalState objName="Door" state="replayExit"/>
	</finalStates>
	
	<animations>
		<animation name="CurtainAnim" type="loop" zpos="5">
			<frames>
				<frame memberName="curtain01_anim" frameDelay="128"/>
				<frame memberName="curtain02_anim" frameDelay="128"/>
				<frame memberName="curtain03_anim" frameDelay="128"/>
				<frame memberName="curtain04_anim" frameDelay="128"/>
				<frame memberName="curtain05_anim" frameDelay="128"/>
				<frame memberName="curtain06_anim" frameDelay="128"/>
				<frame memberName="curtain07_anim" frameDelay="128"/>
				<frame memberName="curtain08_anim" frameDelay="128"/>
				<frame memberName="curtain09_anim" frameDelay="128"/>
				<frame memberName="curtain10_anim" frameDelay="128"/>
				<frame memberName="curtain11_anim" frameDelay="128"/>
				<frame memberName="curtain12_anim" frameDelay="128"/>
				<frame memberName="curtain13_anim" frameDelay="128"/>
				<frame memberName="curtain14_anim" frameDelay="128"/>
				<frame memberName="curtain15_anim" frameDelay="128"/>
				<frame memberName="curtain16_anim" frameDelay="128"/>
				<frame memberName="curtain17_anim" frameDelay="128"/>
				<frame memberName="curtain18_anim" frameDelay="128"/>
				<frame memberName="curtain19_anim" frameDelay="128"/>
				<frame memberName="curtain20_anim" frameDelay="128"/>
				<frame memberName="curtain21_anim" frameDelay="128"/>
				<frame memberName="curtain22_anim" frameDelay="128"/>
				<frame memberName="curtain23_anim" frameDelay="128"/>
				<frame memberName="curtain24_anim" frameDelay="128"/>
				<frame memberName="curtain25_anim" frameDelay="128"/>
				<frame memberName="curtain26_anim" frameDelay="128"/>
				<frame memberName="curtain27_anim" frameDelay="128"/>
				<frame memberName="curtain28_anim" frameDelay="128"/>
				<frame memberName="curtain29_anim" frameDelay="128"/>
				<frame memberName="curtain30_anim" frameDelay="128"/>
				<frame memberName="curtain31_anim" frameDelay="128"/>
				<frame memberName="curtain32_anim" frameDelay="128"/>
				<frame memberName="curtain33_anim" frameDelay="128"/>
				<frame memberName="curtain34_anim" frameDelay="128"/>
				<frame memberName="curtain35_anim" frameDelay="128"/>
			</frames>
		</animation>
		
		<animation name="LeftWindowAnim" type="loop" xpos="243" ypos="264" zpos="200" ink="33" crossfade="1">
			<frames>
				<frame memberName="House Window Shine Left_000_anim" frameDelay="500"/>
				<frame memberName="House Window Shine Left_001_anim" frameDelay="500"/>
				<frame memberName="House Window Shine Left_002_anim" frameDelay="500"/>
				<frame memberName="House Window Shine Left_003_anim" frameDelay="500"/>
				<frame memberName="House Window Shine Left_004_anim" frameDelay="500"/>
				<frame memberName="House Window Shine Left_005_anim" frameDelay="500"/>
			</frames>
		</animation>
		
		<animation name="RightWindowAnim" type="loop" xpos="657" ypos="313" zpos="200" ink="33" crossfade="1">
			<frames>
				<frame memberName="House Window Shine Right_000_anim" frameDelay="500"/>
				<frame memberName="House Window Shine Right_001_anim" frameDelay="500"/>
				<frame memberName="House Window Shine Right_002_anim" frameDelay="500"/>
				<frame memberName="House Window Shine Right_003_anim" frameDelay="500"/>
				<frame memberName="House Window Shine Right_004_anim" frameDelay="500"/>
				<frame memberName="House Window Shine Right_005_anim" frameDelay="500"/>
			</frames>
		</animation>
		
		<animation name="TopWindowAnim" type="loop" xpos="473" ypos="150" zpos="200" ink="33" crossfade="1">
			<frames>
				<frame memberName="House Window Shine Top_000_anim" frameDelay="500"/>
				<frame memberName="House Window Shine Top_001_anim" frameDelay="500"/>
				<frame memberName="House Window Shine Top_002_anim" frameDelay="500"/>
				<frame memberName="House Window Shine Top_003_anim" frameDelay="500"/>
				<frame memberName="House Window Shine Top_004_anim" frameDelay="500"/>
				<frame memberName="House Window Shine Top_005_anim" frameDelay="500"/>
			</frames>
		</animation>
		
		<animation name="DavidAnim" type="once" zpos="200" crossfade="1">
			<frames>
				<frame memberName="adamforeground_anim" frameDelay="500"/>
				<frame memberName="adammidground_anim" frameDelay="500"/>
				<frame memberName="adambackground_anim" frameDelay="500"/>
			</frames>
		</animation>
	</animations>
	
	<zoomWindows>
	</zoomWindows>
	
	<locks>
		<lock name="DoorLock">
			<parts>
				<part name="CellPhone" state="locked"/>
				<part name="Map" state="locked"/>
			</parts>
			<onUnlocked>
				<action target="Door" name="SetState" param="Openable"/>
				<action target="Scene" name="ShowDialog" param="gear_acquired"/>
			</onUnlocked>
		</lock>		
	</locks>
	
	<objects>
		<object name="Ambience">
			<states>
				<state name="Ambience">
					<onStateEnter>
						<action target="Scene" name="StartAnimation" param="CurtainAnim"/>
						<action target="Scene" name="StartAnimation" param="LeftWindowAnim"/>
						<action target="Scene" name="StartAnimation" param="RightWindowAnim"/>
						<action target="Scene" name="StartAnimation" param="TopWindowAnim"/>
					</onStateEnter>
				</state>
			</states>
		</object>
		
		<object name="CellPhone">
			<clickStrategy type="alpha" layer="cell phone"/>
			<states>
				<state name="clickable">
					<onStateEnter>
						<action target="Scene" name="ShowLayer" param="cell phone"/>
						<action target="Scene" name="PlaySound" param="S-31"/>
					</onStateEnter>
					
					<onMouseOver>
						<action target="Scene" name="SetCursor" param="interactive"/>
					</onMouseOver>

					<onClick>
						<action target="Scene" name="AddToInventory" param="CellPhone"/>						
						<action target="CellPhone" name="SetState" param="found"/>
						<action target="DoorLock" name="UnlockPart" param="CellPhone"/>
						<action target="Scene" name="PlaySound" param="pickup_wire"/>
						<action target="Scene" name="StepComplete" param=""/>
					</onClick>
				</state>

				<state name="found">
					<onStateEnter>
						<action target="Scene" name="HideLayer" param="cell phone"/>
					</onStateEnter>
				</state>
			</states>
		</object>
		
		<object name="Map">
			<clickStrategy type="alpha" layer="map"/>
			<states>
				<state name="clickable">
					<onStateEnter>
						<action target="Scene" name="ShowLayer" param="map"/>
					</onStateEnter>
					
					<onMouseOver>
						<action target="Scene" name="SetCursor" param="interactive"/>
					</onMouseOver>

					<onClick>
						<action target="Scene" name="AddToInventory" param="Map"/>
						<action target="Map" name="SetState" param="found"/>
						<action target="DoorLock" name="UnlockPart" param="Map"/>
						<action target="Scene" name="PlaySound" param="pickup_wire"/>
						<action target="Scene" name="StepComplete" param=""/>
					</onClick>
				</state>

				<state name="found">
					<onStateEnter>
						<action target="Scene" name="HideLayer" param="map"/>
					</onStateEnter>
				</state>
			</states>
		</object>
		
		<object name="Door">
			<clickStrategy type="rect" left="248" top="78" right="420" bottom="505"/>
			<states>
				<state name="Closed">
					<onStateEnter>
						<action target="Scene" name="HideLayer" param="door open"/>
					</onStateEnter>
					
					<onMouseOver>
						<action target="Scene" name="SetCursor" param="noExit"/>
					</onMouseOver>

					<onClick>
						<action target="Scene" name="ShowDialog" param="get_gear"/>
					</onClick>
				</state>

				<state name="Openable">
					<onStateEnter>
						<action target="Scene" name="HideLayer" param="door open"/>
					</onStateEnter>
					
					<onMouseOver>
						<action target="Scene" name="SetCursor" param="exit"/>
					</onMouseOver>
					
					<onClick>
						<action target="Door" name="SetState" param="open"/>
						<action target="Scene" name="PlaySound" param="p-001"/>
						<action target="Scene" name="StartAnimation" param="DavidAnim"/>
						<action target="Scene" name="RegisterVictoryCondition" param="" delay="1500"/>
					</onClick>
				</state>
				
				<state name="open">
					<onStateEnter>
						<action target="Scene" name="ShowLayer" param="door open"/>
					</onStateEnter>
				</state>
				
				<state name="replayExit">
					<onStateEnter>
						<action target="Scene" name="ShowLayer" param="door open"/>
					</onStateEnter>
					
					<onMouseOver>
						<action target="Scene" name="SetCursor" param="exit"/>
					</onMouseOver>
					
					<onClick>
						<action target="Scene" name="ReplayExit" param=""/>
					</onClick>
				</state>
			</states>
		</object>
	</objects>
</scene>

