<scene name="Room27" numVictoryConditions="1">
	<inventory>
		<object name="Bayonette" memberName="HUD_bayonette" acquired="0" visible="1">
			<onUseObject name="Gun">
				<action target="Scene" name="RemoveFromInventory" param="Bayonette"/>
				<action target="Scene" name="RemoveFromInventory" param="Gun"/>
				<action target="Scene" name="AddToInventory" param="GunAndBayonette"/>
				<action target="Scene" name="PlaySound" param="attach_bayonet"/>
			</onUseObject>
		</object>
		<object name="Gun" memberName="HUD_gun" acquired="0" visible="1">
			<onUseObject name="Bayonette">
				<action target="Scene" name="RemoveFromInventory" param="Bayonette"/>
				<action target="Scene" name="RemoveFromInventory" param="Gun"/>
				<action target="Scene" name="AddToInventory" param="GunAndBayonette"/>
				<action target="Scene" name="PlaySound" param="attach_bayonet"/>
			</onUseObject>
		</object>
		<object name="GunAndBayonette" memberName="HUD_gunAndBayonette" acquired="0" visible="0"/>
		<object name="Flag1" memberName="HUD_flag1" acquired="0" visible="1">
			<onUseObject name="Flag2">
				<action target="Scene" name="RemoveFromInventory" param="Flag1"/>
				<action target="Scene" name="RemoveFromInventory" param="Flag2"/>
				<action target="Scene" name="AddToInventory" param="FlagRope"/>
				<action target="Scene" name="PlaySound" param="tie_flags_together"/>
			</onUseObject>
		</object>
		<object name="Flag2" memberName="HUD_flag2" acquired="0" visible="1">
			<onUseObject name="Flag1">
				<action target="Scene" name="RemoveFromInventory" param="Flag1"/>
				<action target="Scene" name="RemoveFromInventory" param="Flag2"/>
				<action target="Scene" name="AddToInventory" param="FlagRope"/>
				<action target="Scene" name="PlaySound" param="tie_flags_together"/>
			</onUseObject>
		</object>
		<object name="FlagRope" memberName="HUD_flagRope" acquired="0" visible="0"/>		
	</inventory>
	
	<finalStates>
		<finalState objName="Bayonette" state="acquired"/>
		<finalState objName="FuseBox" state="powerOff"/>
		<finalState objName="Case" state="noGun"/>
		<finalState objName="Chandelier" state="throughFloor"/>
		<finalState objName="Flag1" state="acquired"/>
		<finalState objName="Flag2" state="acquired"/>
		<finalState objName="Hole" state="readyForExit"/>
	</finalStates>
	
	<animations>
		<animation name="ChandelierOffAnim" type="loop" xpos="234" ypos="214">
			<frames>
				<frame memberName="chandelierOff1_anim" frameDelay="4"/>
				<frame memberName="chandelierOff2_anim" frameDelay="4"/>
				<frame memberName="chandelierOff3_anim" frameDelay="4"/>
				<frame memberName="chandelierOff4_anim" frameDelay="4"/>
				<frame memberName="chandelierOff5_anim" frameDelay="4"/>
				<frame memberName="chandelierOff6_anim" frameDelay="4"/>
				<frame memberName="chandelierOff7_anim" frameDelay="4"/>
				<frame memberName="chandelierOff8_anim" frameDelay="4"/>
				<frame memberName="chandelierOff9_anim" frameDelay="4"/>
				<frame memberName="chandelierOff10_anim" frameDelay="4"/>
				<frame memberName="chandelierOff11_anim" frameDelay="4"/>
				<frame memberName="chandelierOff12_anim" frameDelay="4"/>
				<frame memberName="chandelierOff13_anim" frameDelay="4"/>
				<frame memberName="chandelierOff14_anim" frameDelay="4"/>
				<frame memberName="chandelierOff15_anim" frameDelay="4"/>
				<frame memberName="chandelierOff16_anim" frameDelay="4"/>
				<frame memberName="chandelierOff17_anim" frameDelay="4"/>
				<frame memberName="chandelierOff18_anim" frameDelay="4"/>
				<frame memberName="chandelierOff19_anim" frameDelay="4"/>
				<frame memberName="chandelierOff20_anim" frameDelay="4"/>
				<frame memberName="chandelierOff21_anim" frameDelay="4"/>
				<frame memberName="chandelierOff22_anim" frameDelay="4"/>
				<frame memberName="chandelierOff23_anim" frameDelay="4"/>
				<frame memberName="chandelierOff24_anim" frameDelay="4"/>
				<frame memberName="chandelierOff25_anim" frameDelay="4"/>
				<frame memberName="chandelierOff26_anim" frameDelay="4"/>
				<frame memberName="chandelierOff27_anim" frameDelay="4"/>
				<frame memberName="chandelierOff28_anim" frameDelay="4"/>
				<frame memberName="chandelierOff29_anim" frameDelay="4"/>
				<frame memberName="chandelierOff30_anim" frameDelay="4"/>
				<frame memberName="chandelierOff31_anim" frameDelay="4"/>
			</frames>
		</animation>
		
		<animation name="ChandelierOnAnim" type="loop" xpos="234" ypos="214">
			<frames>
				<frame memberName="chandelierOn1_anim" frameDelay="4"/>
				<frame memberName="chandelierOn2_anim" frameDelay="4"/>
				<frame memberName="chandelierOn3_anim" frameDelay="4"/>
				<frame memberName="chandelierOn4_anim" frameDelay="4"/>
				<frame memberName="chandelierOn5_anim" frameDelay="4"/>
				<frame memberName="chandelierOn6_anim" frameDelay="4"/>
				<frame memberName="chandelierOn7_anim" frameDelay="4"/>
				<frame memberName="chandelierOn8_anim" frameDelay="4"/>
				<frame memberName="chandelierOn9_anim" frameDelay="4"/>
				<frame memberName="chandelierOn10_anim" frameDelay="4"/>
				<frame memberName="chandelierOn11_anim" frameDelay="4"/>
				<frame memberName="chandelierOn12_anim" frameDelay="4"/>
				<frame memberName="chandelierOn13_anim" frameDelay="4"/>
				<frame memberName="chandelierOn14_anim" frameDelay="4"/>
				<frame memberName="chandelierOn15_anim" frameDelay="4"/>
				<frame memberName="chandelierOn16_anim" frameDelay="4"/>
				<frame memberName="chandelierOn17_anim" frameDelay="4"/>
				<frame memberName="chandelierOn18_anim" frameDelay="4"/>
				<frame memberName="chandelierOn19_anim" frameDelay="4"/>
				<frame memberName="chandelierOn20_anim" frameDelay="4"/>
				<frame memberName="chandelierOn21_anim" frameDelay="4"/>
				<frame memberName="chandelierOn22_anim" frameDelay="4"/>
				<frame memberName="chandelierOn23_anim" frameDelay="4"/>
				<frame memberName="chandelierOn24_anim" frameDelay="4"/>
				<frame memberName="chandelierOn25_anim" frameDelay="4"/>
				<frame memberName="chandelierOn26_anim" frameDelay="4"/>
				<frame memberName="chandelierOn27_anim" frameDelay="4"/>
				<frame memberName="chandelierOn28_anim" frameDelay="4"/>
				<frame memberName="chandelierOn29_anim" frameDelay="4"/>
				<frame memberName="chandelierOn30_anim" frameDelay="4"/>
				<frame memberName="chandelierOn31_anim" frameDelay="4"/>
			</frames>
		</animation>
	</animations>
	
	<zoomWindows>
		<zoomWindow name="FuseBoxWindow" file="ZoomWindows\Room27_FuseBoxWindow.dir" x="580" y="270" visible="0"/>
		<zoomWindow name="CaseWindow" file="ZoomWindows\Room27_CaseWindow.dir" x="650" y="210" visible="0"/>
	</zoomWindows>
	
	<objects>
		<object name="Bayonette">
			<clickStrategy type="alpha" layer="Bayonette"/>
			<states>
				<state name="clickable">
					<onStateEnter>
						<action target="Scene" name="HideLayer" param="Bayonette"/>
						<action target="Scene" name="PlaySound" param="indoor_small"/>
						<action target="Scene" name="PlaySound" param="circuit3"/>
					</onStateEnter>
					
					<onMouseOver>
						<action target="Scene" name="SetCursor" param="interactive"/>
					</onMouseOver>					
					
					<onClick>
						<action target="Scene" name="AddToInventory" param="Bayonette"/>
						<action target="Bayonette" name="SetState" param="acquired"/>
						<action target="Scene" name="PlaySound" param="Item_Pickup_Metal_small"/>
					</onClick>
				</state>
				
				<state name="acquired">
					<onStateEnter><action target="Scene" name="ShowLayer" param="Bayonette"/></onStateEnter>
				</state>
			</states>
		</object>		
		
		<object name="FuseBox">
			<clickStrategy type="alpha" layer="OpenFuseBox"/>
			<states>
				<state name="closed">
					<onStateEnter>
						<action target="Scene" name="HideLayer" param="OpenFuseBox"/>
						<action target="Scene" name="HideLayer" param="PowerOff"/>
					</onStateEnter>
					
					<onMouseOver>
						<action target="Scene" name="SetCursor" param="zoom"/>
					</onMouseOver>					
					
					<onClick>
						<action target="Scene" name="OpenWindow" param="FuseBoxWindow"/>
						<action target="FuseBox" name="SetState" param="open"/>
						<action target="Scene" name="PlaySound" param="lockpick"/>
						<action target="Scene" name="PlaySound" param="open_fusebox"/>
					</onClick>
				</state>
				
				<state name="open">
					<onStateEnter>
						<action target="Scene" name="ShowLayer" param="OpenFuseBox"/>
						<action target="Scene" name="ShowLayer" param="PowerOff"/>
					</onStateEnter>
					
					<onMouseOver>
						<action target="Scene" name="SetCursor" param="zoom"/>
					</onMouseOver>					
					
					<onClick><action target="Scene" name="OpenWindow" param="FuseBoxWindow"/></onClick>
					
					<onEvent name="powerOn">
						<action target="FuseBox" name="SetState" param="powerOn"/>
						<action target="Case" name="SendEvent" param="powerOn"/>
						<action target="Chandelier" name="SendEvent" param="powerOn"/>
					</onEvent>
				</state>
				
				<state name="powerOn">
					<onStateEnter>
						<action target="Scene" name="ShowLayer" param="OpenFuseBox"/>
						<action target="Scene" name="HideLayer" param="PowerOff"/>
					</onStateEnter>
					
					<onMouseOver>
						<action target="Scene" name="SetCursor" param="zoom"/>
					</onMouseOver>					
					
					<onClick><action target="Scene" name="OpenWindow" param="FuseBoxWindow"/></onClick>
					
					<onEvent name="powerOff">
						<action target="FuseBox" name="SetState" param="powerOff"/>
						<action target="Case" name="SendEvent" param="powerOff"/>
						<action target="Chandelier" name="SendEvent" param="powerOff"/>
						<action target="Scene" name="PlaySound" param="fuse_off"/>
					</onEvent>
				</state>
				
				<state name="powerOff">
					<onStateEnter>
						<action target="Scene" name="ShowLayer" param="OpenFuseBox"/>
						<action target="Scene" name="ShowLayer" param="PowerOff"/>
					</onStateEnter>
					
					<onMouseOver>
						<action target="Scene" name="SetCursor" param="zoom"/>
					</onMouseOver>					
					
					<onClick><action target="Scene" name="OpenWindow" param="FuseBoxWindow"/></onClick>
					
					<onEvent name="powerOn">
						<action target="FuseBox" name="SetState" param="powerOn"/>
						<action target="Case" name="SendEvent" param="powerOn"/>
						<action target="Chandelier" name="SendEvent" param="powerOn"/>
						<action target="Scene" name="PlaySound" param="fuse_on"/>
					</onEvent>
				</state>
			</states>
		</object>
		
		<object name="Case">
			<clickStrategy type="alpha" layer="OpenCase"/>
			<states>
				<state name="needsPower">
					<onStateEnter>
						<action target="Scene" name="HideLayer" param="OpenCase"/>
						<action target="Scene" name="HideLayer" param="Gun"/>
					</onStateEnter>

					<onEvent name="powerOn">
						<action target="Case" name="SetState" param="closed"/>
					</onEvent>
					
					<onMouseOver>
						<action target="Scene" name="SetCursor" param="interactive"/>
					</onMouseOver>					
					
					<onClick>
						<action target="Scene" name="ShowDialog" param="need_power"/>
					</onClick>
				</state>
				
				<state name="closed">
					<onStateEnter>
						<action target="Scene" name="HideLayer" param="OpenCase"/>
						<action target="Scene" name="HideLayer" param="Gun"/>
					</onStateEnter>
					
					<onMouseOver>
						<action target="Scene" name="SetCursor" param="zoom"/>
					</onMouseOver>					
					
					<onClick>
						<action target="Scene" name="OpenWindow" param="CaseWindow"/>
						<action target="Case" name="SetState" param="open"/>
						<action target="Scene" name="PlaySound" param="showcase1_open"/>
					</onClick>
					
					<onEvent name="powerOff">
						<action target="Case" name="SetState" param="needsPower"/>
					</onEvent>
				</state>
				
				<state name="open">
					<onStateEnter>
						<action target="Scene" name="ShowLayer" param="OpenCase"/>
						<action target="Scene" name="HideLayer" param="Gun"/>
					</onStateEnter>
					
					<onMouseOver>
						<action target="Scene" name="SetCursor" param="zoom"/>
					</onMouseOver>					
					
					<onClick><action target="Scene" name="OpenWindow" param="CaseWindow"/></onClick>
				</state>
				
				<state name="noGun">
					<onStateEnter>
						<action target="Scene" name="CloseWindow" param="CaseWindow" delay="60"/>
						<action target="Scene" name="ShowLayer" param="OpenCase"/>
						<action target="Scene" name="ShowLayer" param="Gun"/>
						<action target="Scene" name="PlaySound" param="take_the_rifle"/>
					</onStateEnter>
				</state>
			</states>
		</object>
		
		<object name="Chandelier">
			<clickStrategy type="rect" left="100" top="90" right="350" bottom="380"/>
			<states>
				<state name="noPower">
					<onStateEnter>
						<action target="Scene" name="HideLayer" param="Chandelier"/>
						<action target="Scene" name="HideLayer" param="Candles"/>
						<action target="Scene" name="HideLayer" param="FlagRope"/>
						<action target="Scene" name="StartAnimation" param="ChandelierOffAnim"/>
						<action target="Scene" name="StopAnimation" param="ChandelierOnAnim"/>
					</onStateEnter>
					
					<onMouseOver>
						<action target="Scene" name="SetCursor" param="interactive"/>
					</onMouseOver>	

					<onClick>
						<action target="Scene" name="ShowDialog" param="chandelier_click"/>
					</onClick>
					
					<onEvent name="powerOn">
						<action target="Chandelier" name="SetState" param="power"/>
					</onEvent>
					
					<onUseObject name="GunAndBayonette">
						<action target="Chandelier" name="SetState" param="throughFloor" delay="160"/>
						<action target="Hole" name="SetState" param="unblocked" delay="160"/>
						<action target="Scene" name="RemoveFromInventory" param="GunAndBayonette"/>
						<action target="Scene" name="PlaySound" param="chandelier_falls"/>
					</onUseObject>
					
					<onUseObject name="Bayonette">
						<action target="Scene" name="ShowDialog" param="use_knife"/>
					</onUseObject>
				</state>
				
				<state name="power">
					<onStateEnter>
						<action target="Scene" name="HideLayer" param="Chandelier"/>
						<action target="Scene" name="ShowLayer" param="Candles"/>
						<action target="Scene" name="HideLayer" param="FlagRope"/>
						<action target="Scene" name="StartAnimation" param="ChandelierOnAnim"/>
						<action target="Scene" name="StopAnimation" param="ChandelierOffAnim"/>
					</onStateEnter>
					
					<onMouseOver>
						<action target="Scene" name="SetCursor" param="interactive"/>
					</onMouseOver>					
					
					<onClick>
						<action target="Scene" name="ShowDialog" param="chandelier_click"/>
					</onClick>					
					
					<onEvent name="powerOff">
						<action target="Chandelier" name="SetState" param="noPower"/>
					</onEvent>
					
					<onUseObject name="GunAndBayonette">
						<action target="Scene" name="ShowDialog" param="no_power"/>						
					</onUseObject>
					
					<onUseObject name="Bayonette">
						<action target="Scene" name="ShowDialog" param="use_knife"/>
					</onUseObject>
				</state>				
				
				<state name="throughFloor">
					<onStateEnter>
						<action target="Scene" name="ShowLayer" param="Chandelier"/>
						<action target="Scene" name="HideLayer" param="Candles"/>
						<action target="Scene" name="HideLayer" param="FlagRope"/>
						<action target="Scene" name="StopAnimation" param="ChandelierOnAnim"/>
						<action target="Scene" name="StopAnimation" param="ChandelierOffAnim"/>
					</onStateEnter>
				</state>
			</states>
		</object>
		
		<object name="Flag1">
			<clickStrategy type="alpha" layer="Flag1"/>
			<states>
				<state name="clickable">
					<onStateEnter><action target="Scene" name="HideLayer" param="Flag1"/></onStateEnter>
					
					<onMouseOver>
						<action target="Scene" name="SetCursor" param="interactive"/>
					</onMouseOver>
					
					<onClick>
						<action target="Scene" name="AddToInventory" param="Flag1"/>
						<action target="Flag1" name="SetState" param="acquired"/>
						<action target="Scene" name="PlaySound" param="Item_Pickup_Cloth_small"/>
					</onClick>
				</state>
				
				<state name="acquired">
					<onStateEnter><action target="Scene" name="ShowLayer" param="Flag1"/></onStateEnter>
				</state>
			</states>
		</object>
		
		<object name="Flag2">
			<clickStrategy type="alpha" layer="Flag2"/>
			<states>
				<state name="clickable">
					<onStateEnter><action target="Scene" name="HideLayer" param="Flag2"/></onStateEnter>
					
					<onMouseOver>
						<action target="Scene" name="SetCursor" param="interactive"/>
					</onMouseOver>
					
					<onClick>
						<action target="Scene" name="AddToInventory" param="Flag2"/>
						<action target="Flag2" name="SetState" param="acquired"/>
						<action target="Scene" name="PlaySound" param="Item_Pickup_Cloth_big"/>
					</onClick>
				</state>
				
				<state name="acquired">
					<onStateEnter><action target="Scene" name="ShowLayer" param="Flag2"/></onStateEnter>
				</state>
			</states>
		</object>
		
		<object name="Hole">
			<clickStrategy type="rect" left="125" top="470" right="340" bottom="570"/>
			<states>
				<state name="blocked">
					<onMouseOver>
						<action target="Scene" name="SetCursor" param="noExit"/>
					</onMouseOver>					
					
					<onClick>
						<action target="Scene" name="ShowDialog" param="hole_click"/>
					</onClick>
				</state>
				
				<state name="unblocked">
					<onMouseOver>
						<action target="Scene" name="SetCursor" param="noExit"/>
					</onMouseOver>
					
					<onClick>
						<action target="Scene" name="ShowDialog" param="too_high"/>
					</onClick>
					
					<onUseObject name="FlagRope">						
						<action target="Scene" name="RemoveFromInventory" param="FlagRope"/>						
						<action target="Scene" name="PlaySound" param="attach_flag_to_profile"/>
						<action target="Hole" name="SetState" param="readyForExit"/>
					</onUseObject>
				</state>
				
				<state name="readyForExit">
					<onStateEnter>
						<action target="Scene" name="ShowLayer" param="FlagRope"/>
					</onStateEnter>
					
					<onMouseOver>
						<action target="Scene" name="SetCursor" param="exit"/>
					</onMouseOver>
					
					<onClick>
						<action target="Scene" name="RegisterVictoryCondition" param=""/>
					</onClick>
				</state>
			</states>
		</object>	
		
	</objects>
</scene>

