<scene name="Room4" numVictoryConditions="1">
	<inventory>
		<object name="FlashlightOff" memberName="HUD_flashlight_off" acquired="0" visible="1">
			<onUseObject name="Batteries">
				<action target="Scene" name="RemoveFromInventory" param="FlashlightOff"/>
				<action target="Scene" name="RemoveFromInventory" param="Batteries"/>
				<action target="Scene" name="AddToInventory" param="FlashlightWithBatteries"/>
				<action target="Scene" name="PlaySound" param="put_battery_in_torch"/>
			</onUseObject>			
			<onUseObject name="Bulb">
				<action target="Scene" name="RemoveFromInventory" param="FlashlightOff"/>
				<action target="Scene" name="RemoveFromInventory" param="Bulb"/>
				<action target="Scene" name="AddToInventory" param="FlashlightWithBulb"/>
			</onUseObject>	
		</object>				
		<object name="Knife" memberName="HUD_knife" acquired="0" visible="1">
			<onUseObject name="WalkieTalkie">
				<action target="Scene" name="RemoveFromInventory" param="Knife"/>
				<action target="Scene" name="RemoveFromInventory" param="WalkieTalkie"/>
				<action target="Scene" name="AddToInventory" param="Batteries"/>
			</onUseObject>
		</object>
		<object name="WalkieTalkie" memberName="HUD_walkietalkie" acquired="0" visible="1">
			<onUseObject name="Knife">
				<action target="Scene" name="RemoveFromInventory" param="Knife"/>
				<action target="Scene" name="RemoveFromInventory" param="WalkieTalkie"/>
				<action target="Scene" name="AddToInventory" param="Batteries"/>
			</onUseObject>
		</object>
		<object name="Batteries" memberName="HUD_batteries" acquired="0" visible="1">
			<onUseObject name="FlashlightOff">
				<action target="Scene" name="RemoveFromInventory" param="FlashlightOff"/>
				<action target="Scene" name="RemoveFromInventory" param="Batteries"/>
				<action target="Scene" name="AddToInventory" param="FlashlightWithBatteries"/>
				<action target="Scene" name="PlaySound" param="put_battery_in_torch"/>
			</onUseObject>			
			<onUseObject name="FlashlightWithBulb">
				<action target="Scene" name="RemoveFromInventory" param="FlashlightWithBulb"/>
				<action target="Scene" name="RemoveFromInventory" param="Batteries"/>
				<action target="Scene" name="AddToInventory" param="FlashlightWithBulbAndBatteries"/>
				<action target="Scene" name="PlaySound" param="put_battery_in_torch"/>
			</onUseObject>	
		</object>
		<object name="Bulb" memberName="HUD_bulb" acquired="0" visible="1">
			<onUseObject name="FlashlightOff">
				<action target="Scene" name="RemoveFromInventory" param="FlashlightOff"/>
				<action target="Scene" name="RemoveFromInventory" param="Bulb"/>
				<action target="Scene" name="AddToInventory" param="FlashlightWithBulb"/>
				<action target="Scene" name="PlaySound" param="put_battery_in_torch"/>
			</onUseObject>
			<onUseObject name="FlashlightWithBatteries">
				<action target="Scene" name="RemoveFromInventory" param="FlashlightWithBatteries"/>
				<action target="Scene" name="RemoveFromInventory" param="Bulb"/>
				<action target="Scene" name="AddToInventory" param="FlashlightWithBulbAndBatteries"/>
				<action target="Scene" name="PlaySound" param="put_battery_in_torch"/>
			</onUseObject>	
		</object>
		<object name="FlashlightWithBatteries" memberName="HUD_flashlight_off" acquired="0" visible="0">
			<onUseObject name="Bulb">
				<action target="Scene" name="RemoveFromInventory" param="FlashlightWithBatteries"/>
				<action target="Scene" name="RemoveFromInventory" param="Bulb"/>
				<action target="Scene" name="AddToInventory" param="FlashlightWithBulbAndBatteries"/>
			</onUseObject>
		</object>
		<object name="FlashlightWithBulb" memberName="HUD_flashlight_off" acquired="0" visible="0">
			<onUseObject name="Batteries">
				<action target="Scene" name="RemoveFromInventory" param="FlashlightWithBulb"/>
				<action target="Scene" name="RemoveFromInventory" param="Batteries"/>
				<action target="Scene" name="AddToInventory" param="FlashlightWithBulbAndBatteries"/>
				<action target="Scene" name="PlaySound" param="put_battery_in_torch"/>
			</onUseObject>
		</object>
		<object name="FlashlightWithBulbAndBatteries" memberName="HUD_flashlight_on" acquired="0" visible="0"/>	
		<object name="DoorKnob" memberName="HUD_doorknob" acquired="0" visible="1"/>
	</inventory>
	
	<finalStates>
		<finalState objName="Flashlight" state="disabled"/>
		<finalState objName="Knife" state="acquired"/>
		<finalState objName="WalkieTalkie" state="disabled"/>
		<finalState objName="MapPanel" state="disabled"/>
		<finalState objName="MapPanelBulb" state="disabled"/>
		<finalState objName="DarkArea" state="litWithoutKnob"/>
		<finalState objName="Door" state="withKnob"/>
	</finalStates>
	
	<animations>
		<animation name="PlantBlueAnim" type="loop" xpos="411" ypos="335">
			<frames>
				<frame memberName="plantBlue1_anim" frameDelay="4"/>
				<frame memberName="plantBlue2_anim" frameDelay="4"/>
				<frame memberName="plantBlue3_anim" frameDelay="4"/>
				<frame memberName="plantBlue4_anim" frameDelay="4"/>
				<frame memberName="plantBlue5_anim" frameDelay="4"/>
				<frame memberName="plantBlue6_anim" frameDelay="4"/>
				<frame memberName="plantBlue7_anim" frameDelay="4"/>
				<frame memberName="plantBlue8_anim" frameDelay="4"/>
				<frame memberName="plantBlue9_anim" frameDelay="4"/>
				<frame memberName="plantBlue10_anim" frameDelay="4"/>
				<frame memberName="plantBlue11_anim" frameDelay="4"/>
				<frame memberName="plantBlue12_anim" frameDelay="4"/>
				<frame memberName="plantBlue13_anim" frameDelay="4"/>
				<frame memberName="plantBlue14_anim" frameDelay="4"/>
				<frame memberName="plantBlue15_anim" frameDelay="4"/>
				<frame memberName="plantBlue16_anim" frameDelay="4"/>
				<frame memberName="plantBlue17_anim" frameDelay="4"/>
				<frame memberName="plantBlue18_anim" frameDelay="4"/>
				<frame memberName="plantBlue19_anim" frameDelay="4"/>
				<frame memberName="plantBlue20_anim" frameDelay="4"/>
				<frame memberName="plantBlue21_anim" frameDelay="4"/>
				<frame memberName="plantBlue22_anim" frameDelay="4"/>
				<frame memberName="plantBlue23_anim" frameDelay="4"/>
				<frame memberName="plantBlue24_anim" frameDelay="4"/>
				<frame memberName="plantBlue25_anim" frameDelay="4"/>
				<frame memberName="plantBlue26_anim" frameDelay="4"/>
				<frame memberName="plantBlue27_anim" frameDelay="4"/>
				<frame memberName="plantBlue28_anim" frameDelay="4"/>
				<frame memberName="plantBlue29_anim" frameDelay="4"/>
				<frame memberName="plantBlue30_anim" frameDelay="4"/>
				<frame memberName="plantBlue31_anim" frameDelay="4"/>				
			</frames>
		</animation>
		
		<animation name="PlantDarkAnim" type="loop" xpos="411" ypos="335">
			<frames>
				<frame memberName="plantDark1_anim" frameDelay="4"/>
				<frame memberName="plantDark2_anim" frameDelay="4"/>
				<frame memberName="plantDark3_anim" frameDelay="4"/>
				<frame memberName="plantDark4_anim" frameDelay="4"/>
				<frame memberName="plantDark5_anim" frameDelay="4"/>
				<frame memberName="plantDark6_anim" frameDelay="4"/>
				<frame memberName="plantDark7_anim" frameDelay="4"/>
				<frame memberName="plantDark8_anim" frameDelay="4"/>
				<frame memberName="plantDark9_anim" frameDelay="4"/>
				<frame memberName="plantDark10_anim" frameDelay="4"/>
				<frame memberName="plantDark11_anim" frameDelay="4"/>
				<frame memberName="plantDark12_anim" frameDelay="4"/>
				<frame memberName="plantDark13_anim" frameDelay="4"/>
				<frame memberName="plantDark14_anim" frameDelay="4"/>
				<frame memberName="plantDark15_anim" frameDelay="4"/>
				<frame memberName="plantDark16_anim" frameDelay="4"/>
				<frame memberName="plantDark17_anim" frameDelay="4"/>
				<frame memberName="plantDark18_anim" frameDelay="4"/>
				<frame memberName="plantDark19_anim" frameDelay="4"/>
				<frame memberName="plantDark20_anim" frameDelay="4"/>
				<frame memberName="plantDark21_anim" frameDelay="4"/>
				<frame memberName="plantDark22_anim" frameDelay="4"/>
				<frame memberName="plantDark23_anim" frameDelay="4"/>
				<frame memberName="plantDark24_anim" frameDelay="4"/>
				<frame memberName="plantDark25_anim" frameDelay="4"/>
				<frame memberName="plantDark26_anim" frameDelay="4"/>
				<frame memberName="plantDark27_anim" frameDelay="4"/>
				<frame memberName="plantDark28_anim" frameDelay="4"/>
				<frame memberName="plantDark29_anim" frameDelay="4"/>
				<frame memberName="plantDark30_anim" frameDelay="4"/>
				<frame memberName="plantDark31_anim" frameDelay="4"/>
			</frames>
		</animation>
	</animations>
	
	<zoomWindows>
		<zoomWindow name="WalkieTalkieWindow" file="ZoomWindows\Room4_WalkieTalkieWindow.dir" x="160" y="462" visible="0"/>
		<zoomWindow name="MapPanelWindow" file="ZoomWindows\Room4_MapPanelWindow.dir" x="150" y="217" visible="0"/>
		<zoomWindow name="DarkAreaWindow" file="ZoomWindows\Room4_DarkAreaWindow.dir" x="490" y="462" visible="0"/>
		<zoomWindow name="DoorWindow" file="ZoomWindows\Room4_DoorWindow.dir" x="480" y="217" visible="0"/>
	</zoomWindows>
	
	<objects>
		<object name="Flashlight">
			<clickStrategy type="alpha" layer="Flashlight"/>
			<states>
				<state name="clickable">
					<onStateEnter>
						<action target="Scene" name="HideLayer" param="Flashlight"/>
						<action target="Scene" name="PlaySound" param="indoor_big"/>
						<action target="Scene" name="StartAnimation" param="PlantBlueAnim"/>
					</onStateEnter>
					
					<onMouseOver>
						<action target="Scene" name="SetCursor" param="interactive"/>
					</onMouseOver>
					
					<onClick>
						<action target="Scene" name="AddToInventory" param="FlashlightOff"/>
						<action target="Scene" name="PlaySound" param="pickup_torch"/>
						<action target="Flashlight" name="SetState" param="disabled"/>
					</onClick>
				</state>

				<state name="disabled">
					<onStateEnter>
						<action target="Scene" name="ShowLayer" param="Flashlight"/>
					</onStateEnter>
				</state>
			</states>
		</object>
		
		<object name="Knife">
			<clickStrategy type="alpha" layer="Knife"/>
			<states>
				<state name="clickable">
					<onStateEnter>
						<action target="Scene" name="ShowLayer" param="Knife"/>
					</onStateEnter>
					
					<onMouseOver>
						<action target="Scene" name="SetCursor" param="interactive"/>
					</onMouseOver>
					
					<onClick>
						<action target="Scene" name="AddToInventory" param="Knife"/>
						<action target="Knife" name="SetState" param="acquired"/>
					</onClick>
				</state>
				
				<state name="acquired">
					<onStateEnter>
						<action target="Scene" name="HideLayer" param="Knife"/>
					</onStateEnter>
				</state>
			</states>
		</object>
		
		<object name="WalkieTalkie">
			<clickStrategy type="alpha" layer="WalkieTalkie"/>
			<states>
				<state name="clickable" visible="0">
					<onStateEnter>
						<action target="Scene" name="HideLayer" param="WalkieTalkie"/>
					</onStateEnter>
					
					<onMouseOver>
						<action target="Scene" name="SetCursor" param="zoom"/>
					</onMouseOver>
					
					<onClick>
						<action target="Scene" name="OpenWindow" param="WalkieTalkieWindow"/>
					</onClick>
				</state>
				
				<state name="disabled">
					<onStateEnter>						
						<action target="Scene" name="PlaySound" param="take_battery_from_walkie-talkie"/>
						<action target="Scene" name="ShowDialog" param="pickup_walkietalkie"/>
						<action target="Scene" name="CloseWindow" param="WalkieTalkieWindow"/>
					</onStateEnter>
				</state>
			</states>
		</object>
		
		<object name="MapPanel">
			<clickStrategy type="rect" left="55" top="195" right="115" bottom="350"/>			
			<states>
				<state name="clickable">
					<onStateEnter>
						<action target="Scene" name="HideLayer" param="MapPanel"/>
					</onStateEnter>
					
					<onMouseOver>
						<action target="Scene" name="SetCursor" param="zoom"/>
					</onMouseOver>
					
					<onClick>
						<action target="Scene" name="OpenWindow" param="MapPanelWindow"/>
						<action target="Scene" name="PlaySound" param="open_map_panel"/>
						<action target="MapPanel" name="SetState" param="disabled"/>
					</onClick>
				</state>
				
				<state name="disabled">
					<onStateEnter>
						<action target="Scene" name="ShowLayer" param="MapPanel"/>						
					</onStateEnter>
					
					<onMouseOver>
						<action target="Scene" name="SetCursor" param="zoom"/>
					</onMouseOver>
					
					<onClick>
						<action target="Scene" name="OpenWindow" param="MapPanelWindow"/>
					</onClick>
				</state>
			</states>
		</object>
				
		<object name="MapPanelBulb">
			<states>					
				<state name="lit">
					<onStateEnter>
						<action target="Scene" name="HideLayer" param="MapPanelBulb"/>
					</onStateEnter>
				</state>
				
				<state name="disabled">
					<onStateEnter>
						<action target="Scene" name="ShowLayer" param="MapPanelBulb"/>
						<action target="Scene" name="PlaySound" param="take_the_glasbulb"/>
						<action target="Scene" name="StopAnimation" param="PlantBlueAnim"/>
						<action target="Scene" name="StartAnimation" param="PlantDarkAnim"/>
						
						<action target="Scene" name="CloseWindow" param="MapPanelWindow"/>
					</onStateEnter>	
				</state>
			</states>
		</object>
		
		<object name="DarkArea">
			<clickStrategy type="rect" left="230" top="270" right="350" bottom="360"/>			
			<states>
				<state name="dark">
					<onMouseOver>
						<action target="Scene" name="SetCursor" param="zoom"/>
					</onMouseOver>
					
					<onClick>
						<action target="Scene" name="OpenWindow" param="DarkAreaWindow"/>
						<action target="Scene" name="ShowDialog" param="too_dark"/>
					</onClick>
					
					<onUseObject name="FlashlightOff">
						<action target="Scene" name="ShowDialog" param="flashlight_dead"/>
					</onUseObject>
										
					<onUseObject name="FlashlightWithBatteries">
						<action target="Scene" name="ShowDialog" param="flashlight_noBulb"/>
					</onUseObject>
										
					<onUseObject name="FlashlightWithBulb">
						<action target="Scene" name="ShowDialog" param="flashlight_noBatteries"/>
					</onUseObject>
					
					<onUseObject name="FlashlightWithBulbAndBatteries">
						<action target="DarkArea" name="SetState" param="lit"/>
						<action target="Scene" name="RemoveFromInventory" param="FlashlightWithBulbAndBatteries"/>
						<action target="Scene" name="OpenWindow" param="DarkAreaWindow"/>
					</onUseObject>
				</state>
				
				<state name="lit">
					<onMouseOver>
						<action target="Scene" name="SetCursor" param="zoom"/>
					</onMouseOver>
					
					<onClick>
						<action target="Scene" name="OpenWindow" param="DarkAreaWindow"/>
					</onClick>
				</state>
				
				<state name="litWithoutKnob">
					<onStateEnter>
						<action target="Scene" name="CloseWindow" param="DarkAreaWindow"/>
					</onStateEnter>					
				</state>
			</states>
		</object>
		
		<object name="Door">
			<clickStrategy type="rect" left="150" top="200" right="175" bottom="400"/>			
			<states>
				<state name="noKnob">
					<onStateEnter>
						<action target="Scene" name="HideLayer" param="OpenDoor"/>
					</onStateEnter>
					
					<onMouseOver>
						<action target="Scene" name="SetCursor" param="zoom"/>
					</onMouseOver>
					
					<onClick>
						<action target="Scene" name="OpenWindow" param="DoorWindow"/>
						<action target="Scene" name="ShowDialog" param="no_knob"/>
					</onClick>
					
					<onUseObject name="DoorKnob">
						<action target="Door" name="SetState" param="withKnob"/>
						<action target="Scene" name="RemoveFromInventory" param="DoorKnob"/>						
						<action target="Scene" name="PlaySound" param="use_the_knob_on_the_door"/>
						<action target="Scene" name="CloseWindow" param="DoorWindow" delay="60"/>
					</onUseObject>
				</state>
				
				<state name="withKnob">
					<onStateEnter>
						<action target="Scene" name="ShowLayer" param="OpenDoor"/>
					</onStateEnter>
					
					<onMouseOver>
						<action target="Scene" name="SetCursor" param="exit"/>
					</onMouseOver>
					
					<onClick>
						<action target="Scene" name="RegisterVictoryCondition" param=""/>
					</onClick>				
				</state>
			</states>
		</object>
	</objects>
</scene>
