class 'l_03_yard_z_door' (ZoomEventHandler)

local OPEN_TAIL = 'Tail_Open_'
local CLOSE_TAIL = 'Tail_Close_'
local EYES = 'Eyes_'
local LIZARD = 'Lizard_'
local STONE = 'Stone_'

local LIGHT = 'Light_'

local VIOLET = 'Violet'
local RED = 'Red'
local YELLOW = 'Yellow'
local GREEN = 'Green'

local TIME = 0.5

local TOOL = { 'MG_03_01_item_01', 'MG_03_01_item_02', 'MG_03_01_item_03' }	--// 3 lizards: first - 1 loc, second, third - 3 loc

local SKIP = false

function l_03_yard_z_door:__init(name)
    ZoomEventHandler.__init(self, name)
 
    self.mmg_anim = AnimationBundle( Loader_03mmg_Animations( Object( 'z_door_bg' ) ) )
    
    self.Colors = { VIOLET, RED, YELLOW, GREEN }
    self.LizardStates = { [ LIZARD .. VIOLET ] = true, [ LIZARD .. RED ] = false, [ LIZARD .. YELLOW ] = true, [ LIZARD .. GREEN ] = true }
    self.Dependences = { [ VIOLET ] = { RED, YELLOW }, [ RED ] = { VIOLET, GREEN }, [ YELLOW ] = { GREEN, VIOLET }, [ GREEN ] = { RED, YELLOW } }
	
	Helpers.AttachInPlace(Object('Fire'), Object('Handle'))
	
	self:HideLights()
	self:SetCursors()
	self:SetCurrentTails()
    self:ToolApplying()
    self:LoadGame()
    
end

function l_03_yard_z_door:SkipMiniGame()
	
	self.LizardStates = { [ LIZARD .. VIOLET ] = false, [ LIZARD .. RED ] = false, [ LIZARD .. YELLOW ] = false, [ LIZARD .. GREEN ] = false }
	AddUniqueGameState( 'complete', 'true' )
	self.level:GetPanelLuaObject():SetMode( EPanelMode.PM_QUEST )
	
	SKIP = true
	
	self:ChangeCurrentTails()
	self:IgnoreLizards( true )
	self.zone:Block()
	
	self.timer:Add( function()
		self.mmg_anim:PlayAnimation( 'Handle' )
		MakeSoundEntity('mmg_03_final'):PlaySound(false)
		
		ObjectOpacity( 'Handle' , 0, 0 )
		ObjectOpacity( 'Fire' , 0, 0 )
		
		self:IgnoreLizards( true )
		self.timer:Add( function()
			self.zone:UnBlock()
			self.zone:CloseAndDisable()
			
			self.level.timer:Add(   function()
			                            self.level.anim_bg:PlayAnimation('door')
			                            MakeSoundEntity('03_open_door'):PlaySound(false)
			                            
			                            self.level.timer:Add(   function()
			                                                        ObjectVisible('area_link_04', true)
			                                                    end,
			                                                    self.level.anim_bg:GetAnimation('door'):GetDuration())
			                        end,
			                        ZOOM_ZONE_APPEARING_TIME)
		end, TIME * 2 + 0.2 )
	end, TIME * 2 )
	
end

function l_03_yard_z_door:SaveGame()
	
	Helpers.SaveObjectToGameState( self.name, self.LizardStates )
	
end

function l_03_yard_z_door:LoadGame()
	
	if( HasGameState( 'complete', 'true' ) ) then
		self.level:GetPanelLuaObject():SetMode( EPanelMode.PM_QUEST )
		self.zone:CloseAndDisable()
		
		self.level.anim_bg:GetAnimation('door'):Rewind(true)
        ObjectVisible('area_link_04', true)
	else
		self.level:GetPanelLuaObject():SetMode( EPanelMode.PM_QUEST )
		local save = Helpers.RestoreObjectFromGameState( self.name )
		if( save ~= nil ) then
			self.LizardStates = save
			self:SetCurrentTails()
		end
	end
	
end

function l_03_yard_z_door:OnScreenObjectMouseDown(object, key)

	if( key == HGEK_LBUTTON ) then
		local name = object:GetName()
		--if( string.find( name, LIGHT ) ) then
		if( string.find( name, 'zone_' ) ) then
			
			if not( self:Win() ) then
				MakeSoundEntity('mmg_03_tail'):PlaySound(false)
				local color = string.sub( name, 6 )
				self:ChangeTail( color )
				for dependence = 1, table.maxn( self.Dependences[ color ] ) do
					self:ChangeTail( self.Dependences[ color ][ dependence ] )
				end
			end
			
		--	if not( self:Win() ) then
		--		MakeSoundEntity('mmg_03_tail'):PlaySound(false)
		--		local color = string.sub( name, 7 )
		--		self:ChangeTail( color )
		--		for dependence = 1, table.maxn( self.Dependences[ color ] ) do
		--			self:ChangeTail( self.Dependences[ color ][ dependence ] )
		--		end
		--	end
		--elseif( string.find( name, LIZARD ) ) then
		--	if not( self:Win() ) then
		--		MakeSoundEntity('mmg_03_tail'):PlaySound(false)
		--		local color = string.sub( name, 8 )
		--		self:ChangeTail( color )
		--		for dependence = 1, table.maxn( self.Dependences[ color ] ) do
		--			self:ChangeTail( self.Dependences[ color ][ dependence ] )
		--		end
			--end
		elseif( string.find( name, 'Handle' ) or string.find( name, 'Fire' ) ) then
			if( self:Win() ) then
				MakeSoundEntity('mmg_03_final'):PlaySound(false)
				AddUniqueGameState( 'complete', 'true' )
				self.level:GetPanelLuaObject():SetMode( EPanelMode.PM_QUEST )
				self.mmg_anim:PlayAnimation( 'Handle' )
				--Object( 'Handle' ):MoveTo( Object( 'Handle' ):GetX(), Object( 'Handle' ):GetY() + 50, TIME / 2 )
				ObjectOpacity( 'Handle' , 0, 0 )
				ObjectOpacity( 'Fire' , 0, 0 )
				self:IgnoreLizards( true )
				self.zone:Block()
				self.timer:Add( function()
					self.zone:UnBlock()
					self.zone:CloseAndDisable()
					
					self.level.timer:Add(   function()
                                                self.level.anim_bg:PlayAnimation('door')
                                                MakeSoundEntity('03_open_door'):PlaySound(false)
                                                
                                                self.level.timer:Add(   function()
                                                                            ObjectVisible('area_link_04', true)
                                                                        end,
                                                                        self.level.anim_bg:GetAnimation('door'):GetDuration())
                                            end,
                                            ZOOM_ZONE_APPEARING_TIME)
					                        
				end, TIME * 2 + 0.2 )
			else
				MakeSoundEntity( 'mmg_03_handle_touch' ):StopSound(  )
				MakeSoundEntity( 'mmg_03_handle_touch' ):PlaySound( false )
				Object( 'Handle' ):MoveTo( Object( 'Handle' ):GetX(), Object( 'Handle' ):GetY() + 30, TIME / 2 )
				ObjectOpacity( 'Fire' , 0, 0 )
				self:IgnoreLizards( true )
				self.zone:Block()
				self.timer:Add( function()
					Object( 'Handle' ):MoveTo( Object( 'Handle' ):GetX(), Object( 'Handle' ):GetY() - 30, TIME / 2 )
					ObjectOpacity( 'Fire' , 0, 0 )
					self.timer:Add( function()
						self.zone:UnBlock()
						self:IgnoreLizards( false )
					end, TIME / 2 )
				end, TIME / 2 )
			end
		end
	end

end

function l_03_yard_z_door:ToolApplying()

	ObjectOpacity( 'Lizard_Green', 0, 0 )
	ObjectOpacity( 'Lizard_Violet', 0, 0 )
	ObjectOpacity( 'Lizard_Yellow', 0, 0 )
	ObjectOpacity( 'Eyes_Green', 0, 0 )
	ObjectOpacity( 'Eyes_Violet', 0, 0 )
	ObjectOpacity( 'Eyes_Yellow', 0, 0 )
	self:HideTails()
	
	self.mmg_anim:GetAnimation( RED .. '_open' ):SetVisible( true )
	
	local function firstLizardApply( event )
		ObjectOpacity( 'Lizard_Yellow', 1, 0 )
		self.mmg_anim:GetAnimation( YELLOW .. '_close' ):SetVisible( true )
		ObjectOpacity( 'Eyes_Yellow', 1, 0 )
		if( not event.save ) then
			MakeSoundEntity('mmg_03_tool_apply'):PlaySound(false)
		end

		if( IsToolApplied( TOOL[ 2 ] ) and IsToolApplied( TOOL[ 3 ] ) ) then
			self.level:GetPanelLuaObject():SetMode( EPanelMode.PM_MINIGAME )
			ObjectOpacity( event.target, 0, 0 )
		else
			self.level.custom_cursors[ 'Area_for_tool_1' ] = 'CursorGlass'
		end
	end
	
	local function secondLizardApply( event )
		ObjectOpacity( 'Lizard_Green', 1, 0 )
		self.mmg_anim:GetAnimation( GREEN .. '_close' ):SetVisible( true )
		ObjectOpacity( 'Eyes_Green', 1, 0 )
		if( not event.save ) then
			MakeSoundEntity('mmg_03_tool_apply'):PlaySound(false)
		end
		if( IsToolApplied( TOOL[ 1 ] ) and IsToolApplied( TOOL[ 3 ] ) ) then
			self.level:GetPanelLuaObject():SetMode( EPanelMode.PM_MINIGAME )
			ObjectOpacity( event.target, 0, 0 )
		else
			self.level.custom_cursors[ 'Area_for_tool_1' ] = 'CursorGlass'
		end
	end
	
	local function thirdLizardApply( event )
		ObjectOpacity( 'Lizard_Violet', 1, 0 )
		self.mmg_anim:GetAnimation( VIOLET .. '_close' ):SetVisible( true )
		ObjectOpacity( 'Eyes_Violet', 1, 0 )
		if( not event.save ) then
			MakeSoundEntity('mmg_03_tool_apply'):PlaySound(false)
		end
		if( IsToolApplied( TOOL[ 1 ] ) and IsToolApplied( TOOL[ 2 ] ) ) then
			self.level:GetPanelLuaObject():SetMode( EPanelMode.PM_MINIGAME )
			ObjectOpacity( event.target, 0, 0 )
		else
			self.level.custom_cursors[ 'Area_for_tool_1' ] = 'CursorGlass'
		end
	end

	RegisterToolApplyInfo( TOOL[ 1 ], 'Area_for_tool_1', firstLizardApply, 'BBT_03_DOOR_NEED_LIZARD' )
	RegisterToolApplyInfo( TOOL[ 2 ], 'Area_for_tool_1', secondLizardApply, 'BBT_03_DOOR_NEED_LIZARD' )
	RegisterToolApplyInfo( TOOL[ 3 ], 'Area_for_tool_1', thirdLizardApply, 'BBT_03_DOOR_NEED_LIZARD' )
	
end

function l_03_yard_z_door:Win()
	
	for lizard, state in pairs( self.LizardStates ) do
		if( state == false ) then
			return false
		end
	end
	return true
	
end

function l_03_yard_z_door:ChangeCurrentTails()
	
	for lizard, state in pairs( self.LizardStates ) do
		local color = string.sub( lizard, 8 )
		self:ChangeTail( color )
	end
	
end

function l_03_yard_z_door:ChangeTail( tail_color )
	
	if( self.LizardStates[ LIZARD .. tail_color ] == true ) then
		self:CloseTail( tail_color )
	else
		self:OpenTail( tail_color )
	end
	
end

function l_03_yard_z_door:CloseTail( tail_color )

	ObjectOpacity( EYES .. tail_color, 0, 0 )
	self.LizardStates[ LIZARD .. tail_color ] = false

	self:SaveGame()
	
	self.mmg_anim:PlayAnimation( tail_color .. '_close' )
	self.mmg_anim:GetAnimation( tail_color .. '_open' ):SetVisible( false )
	
	self:IgnoreLizards( true )
	self.zone:Block()
	
	self.timer:Add( function()
		
		if not( SKIP ) then
			self.zone:UnBlock()
			self:IgnoreLizards( false )
		end
	end, TIME * 2 )

end

function l_03_yard_z_door:OpenTail( tail_color )
	
	self.LizardStates[ LIZARD .. tail_color ] = true
	self:SaveGame()
	
	self.mmg_anim:PlayAnimation( tail_color .. '_open' )
	self.mmg_anim:GetAnimation( tail_color .. '_close' ):SetVisible( false )
	
	self:IgnoreLizards( true )
	self.zone:Block()

	self.timer:Add( function()
		
		ObjectOpacity( EYES .. tail_color, 1, 0 )
		if not( SKIP ) then
			self.zone:UnBlock()
			self:IgnoreLizards( false )
		end
	end, TIME * 2 )
	
end

function l_03_yard_z_door:SetCurrentTails()
	
	for lizard, state in pairs( self.LizardStates ) do
		local color = string.sub( lizard, 8 )
		if( state ) then
			self:SetOpenTail( color )
		else
			self:SetCloseTail( color )
		end
	end
	
end

function l_03_yard_z_door:SetCloseTail( tail_color )
	
	self.mmg_anim:GetAnimation( tail_color .. '_close' ):SetVisible( true )
	self.mmg_anim:GetAnimation( tail_color .. '_open' ):SetVisible( false )
	ObjectOpacity( EYES .. tail_color, 0, 0 )
	
end

function l_03_yard_z_door:SetOpenTail( tail_color )
	
	self.mmg_anim:GetAnimation( tail_color .. '_open' ):SetVisible( true )
	self.mmg_anim:GetAnimation( tail_color .. '_close' ):SetVisible( false )
	ObjectOpacity( EYES .. tail_color, 1, 0 )
	
end

function l_03_yard_z_door:HideLights()
	
	for key, color in ipairs( self.Colors ) do
		ObjectOpacity( LIGHT .. color, 0, 0 )
	end
	ObjectOpacity( 'Fire', 0, 0 )
	
end

function l_03_yard_z_door:HideTails()
	
	self.Colors = { VIOLET, RED, YELLOW, GREEN }
	for index, color in ipairs( self.Colors ) do
		self.mmg_anim:GetAnimation( color .. '_open' ):SetVisible( false )
		self.mmg_anim:GetAnimation( color .. '_close' ):SetVisible( false )
	end
	
end

function l_03_yard_z_door:OnObjectMouseEnter(object)
	
	local name = object:GetName()
	--if( string.find( name, 'Lizard' ) ) then
	if( string.find( name, 'zone_' ) ) then
		if not( self:Win() ) then
			--local color = string.sub( name, 8 )
			local color = string.sub( name, 6 )
			ObjectOpacity( LIGHT .. color, 1, 0 )
		else
			self:SetFinalCursors()
		end
	elseif( string.find( name, LIGHT ) ) then
		if not( self:Win() ) then
			ObjectOpacity( name, 1, 0 )
		else
			self:SetFinalCursors()
		end
	elseif( string.find( name, 'Handle' ) or string.find( name, 'Fire' ) ) then
		ObjectOpacity( 'Fire', 1, 0 )
	elseif( string.find( name, 'z_door_bg' ) ) then
		ObjectOpacity( 'Fire', 0, 0 )
	end
	
end

function l_03_yard_z_door:OnObjectMouseLeave(object)

	local name = object:GetName()
	--if( string.find( name, 'Lizard' ) ) then
	if( string.find( name, 'zone_' ) ) then
		--local color = string.sub( name, 8 )
		local color = string.sub( name, 6 )
		ObjectOpacity( LIGHT .. color, 0, 0 )
	elseif( string.find( name, LIGHT ) ) then
		ObjectOpacity( name, 0, 0 )
	elseif( string.find( name, 'Handle' ) ) then
		ObjectOpacity( 'Fire', 0, 0 )
	end
	
end

function l_03_yard_z_door:SetCursors()

	self.level.custom_cursors[ 'Handle' ] = 'CursorActive'
	self.level.custom_cursors[ 'Fire' ] = 'CursorActive'
	for index, color in ipairs( self.Colors ) do
		self.level.custom_cursors[ 'zone_' .. color ] = 'CursorActive'
		self.level.custom_cursors[ LIZARD .. color ] = 'CursorActive'
		self.level.custom_cursors[ LIGHT .. color ] = 'CursorActive'
	end

end

function l_03_yard_z_door:SetFinalCursors()

	self.level.custom_cursors[ 'Handle' ] = 'CursorActive'
	self.level.custom_cursors[ 'Fire' ] = 'CursorActive'
	for index, color in ipairs( self.Colors ) do
		self.level.custom_cursors[ LIZARD .. color ] = 'CursorDefault'
		self.level.custom_cursors[ LIGHT .. color ] = 'CursorDefault'
	end

end

function l_03_yard_z_door:IgnoreLizards( ignore )
	
	if( ignore ) then
		for index, color in ipairs( self.Colors ) do
			play_field:IgnoreOnTestPoint( LIZARD .. color )
			play_field:IgnoreOnTestPoint( LIGHT .. color )
			
			play_field:IgnoreOnTestPoint( 'zone_' .. color )
		end
		play_field:IgnoreOnTestPoint( 'Handle' )
	else
		for index, color in ipairs( self.Colors ) do
			play_field:DoNotIgnoreOnTestPoint( LIZARD .. color )
			play_field:DoNotIgnoreOnTestPoint( LIGHT .. color )
			
			play_field:DoNotIgnoreOnTestPoint( 'zone_' .. color )
		end
		play_field:DoNotIgnoreOnTestPoint( 'Handle' )
	end
	
end

function l_03_yard_z_door:FinalIgnore()
	
	if( ignore ) then
		for index, color in ipairs( self.Colors ) do
			play_field:IgnoreOnTestPoint( LIZARD .. color )
			play_field:IgnoreOnTestPoint( LIGHT .. color )
		end
	end
	
end

function l_03_yard_z_door:OnDefaultOpen()

	if( IsToolApplied( TOOL[ 1 ] ) and IsToolApplied( TOOL[ 2 ] ) and IsToolApplied( TOOL[ 3 ] ) ) then
		self.level:GetPanelLuaObject():SetMode( EPanelMode.PM_MINIGAME )
	end

end

function l_03_yard_z_door:OnDefaultClose()

	self.level:GetPanelLuaObject():SetMode( EPanelMode.PM_QUEST )

end

--------------------------------------------------------------------------------
-- CLEAR_ON_SAVE_BEGIN
-- Do not edit code listed below (generated by the editor on each save)
function l_03_yard_z_door:LoadData(screen)
	local anim
	anim = CreateAnimation('data/Texture/Scenes/03_yard/main/z_door/z_door_bg.jpg',0,0,640,480,1,0)
	anim:SetHotSpot(320,240)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('z_door_bg',anim,512,384,10,0,1,1)
	
	anim = CreateAnimation('data/Texture/Scenes/03_yard/main/z_door/Eyes_Green.png',0,0,26,18,1,0)
	anim:SetHotSpot(13,9)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('Eyes_Green',anim,624,192,103,0,1,1)
	
	anim = CreateAnimation('data/Texture/Scenes/03_yard/main/z_door/Eyes_Red.png',0,0,28,16,1,0)
	anim:SetHotSpot(14,8)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('Eyes_Red',anim,396,191,103,0,1,1)
	
	anim = CreateAnimation('data/Texture/Scenes/03_yard/main/z_door/Eyes_Violet.png',0,0,28,18,1,0)
	anim:SetHotSpot(14,9)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('Eyes_Violet',anim,396,575,103,0,1,1)
	
	anim = CreateAnimation('data/Texture/Scenes/03_yard/main/z_door/Eyes_Yellow.png',0,0,28,16,1,0)
	anim:SetHotSpot(14,8)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('Eyes_Yellow',anim,630,580,103,0,1,1)
	
	anim = CreateAnimation('data/Texture/Scenes/03_yard/main/z_door/Stone_Green.png',0,0,38,38,1,0)
	anim:SetHotSpot(19,19)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('Stone_Green',anim,626,333,99,0,1,1)
	
	anim = CreateAnimation('data/Texture/Scenes/03_yard/main/z_door/Stone_Red.png',0,0,38,38,1,0)
	anim:SetHotSpot(19,19)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('Stone_Red',anim,398,332,99,0,1,1)
	
	anim = CreateAnimation('data/Texture/Scenes/03_yard/main/z_door/Stone_Violet.png',0,0,38,38,1,0)
	anim:SetHotSpot(19,19)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('Stone_Violet',anim,396,436,99,0,1,1)
	
	anim = CreateAnimation('data/Texture/Scenes/03_yard/main/z_door/Stone_Yellow.png',0,0,38,38,1,0)
	anim:SetHotSpot(19,19)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('Stone_Yellow',anim,626,436,99,0,1,1)
	
	anim = CreateAnimation('data/Texture/Scenes/03_yard/main/z_door/Light.png',0,0,108,126,1,0)
	anim:SetHotSpot(54,63)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('Light_Violet',anim,398,525,104,0,1,1)
	
	anim = CreateAnimation('data/Texture/Scenes/03_yard/main/anim/z_door/ruhka.png',0,0,128,126,1,0)
	anim:SetHotSpot(64,63)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('Handle',anim,513,378,100,0,1,1)
	
	anim = CreateAnimation('data/Texture/Scenes/03_yard/main/anim/z_door/YAHIRICA_F.png',0,0,114,146,1,0)
	anim:SetHotSpot(57,73)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('Lizard_Violet',anim,392,528,102,0,1,1)
	
	anim = CreateAnimation('data/Texture/Scenes/03_yard/main/anim/z_door/YAHIRICA_G.png',0,0,114,146,1,0)
	anim:SetHotSpot(57,73)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('Lizard_Yellow',anim,633,532,102,0,1,1)
	
	anim = CreateAnimation('data/Texture/Scenes/03_yard/main/anim/z_door/YAHIRICA_K.png',0,0,114,146,1,0)
	anim:SetHotSpot(57,73)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('Lizard_Red',anim,392,239,102,0,1,1)
	
	anim = CreateAnimation('data/Texture/Scenes/03_yard/main/anim/z_door/YAHIRICA_Z.png',0,0,114,146,1,0)
	anim:SetHotSpot(57,73)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('Lizard_Green',anim,629,239,102,0,1,1)
	
	anim = CreateAnimation('data/Texture/Scenes/03_yard/main/z_door/Light.png',0,0,108,126,1,0)
	anim:SetHotSpot(54,63)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('Light_Yellow',anim,627,529,104,0,-1,1)
	
	anim = CreateAnimation('data/Texture/Scenes/03_yard/main/z_door/Light.png',0,0,108,126,1,0)
	anim:SetHotSpot(54,63)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('Light_Green',anim,622,241,104,180,1,1)
	
	anim = CreateAnimation('data/Texture/Scenes/03_yard/main/z_door/Light.png',0,0,108,126,1,0)
	anim:SetHotSpot(54,63)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('Light_Red',anim,398,240,104,180,-1,1)
	
	anim = CreateAnimation('data/Texture/Common/area.png',0,0,8,8,1,0)
	anim:SetHotSpot(4,4)
	anim:SetBlendMode(2)
	anim:SetColor('0x01FFFFFF')
	screen:CreateObject('Area_for_tool_1',anim,512,384,200,0,60,55)
	
	anim = CreateAnimation('data/Texture/Scenes/03_yard/main/z_door/Handle_Light.png',0,0,122,122,1,0)
	anim:SetHotSpot(61,61)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('Fire',anim,510,377,101,0,1,1)
	
	anim = CreateAnimation('data/Texture/Common/area.png',0,0,8,8,1,0)
	anim:SetHotSpot(4,4)
	anim:SetBlendMode(2)
	anim:SetColor('0x01FFFFFF')
	screen:CreateObject('zone_Red',anim,392,261,120,0,13,25)
	
	anim = CreateAnimation('data/Texture/Common/area.png',0,0,8,8,1,0)
	anim:SetHotSpot(4,4)
	anim:SetBlendMode(2)
	anim:SetColor('0x01FFFFFF')
	screen:CreateObject('zone_Green',anim,630,261,120,0,13,25)
	
	anim = CreateAnimation('data/Texture/Common/area.png',0,0,8,8,1,0)
	anim:SetHotSpot(4,4)
	anim:SetBlendMode(2)
	anim:SetColor('0x01FFFFFF')
	screen:CreateObject('zone_Violet',anim,392,505,120,0,13,25)
	
	anim = CreateAnimation('data/Texture/Common/area.png',0,0,8,8,1,0)
	anim:SetHotSpot(4,4)
	anim:SetBlendMode(2)
	anim:SetColor('0x01FFFFFF')
	screen:CreateObject('zone_Yellow',anim,630,505,120,0,13,25)
	
end
-- CLEAR_ON_SAVE_END
