<scene name="Room17" numVictoryConditions="1">
	<inventory>
		<object name="Broom" memberName="HUD_broom" acquired="0" visible="1"/>
		<object name="Hammer" memberName="HUD_hammer" acquired="0" visible="1"/>
		<object name="Gum" memberName="HUD_gum" acquired="0" visible="1">
			<onUseObject name="Wire">
				<action target="Scene" name="RemoveFromInventory" param="Gum"/>
				<action target="Scene" name="RemoveFromInventory" param="Wire"/>
				<action target="Scene" name="AddToInventory" param="WireAndGum"/>
				<action target="Scene" name="PlaySound" param="put_gum_on_wire"/>
			</onUseObject>
		</object>
		<object name="Wire" memberName="HUD_wire" acquired="0" visible="1">
			<onUseObject name="Gum">
				<action target="Scene" name="RemoveFromInventory" param="Gum"/>
				<action target="Scene" name="RemoveFromInventory" param="Wire"/>
				<action target="Scene" name="AddToInventory" param="WireAndGum"/>
				<action target="Scene" name="PlaySound" param="put_gum_on_wire"/>
			</onUseObject>
		</object>
		<object name="Axe" memberName="HUD_axe" acquired="0" visible="1"/>
		<object name="Key" memberName="HUD_key" acquired="0" visible="1"/>
		<object name="BrokenAxe" memberName="HUD_brokenAxe" acquired="0" visible="0"/>
		<object name="WireAndGum" memberName="HUD_wireAndGum" acquired="0" visible="0"/>
	</inventory>
	
	<finalStates>
		<finalState objName="Broom" state="acquired"/>
		<finalState objName="Hammer" state="acquired"/>
		<finalState objName="Gum" state="noGum"/>
		<finalState objName="Wire" state="acquired"/>
		<finalState objName="AxeCase" state="noAxe"/>
		<finalState objName="Door" state="open"/>
	</finalStates>
	
	<animations>
		<animation name="SignWireAnim" type="loop" xpos="105" ypos="426">
			<frames>
				<frame memberName="signWire1_anim" frameDelay="4"/>
				<frame memberName="signWire2_anim" frameDelay="4"/>
				<frame memberName="signWire3_anim" frameDelay="4"/>
				<frame memberName="signWire4_anim" frameDelay="4"/>
				<frame memberName="signWire5_anim" frameDelay="4"/>
				<frame memberName="signWire6_anim" frameDelay="4"/>
				<frame memberName="signWire7_anim" frameDelay="4"/>
				<frame memberName="signWire8_anim" frameDelay="4"/>
				<frame memberName="signWire9_anim" frameDelay="4"/>
				<frame memberName="signWire10_anim" frameDelay="4"/>
				<frame memberName="signWire11_anim" frameDelay="4"/>
				<frame memberName="signWire12_anim" frameDelay="4"/>
				<frame memberName="signWire13_anim" frameDelay="4"/>
				<frame memberName="signWire14_anim" frameDelay="4"/>
				<frame memberName="signWire15_anim" frameDelay="4"/>
				<frame memberName="signWire16_anim" frameDelay="4"/>
				<frame memberName="signWire17_anim" frameDelay="4"/>
				<frame memberName="signWire18_anim" frameDelay="4"/>
				<frame memberName="signWire19_anim" frameDelay="4"/>
				<frame memberName="signWire20_anim" frameDelay="4"/>
				<frame memberName="signWire21_anim" frameDelay="4"/>
				<frame memberName="signWire22_anim" frameDelay="4"/>
				<frame memberName="signWire23_anim" frameDelay="4"/>
				<frame memberName="signWire24_anim" frameDelay="4"/>
				<frame memberName="signWire25_anim" frameDelay="4"/>
				<frame memberName="signWire26_anim" frameDelay="4"/>
			</frames>
		</animation>
		
		<animation name="SignNoWireAnim" type="loop" xpos="105" ypos="426">
			<frames>
				<frame memberName="signNoWire1_anim" frameDelay="4"/>
				<frame memberName="signNoWire2_anim" frameDelay="4"/>
				<frame memberName="signNoWire3_anim" frameDelay="4"/>
				<frame memberName="signNoWire4_anim" frameDelay="4"/>
				<frame memberName="signNoWire5_anim" frameDelay="4"/>
				<frame memberName="signNoWire6_anim" frameDelay="4"/>
				<frame memberName="signNoWire7_anim" frameDelay="4"/>
				<frame memberName="signNoWire8_anim" frameDelay="4"/>
				<frame memberName="signNoWire9_anim" frameDelay="4"/>
				<frame memberName="signNoWire10_anim" frameDelay="4"/>
				<frame memberName="signNoWire11_anim" frameDelay="4"/>
				<frame memberName="signNoWire12_anim" frameDelay="4"/>
				<frame memberName="signNoWire13_anim" frameDelay="4"/>
				<frame memberName="signNoWire14_anim" frameDelay="4"/>
				<frame memberName="signNoWire15_anim" frameDelay="4"/>
				<frame memberName="signNoWire16_anim" frameDelay="4"/>
				<frame memberName="signNoWire17_anim" frameDelay="4"/>
				<frame memberName="signNoWire18_anim" frameDelay="4"/>
				<frame memberName="signNoWire19_anim" frameDelay="4"/>
				<frame memberName="signNoWire20_anim" frameDelay="4"/>
				<frame memberName="signNoWire21_anim" frameDelay="4"/>
				<frame memberName="signNoWire22_anim" frameDelay="4"/>
				<frame memberName="signNoWire23_anim" frameDelay="4"/>
				<frame memberName="signNoWire24_anim" frameDelay="4"/>
				<frame memberName="signNoWire25_anim" frameDelay="4"/>
				<frame memberName="signNoWire26_anim" frameDelay="4"/>				
			</frames>
		</animation>
	</animations>
	
	<zoomWindows>
		<zoomWindow name="GumWindow" file="ZoomWindows\Room17_GumWindow.dir" x="490" y="430" visible="0"/>
		<zoomWindow name="AxeCaseWindow" file="ZoomWindows\Room17_AxeCaseWindow.dir" x="370" y="310" visible="0"/>
		<zoomWindow name="DoorWindow" file="ZoomWindows\Room17_DoorWindow.dir" x="280" y="310" visible="0"/>
	</zoomWindows>
	
	<objects>
		<object name="Broom">
			<clickStrategy type="alpha" layer="Broom"/>
			<states>
				<state name="clickable">
					<onStateEnter>
						<action target="Scene" name="HideLayer" param="Broom"/>
						<action target="Scene" name="PlaySound" param="indoor_big"/>
						<action target="Scene" name="PlaySound" param="circuit2"/>
						<action target="Scene" name="PlaySound" param="electricity2"/>						
					</onStateEnter>
					
					<onMouseOver>
						<action target="Scene" name="SetCursor" param="interactive"/>
					</onMouseOver>
					
					<onClick>
						<action target="Scene" name="AddToInventory" param="Broom"/>
						<action target="Broom" name="SetState" param="acquired"/>
						<action target="Scene" name="PlaySound" param="Item_Pickup_Wood_big"/>
					</onClick>
				</state>
				
				<state name="acquired">
					<onStateEnter><action target="Scene" name="ShowLayer" param="Broom"/></onStateEnter>
				</state>
			</states>
		</object>
		
		<object name="Hammer">
			<clickStrategy type="alpha" layer="Hammer"/>
			<states>
				<state name="clickable">
					<onStateEnter><action target="Scene" name="ShowLayer" param="Hammer"/></onStateEnter>
					
					<onMouseOver>
						<action target="Scene" name="SetCursor" param="interactive"/>
					</onMouseOver>					
					
					<onClick>
						<action target="Scene" name="AddToInventory" param="Hammer"/>
						<action target="Hammer" name="SetState" param="acquired"/>
						<action target="Scene" name="PlaySound" param="take_the_brick"/>
					</onClick>
				</state>
				
				<state name="acquired">
					<onStateEnter><action target="Scene" name="HideLayer" param="Hammer"/></onStateEnter>
				</state>
			</states>
		</object>
		
		<object name="Gum">
			<clickStrategy type="alpha" layer="Gum"/>
			<states>
				<state name="clickable">
					<onStateEnter><action target="Scene" name="HideLayer" param="Gum"/></onStateEnter>
					
					<onMouseOver>
						<action target="Scene" name="SetCursor" param="zoom"/>
					</onMouseOver>
					
					<onClick><action target="Scene" name="OpenWindow" param="GumWindow"/></onClick>
				</state>
				
				<state name="noGum">
					<onStateEnter>
						<action target="Scene" name="CloseWindow" param="GumWindow" delay="60"/>
						<action target="Scene" name="ShowLayer" param="Gum"/>
						<action target="Scene" name="PlaySound" param="take_the_gum"/>
					</onStateEnter>
				</state>
			</states>
		</object>
		
		<object name="Wire">
			<clickStrategy type="alpha" layer="Wire"/>
			<states>
				<state name="clickable">
					<onStateEnter>
						<action target="Scene" name="HideLayer" param="Wire"/>
						<action target="Scene" name="StartAnimation" param="SignWireAnim"/>
					</onStateEnter>
					
					<onMouseOver>
						<action target="Scene" name="SetCursor" param="interactive"/>
					</onMouseOver>					
					
					<onClick>
						<action target="Scene" name="AddToInventory" param="Wire"/>
						<action target="Wire" name="SetState" param="acquired"/>
						<action target="Scene" name="PlaySound" param="take_the_wire"/>
					</onClick>
				</state>
				
				<state name="acquired">
					<onStateEnter>
						<action target="Scene" name="ShowLayer" param="Wire"/>
						<action target="Scene" name="StopAnimation" param="SignWireAnim"/>
						<action target="Scene" name="StartAnimation" param="SignNoWireAnim"/>
					</onStateEnter>
				</state>
			</states>
		</object>
		
		<object name="AxeCase">
			<clickStrategy type="alpha" layer="ElectricWire"/>
			<states>
				<state name="withWire">
					<onStateEnter>
						<action target="Scene" name="HideLayer" param="ElectricWire"/>
						<action target="Scene" name="HideLayer" param="BrokenGlass"/>						
					</onStateEnter>
					
					<onMouseOver>
						<action target="Scene" name="SetCursor" param="zoom"/>
					</onMouseOver>					
					
					<onClick>
						<action target="Scene" name="OpenWindow" param="AxeCaseWindow"/>
						<action target="Scene" name="ShowDialog" param="axe_case_click"/>
					</onClick>
					
					<onUseObject name="Broom">
						<action target="Scene" name="OpenWindow" param="AxeCaseWindow"/>
						<action target="Scene" name="RemoveFromInventory" param="Broom"/>
						<action target="AxeCase" name="SetState" param="noWire"/>
						<action target="Scene" name="PlaySound" param="use_broom_on_wires"/>
					</onUseObject>
				</state>
				
				<state name="noWire">
					<onStateEnter>
						<action target="Scene" name="ShowLayer" param="ElectricWire"/>
						<action target="Scene" name="HideLayer" param="BrokenGlass"/>						
					</onStateEnter>
					
					<onMouseOver>
						<action target="Scene" name="SetCursor" param="zoom"/>
					</onMouseOver>					
					
					<onClick>
						<action target="Scene" name="OpenWindow" param="AxeCaseWindow"/>
						<action target="Scene" name="ShowDialog" param="axe_case_needs_to_break"/>
					</onClick>
					
					<onUseObject name="Hammer">
						<action target="Scene" name="OpenWindow" param="AxeCaseWindow"/>
						<action target="Scene" name="RemoveFromInventory" param="Hammer"/>
						<action target="AxeCase" name="SetState" param="noGlass"/>
						<action target="Scene" name="PlaySound" param="use_brick_on_showcase"/>
					</onUseObject>
				</state>
				
				<state name="noGlass">
					<onStateEnter>
						<action target="Scene" name="ShowLayer" param="ElectricWire"/>
						<action target="Scene" name="ShowLayer" param="BrokenGlass"/>						
					</onStateEnter>
					
					<onMouseOver>
						<action target="Scene" name="SetCursor" param="zoom"/>
					</onMouseOver>					
					
					<onClick><action target="Scene" name="OpenWindow" param="AxeCaseWindow"/></onClick>
				</state>
				
				<state name="noAxe">
					<onStateEnter>
						<action target="Scene" name="CloseWindow" param="AxeCaseWindow" delay="60"/>
						<action target="Scene" name="ShowLayer" param="ElectricWire"/>
						<action target="Scene" name="ShowLayer" param="BrokenGlass"/>
						<action target="Scene" name="PlaySound" param="take_the_axe"/>
					</onStateEnter>
				</state>
			</states>
		</object>
		
		<object name="Door">
			<clickStrategy type="rect" left="270" top="235" right="300" bottom="410"/>			
			<states>
				<state name="withBoards">
					<onStateEnter><action target="Scene" name="HideLayer" param="Boards"/></onStateEnter>
					
					<onMouseOver>
						<action target="Scene" name="SetCursor" param="zoom"/>
					</onMouseOver>					
					
					<onClick>
						<action target="Scene" name="OpenWindow" param="DoorWindow"/>
						<action target="Scene" name="ShowDialog" param="click_door"/>
					</onClick>
					
					<onUseObject name="Axe">
						<action target="Scene" name="OpenWindow" param="DoorWindow"/>
						<action target="Door" name="SetState" param="withHole"/>
						<action target="Scene" name="RemoveFromInventory" param="Axe"/>
						<action target="Scene" name="PlaySound" param="use_axe_on_door"/>
					</onUseObject>
				</state>
				<!--
				<state name="noBoards">
					<onStateEnter><action target="Scene" name="ShowLayer" param="Boards"/></onStateEnter>
					
					<onMouseOver>
						<action target="Scene" name="SetCursor" param="zoom"/>
					</onMouseOver>					
					
					<onClick><action target="Scene" name="OpenWindow" param="DoorWindow"/></onClick>
					
					<onUseObject name="Axe">
						<action target="Scene" name="OpenWindow" param="DoorWindow"/>
						<action target="Door" name="SetState" param="withHole"/>
						<action target="Scene" name="RemoveFromInventory" param="Axe"/>
						<action target="Scene" name="PlaySound" param="use_axe_on_door"/>
					</onUseObject>
				</state>
				-->
				<state name="withHole">
					<onStateEnter><action target="Scene" name="ShowLayer" param="Boards"/></onStateEnter>
					
					<onMouseOver>
						<action target="Scene" name="SetCursor" param="zoom"/>
					</onMouseOver>					
					
					<onClick>
						<action target="Scene" name="OpenWindow" param="DoorWindow"/>
						<action target="Scene" name="ShowDialog" param="see_key"/>
					</onClick>
					
					<onUseObject name="WireAndGum">
						<action target="Scene" name="OpenWindow" param="DoorWindow"/>
						<action target="Door" name="SetState" param="noKey"/>
						<action target="Scene" name="RemoveFromInventory" param="WireAndGum"/>
						<action target="Scene" name="AddToInventory" param="Key"/>
						<action target="Scene" name="PlaySound" param="get_the_keys"/>
					</onUseObject>
				</state>
				
				<state name="noKey">
					<onStateEnter><action target="Scene" name="ShowLayer" param="Boards"/></onStateEnter>
					
					<onMouseOver>
						<action target="Scene" name="SetCursor" param="zoom"/>
					</onMouseOver>					
					
					<onClick>
						<action target="Scene" name="OpenWindow" param="DoorWindow"/>
						<action target="Scene" name="ShowDialog" param="door_locked"/>
					</onClick>
					
					<onUseObject name="Key">
						<action target="Scene" name="OpenWindow" param="DoorWindow"/>
						<action target="Door" name="SetState" param="open"/>
						<action target="Scene" name="RemoveFromInventory" param="Key"/>
					</onUseObject>
				</state>
				
				<state name="open">
					<onStateEnter>
						<action target="Scene" name="CloseWindow" param="DoorWindow" delay="60"/>
						<action target="Scene" name="ShowLayer" param="Boards"/>
					</onStateEnter>
					
					<onMouseOver>
						<action target="Scene" name="SetCursor" param="exit"/>
					</onMouseOver>										
					
					<onClick>
						<action target="Scene" name="RegisterVictoryCondition" param=""/>
					</onClick>
				</state>
			</states>
		</object>
	</objects>
</scene>
