<scene name="Room9" numVictoryConditions="1">
	<inventory>
		<object name="SwordHandle" memberName="HUD_swordHandle" acquired="0" visible="1">
			<onUseObject name="SwordBlade">
				<action target="Scene" name="RemoveFromInventory" param="SwordHandle"/>
				<action target="Scene" name="RemoveFromInventory" param="SwordBlade"/>
				<action target="Scene" name="AddToInventory" param="Sword"/>
				<action target="Scene" name="PlaySound" param="attach_handle_to_the_blade"/>
			</onUseObject>						
		</object>
		<object name="SwordBlade" memberName="HUD_swordBlade" acquired="0" visible="1">
			<onUseObject name="SwordHandle">
				<action target="Scene" name="RemoveFromInventory" param="SwordHandle"/>
				<action target="Scene" name="RemoveFromInventory" param="SwordBlade"/>
				<action target="Scene" name="AddToInventory" param="Sword"/>
				<action target="Scene" name="PlaySound" param="attach_handle_to_the_blade"/>
			</onUseObject>						
		</object>
		<object name="Sword" memberName="HUD_sword" acquired="0" visible="0"/>		
	</inventory>
	
	<finalStates>
		<finalState objName="Switch1" state="on"/>
		<finalState objName="Case1" state="open"/>
		<finalState objName="SwordHandle" state="acquired"/>
		<finalState objName="Switch2" state="on"/>
		<finalState objName="Case2" state="open"/>
		<finalState objName="SwordBlade" state="acquired"/>
		<finalState objName="Column" state="columnDown"/>
		<finalState objName="ColumnDown" state="down"/>
		<finalState objName="WeakWall" state="smashed"/>
	</finalStates>
	
	<zoomWindows>
		<zoomWindow name="BladeCaseWindow" file="ZoomWindows\Room9_BladeCaseWindow.dir" x="500" y="328" visible="0"/>
		<zoomWindow name="HandleCaseWindow" file="ZoomWindows\Room9_HandleCaseWindow.dir" x="180" y="330" visible="0"/>
	</zoomWindows>
	
	<objects>
		<object name="Switch1">
			<clickStrategy type="rect" left="236" top="286" right="252" bottom="306"/>
			<states>
				<state name="off">
					<onStateEnter>
						<action target="Scene" name="HideLayer" param="Switch1"/>
						<action target="Scene" name="PlaySound" param="indoor_small"/>
					</onStateEnter>
					
					<onMouseOver>
						<action target="Scene" name="SetCursor" param="interactive"/>
					</onMouseOver>										
					
					<onClick>
						<action target="Switch1" name="SetState" param="on"/>						
						<action target="Case1" name="SetState" param="lit"/>
						<action target="Scene" name="PlaySound" param="showcase1_loop"/>
						<action target="Scene" name="PlaySound" param="switch1_snd"/>
						<action target="Scene" name="PlaySound" param="showcase1_start"/>
					</onClick>
				</state>

				<state name="on">
					<onStateEnter>
						<action target="Scene" name="ShowLayer" param="Switch1"/>
					</onStateEnter>
				</state>
			</states>
		</object>
		
		<object name="Case1">
			<clickStrategy type="rect" left="275" top="210" right="355" bottom="405"/>
			<states>
				<state name="notLit">
					<onStateEnter>
						<action target="Scene" name="HideLayer" param="Case1"/>
					</onStateEnter>
					
					<onMouseOver>
						<action target="Scene" name="SetCursor" param="zoom"/>
					</onMouseOver>					
					
					<onClick>
						<action target="Scene" name="OpenWindow" param="HandleCaseWindow"/>
						<action target="Scene" name="ShowDialog" param="case_click"/>
					</onClick>
				</state>
				
				<state name="lit">
					<onStateEnter>
						<action target="Scene" name="HideLayer" param="Case1"/>
					</onStateEnter>
					
					<onMouseOver>
						<action target="Scene" name="SetCursor" param="zoom"/>
					</onMouseOver>															
					
					<onClick>
						<action target="Scene" name="OpenWindow" param="HandleCaseWindow"/>
						<action target="Case1" name="SetState" param="open"/>
						<action target="Scene" name="PlaySound" param="showcase1_open"/>
					</onClick>
				</state>
				
				<state name="open">
					<onStateEnter>
						<action target="Scene" name="ShowLayer" param="Case1"/>
					</onStateEnter>
					
					<onMouseOver>
						<action target="Scene" name="SetCursor" param="zoom"/>
					</onMouseOver>															
					
					<onClick>
						<action target="Scene" name="OpenWindow" param="HandleCaseWindow"/>
					</onClick>
				</state>
			</states>
		</object>
		
		<object name="SwordHandle">
			<states>
				<state name="inScene">
					<onStateEnter>
						<action target="Scene" name="HideLayer" param="SwordHandle"/>
					</onStateEnter>					
				</state>
				
				<state name="acquired">
					<onStateEnter>
						<action target="Scene" name="CloseWindow" param="HandleCaseWindow"/>
						<action target="Scene" name="ShowLayer" param="SwordHandle"/>
						<action target="Scene" name="PlaySound" param="Item_Pickup_Metal_small"/>
					</onStateEnter>					
				</state>
			</states>			
		</object>		
		
		<object name="Switch2">
			<clickStrategy type="rect" left="365" top="300" right="374" bottom="313"/>
			<states>
				<state name="off">
					<onStateEnter>
						<action target="Scene" name="HideLayer" param="Switch2"/>
					</onStateEnter>
					
					<onMouseOver>
						<action target="Scene" name="SetCursor" param="interactive"/>
					</onMouseOver>															
					
					<onClick>
						<action target="Switch2" name="SetState" param="on"/>						
						<action target="Case2" name="SetState" param="lit"/>
						<action target="Scene" name="PlaySound" param="showcase2_loop"/>
						<action target="Scene" name="PlaySound" param="switch2_snd"/>
						<action target="Scene" name="PlaySound" param="showcase2_start"/>
					</onClick>
				</state>

				<state name="on">
					<onStateEnter>
						<action target="Scene" name="ShowLayer" param="Switch2"/>
					</onStateEnter>
				</state>
			</states>
		</object>
		
		<object name="Case2">
			<clickStrategy type="rect" left="388" top="246" right="435" bottom="380"/>
			<states>
				<state name="notLit">
					<onStateEnter>
						<action target="Scene" name="HideLayer" param="Case2"/>
					</onStateEnter>
					
					<onMouseOver>
						<action target="Scene" name="SetCursor" param="zoom"/>
					</onMouseOver>															
					
					<onClick>
						<action target="Scene" name="OpenWindow" param="BladeCaseWindow"/>
						<action target="Scene" name="ShowDialog" param="case_click"/>
					</onClick>
				</state>
				
				<state name="lit">
					<onStateEnter>
						<action target="Scene" name="HideLayer" param="Case2"/>
					</onStateEnter>
					
					<onMouseOver>
						<action target="Scene" name="SetCursor" param="zoom"/>
					</onMouseOver>															
					
					<onClick>
						<action target="Scene" name="OpenWindow" param="BladeCaseWindow"/>
						<action target="Case2" name="SetState" param="open"/>
						<action target="Scene" name="PlaySound" param="showcase2_open"/>
					</onClick>
				</state>
				
				<state name="open">
					<onStateEnter>
						<action target="Scene" name="ShowLayer" param="Case2"/>
					</onStateEnter>
					
					<onMouseOver>
						<action target="Scene" name="SetCursor" param="zoom"/>
					</onMouseOver>															
					
					<onClick>
						<action target="Scene" name="OpenWindow" param="BladeCaseWindow"/>
					</onClick>
				</state>
			</states>
		</object>
		
		<object name="SwordBlade">
			<states>
				<state name="inScene">
					<onStateEnter>
						<action target="Scene" name="HideLayer" param="SwordBlade"/>
					</onStateEnter>
				</state>
				
				<state name="acquired">
					<onStateEnter>
						<action target="Scene" name="CloseWindow" param="BladeCaseWindow"/>
						<action target="Scene" name="ShowLayer" param="SwordBlade"/>
						<action target="Scene" name="PlaySound" param="Item_Pickup_Metal_big"/>
					</onStateEnter>
				</state>
			</states>			
		</object>
		
		<object name="Column">
			<clickStrategy type="alpha" layer="Column1"/>
			<states>
				<state name="unharmed">
					<onStateEnter>
						<action target="Scene" name="HideLayer" param="Column1"/>
						<action target="Scene" name="HideLayer" param="Column2"/>
						<action target="Scene" name="HideLayer" param="Column3"/>
						<action target="Scene" name="HideLayer" param="Column4"/>
					</onStateEnter>
					
					<onMouseOver>
						<action target="Scene" name="SetCursor" param="interactive"/>
					</onMouseOver>															
					
					<onClick>
						<action target="Scene" name="ShowDialog" param="column_click"/>
					</onClick>
					
					<onUseObject name="Sword">
						<action target="Column" name="SetState" param="1hit"/>
						<action target="Scene" name="PlaySound" param="use_sword1"/>
					</onUseObject>
				</state>
				
				<state name="1hit">
					<onStateEnter>
						<action target="Scene" name="ShowLayer" param="Column1"/>
						<action target="Scene" name="HideLayer" param="Column2"/>
						<action target="Scene" name="HideLayer" param="Column3"/>
						<action target="Scene" name="HideLayer" param="Column4"/>
					</onStateEnter>
					
					<onMouseOver>
						<action target="Scene" name="SetCursor" param="interactive"/>
					</onMouseOver>															
					
					<onUseObject name="Sword">
						<action target="Column" name="SetState" param="2hits"/>
						<action target="Scene" name="PlaySound" param="use_sword2"/>
					</onUseObject>
				</state>
				
				<state name="2hits">
					<onStateEnter>
						<action target="Scene" name="ShowLayer" param="Column1"/>
						<action target="Scene" name="ShowLayer" param="Column2"/>
						<action target="Scene" name="HideLayer" param="Column3"/>
						<action target="Scene" name="HideLayer" param="Column4"/>
					</onStateEnter>
					
					<onMouseOver>
						<action target="Scene" name="SetCursor" param="interactive"/>
					</onMouseOver>															
					
					<onUseObject name="Sword">
						<action target="Column" name="SetState" param="3hits"/>
						<action target="Scene" name="PlaySound" param="use_sword3"/>
					</onUseObject>
				</state>
				
				<state name="3hits">
					<onStateEnter>
						<action target="Scene" name="ShowLayer" param="Column1"/>
						<action target="Scene" name="ShowLayer" param="Column2"/>
						<action target="Scene" name="ShowLayer" param="Column3"/>
						<action target="Scene" name="HideLayer" param="Column4"/>
					</onStateEnter>
					
					<onMouseOver>
						<action target="Scene" name="SetCursor" param="interactive"/>
					</onMouseOver>															
					
					<onUseObject name="Sword">
						<action target="Column" name="SetState" param="aboutToFall"/>
						<action target="Scene" name="PlaySound" param="use_sword4"/>
					</onUseObject>
				</state>
				
				<state name="aboutToFall">
					<onStateEnter>
						<action target="Scene" name="ShowLayer" param="Column1"/>
						<action target="Scene" name="ShowLayer" param="Column2"/>
						<action target="Scene" name="ShowLayer" param="Column3"/>
						<action target="Scene" name="ShowLayer" param="Column4"/>
					</onStateEnter>
					
					<onMouseOver>
						<action target="Scene" name="SetCursor" param="interactive"/>
					</onMouseOver>															
					
					<onUseObject name="Sword">
						<action target="Column" name="SetState" param="columnDown"/>
						<action target="ColumnDown" name="SetState" param="down"/>
						<action target="WeakWall" name="SetState" param="smashed"/>
						<action target="Scene" name="PlaySound" param="column_falls"/>
					</onUseObject>
				</state>
				
				<state name="columnDown">
				</state>
			</states>
		</object>
		
		<object name="ColumnDown" state="up">
			<states>
				<state name="up">
					<onStateEnter>
						<action target="Scene" name="HideLayer" param="ColumnDown"/>
					</onStateEnter>
				</state>
				
				<state name="down">
					<onStateEnter>
						<action target="Scene" name="ShowLayer" param="ColumnDown"/>
					</onStateEnter>
				</state>
			</states>
		</object>
		
		<object name="WeakWall">
			<clickStrategy type="rect" left="710" top="200" right="790" bottom="510"/>
			<states>
				<state name="weak">
					<onMouseOver>
						<action target="Scene" name="SetCursor" param="noExit"/>
					</onMouseOver>
					
					<onClick>
						<action target="Scene" name="ShowDialog" param="wall_click"/>
					</onClick>
				</state>
				
				<state name="smashed">				
					<onMouseOver>
						<action target="Scene" name="SetCursor" param="exit"/>
					</onMouseOver>															
					
					<onClick>
						<action target="Scene" name="RegisterVictoryCondition" param=""/>
					</onClick>
				</state>
			</states>
		</object>
	</objects>
</scene>
