--**********************************************
--      TOOLS
--**********************************************

function RegisterTools()
    RegisterTool(
        '01_glue',
        'TOOL_INFO_01_GLUE',
        'TOOL_HINT_01_GLUE',
        function()
            local anim = CreateAnimation('data/Texture/Tools/01_glue/Glue.png',0,0,80,80,1,0)
            anim:SetHotSpot(40,40)
            anim:SetBlendMode(2)
            anim:SetColor('0xFFFFFFFF')
            return play_field:CreateObject('tool_glue',anim,512,384,300,0,0.9,0.9)
        end,
        nil,
        function()
            local anim = CreateAnimation('data/Texture/Tools/01_glue/Glue_big.png',0,0,230,230,1,0)
            anim:SetHotSpot(115,115)
            anim:SetBlendMode(2)
            anim:SetColor('0xFFFFFFFF')
            return play_field:CreateObject('tool_glue_info_icon',anim,512,384,300,0,1,1)
        end);
    
    RegisterTool(
        '01_lock',
        'TOOL_INFO_01_LOCK',
        'TOOL_HINT_01_LOCK',
        function()
            local anim = CreateAnimation('data/Texture/Tools/01_lock/Lock.png',0,0,21,80,1,0)
            anim:SetHotSpot(10,40)
            anim:SetBlendMode(2)
            anim:SetColor('0xFFFFFFFF')
            return play_field:CreateObject('tool_lock',anim,945,405,300,0,0.9,0.9)
        end,
        nil,
        function()
            local anim = CreateAnimation('data/Texture/Tools/01_lock/Lock_big.png',0,0,129,44,1,0)
            anim:SetHotSpot(64,22)
            anim:SetBlendMode(2)
            anim:SetColor('0xFFFFFFFF')
            return play_field:CreateObject('tool_lock_info_icon',anim,678,655,100,0,1,1)
        end);
        
    RegisterTool(
        '01_key',
        'TOOL_INFO_01_KEY',
        'TOOL_HINT_01_KEY',
        function()
            local anim = CreateAnimation('data/Texture/Tools/01_key/Key.png',0,0,80,35,1,0)
            anim:SetHotSpot(40,17)
            anim:SetBlendMode(2)
            anim:SetColor('0xFFFFFFFF')
            return play_field:CreateObject('tool_key',anim,512,384,300,0, 0.8, 0.8)
        end,
        nil,
        function()
            local anim = CreateAnimation('data/Texture/Tools/01_key/Key_big.png',0,0,211,93,1,0)
            anim:SetHotSpot(105,46)
            anim:SetBlendMode(2)
            anim:SetColor('0xFFFFFFFF')
            return play_field:CreateObject('tool_key_info_icon',anim,830,104,300,0,1,1)
        end);
            
    RegisterTool(
        '01_newspaper',
        'TOOL_INFO_01_NEWSPAPER',
        'TOOL_HINT_01_NEWSPAPER',
        function()
            local anim = CreateAnimation('data/Texture/Tools/01_newspaper/Newspaper.png',0,0,29,60,1,0)
            anim:SetHotSpot(14,30)
            anim:SetBlendMode(2)
            anim:SetColor('0xFFFFFFFF')
            return play_field:CreateObject('tool_newspaper',anim,136,616,300,0,1,1)
        end,
        nil,
        function()
            local anim = CreateAnimation('data/Texture/Tools/01_newspaper/Newspaper_big.png',0,0,136,279,1,0)
            anim:SetHotSpot(68,139)
            anim:SetBlendMode(2)
            anim:SetColor('0xFFFFFFFF')
            return play_field:CreateObject('tool_newspaper_info_icon',anim,245,558,300,0,1,1)
        end);
    
    RegisterTool(
        '02_can',
        'TOOL_INFO_02_CAN',
        'TOOL_HINT_02_CAN',
        function()
           local anim = CreateAnimation('data/Texture/Tools/02_can/Can.png',0,0,60,60,1,0)
            anim:SetHotSpot(30,30)
            anim:SetBlendMode(2)
            anim:SetColor('0xFFFFFFFF')
            return play_field:CreateObject('tool_can',anim,741,637,300,0,1,1)
        end,
        nil,
        function()
            local anim = CreateAnimation('data/Texture/Tools/02_can/Can_big.png',0,0,230,230,1,0)
            anim:SetHotSpot(115,115)
            anim:SetBlendMode(2)
            anim:SetColor('0xFFFFFFFF')
            return play_field:CreateObject('tool_can_info_icon',anim,859,640,300,0,0.7,0.7)
        end);
        
    RegisterTool(
        '02_lighter_parts',
        'TOOL_INFO_02_LIGHTER_PARTS',
        'TOOL_HINT_02_LIGHTER_PARTS',
        function()
            local anim = CreateAnimation('data/Texture/Tools/02_lighter_parts/LighterParts.png',0,0,60,60,1,0)
            anim:SetHotSpot(30,30)
            anim:SetBlendMode(2)
            anim:SetColor('0xFFFFFFFF')
            return play_field:CreateObject('tool_lighterParts',anim,946,683,300,0,1,1)
        end,
        nil,
        function()
            local anim = CreateAnimation('data/Texture/Tools/02_lighter_parts/LighterParts_big.png',0,0,230,148,1,0)
            anim:SetHotSpot(115,74)
            anim:SetBlendMode(2)
            anim:SetColor('0xFFFFFFFF')
            return play_field:CreateObject('tool_lighterParts_info_icon',anim,935,573,300,0,1,1)
        end);
    
    RegisterTool(
        '02_coin',
        'TOOL_INFO_02_COIN',
        'TOOL_HINT_02_COIN',
        function()
            local anim = CreateAnimation('data/Texture/Tools/02_coin/Coin_big.png',0,0,128,128,1,0)
            anim:SetHotSpot(64,64)
            anim:SetBlendMode(2)
            anim:SetColor('0xFFFFFFFF')
            return play_field:CreateObject('tool_coin',anim,512,384,300,0,0.5,0.5)
        end,
        nil,
        function()
            local anim = CreateAnimation('data/Texture/Tools/02_coin/Coin_big.png',0,0,128,128,1,0)
            anim:SetHotSpot(64,64)
            anim:SetBlendMode(2)
            anim:SetColor('0xFFFFFFFF')
            return play_field:CreateObject('tool_coin_info_icon',anim,512,384,300,0,1,1)
        end);
        
    RegisterTool(
        '02_candle',
        'TOOL_INFO_02_CANDLE',
        'TOOL_HINT_02_CANDLE',
        function()
            local anim = CreateAnimation('data/Texture/Tools/02_candle/Candle.png',0,0,80,19,1,0)
            anim:SetHotSpot(40,9)
            anim:SetBlendMode(2)
            anim:SetColor('0xFFFFFFFF')
            return play_field:CreateObject('tool_candle',anim,764,628,300,0,0.85,0.85)
        end,
        nil,
        function()
            local anim = CreateAnimation('data/Texture/Tools/02_candle/Candle_big.png',0,0,350,83,1,0)
            anim:SetHotSpot(175,41)
            anim:SetBlendMode(2)
            anim:SetColor('0xFFFFFFFF')
            return play_field:CreateObject('tool_candle_info_icon',anim,788,684,300,0,1,1)
        end);
    
    RegisterTool(
        '02_gold',
        'TOOL_INFO_02_GOLD',
        'TOOL_HINT_02_GOLD',
        function()
            local anim = CreateAnimation('data/Texture/Tools/02_gold/Gold.png',0,0,80,80,1,0)
            anim:SetHotSpot(40,40)
            anim:SetBlendMode(2)
            anim:SetColor('0xFFFFFFFF')
            return play_field:CreateObject('tool_gold',anim,364,690,300,0,0.9,0.9)
        end,
        nil,
        function()
            local anim = CreateAnimation('data/Texture/Tools/02_gold/Gold_big.png',0,0,159,235,1,0)
            anim:SetHotSpot(79,117)
            anim:SetBlendMode(2)
            anim:SetColor('0xFFFFFFFF')
            return play_field:CreateObject('tool_gold_info_icon',anim,475,651,300,0,1,1)
        end);
    
    RegisterTool(
        '02_lighter',
        'TOOL_INFO_02_LIGHTER',
        'TOOL_HINT_02_LIGHTER',
        function()
            local anim = CreateAnimation('data/Texture/Tools/02_lighter/Lighter.png',0,0,44,60,1,0)
            anim:SetHotSpot(22,30)
            anim:SetBlendMode(2)
            anim:SetColor('0xFFFFFFFF')
            return play_field:CreateObject('tool_lighter',anim,946,683,300,0,1,1)
        end,
        nil,
        function()
            local anim = CreateAnimation('data/Texture/Tools/02_lighter/Lighter_big.png',0,0,230,312,1,0)
            anim:SetHotSpot(115,156)
            anim:SetBlendMode(2)
            anim:SetColor('0xFFFFFFFF')
            return play_field:CreateObject('tool_lighter_info_icon',anim,946,683,300,0,0.5,0.5)
        end
	);
	
	RegisterTool(
        '02_cutter_part',
        'TOOL_INFO_02_CUTTER_PART',
        'TOOL_HINT_02_CUTTER_PART',
        function()
            local anim = CreateAnimation('data/Texture/Tools/02_cutter_part/CutterPart.png',0,0,36,60,1,0)
            anim:SetHotSpot(18,30)
            anim:SetBlendMode(2)
            anim:SetColor('0xFFFFFFFF')
            return play_field:CreateObject('tool_cutter_part',anim,946,683,300,0,1,1)
        end,
        nil,
        function()
            local anim = CreateAnimation('data/Texture/Tools/02_cutter_part/CutterPart_big.png',0,0,230,385,1,0)
            anim:SetHotSpot(115,192)
            anim:SetBlendMode(2)
            anim:SetColor('0xFFFFFFFF')
            return play_field:CreateObject('tool_cutter_part_info_icon',anim,935,573,300,0,0.4,0.4)
        end);
	
	RegisterTool(
        '03_screwdriver',
        'TOOL_INFO_03_SCREWDRIVER',
        'TOOL_HINT_03_SCREWDRIVER',
        function()
            local anim = CreateAnimation('data/Texture/Tools/03_screwdriver/Screwdriver.png',0,0,80,32,1,0)
            anim:SetHotSpot(40,16)
            anim:SetBlendMode(2)
            anim:SetColor('0xFFFFFFFF')
            return play_field:CreateObject('tool_screwdriver',anim,274,700,300,0,0.8,0.8)
        end,
        nil,
        function()
            local anim = CreateAnimation('data/Texture/Tools/03_screwdriver/Screwdriver_big.png',0,0,230,91,1,0)
            anim:SetHotSpot(115,45)
            anim:SetBlendMode(2)
            anim:SetColor('0xFFFFFFFF')
            return play_field:CreateObject('tool_screwdriver_info_icon',anim,375,701,300,0,1,1)
        end);
        
     RegisterTool(
        '04_cutter',
        'TOOL_INFO_04_CUTTER',
        'TOOL_HINT_04_CUTTER',
        function()
            local anim = CreateAnimation('data/Texture/Tools/04_cutter/Cutter.png',0,0,51,60,1,0)
            anim:SetHotSpot(25,30)
            anim:SetBlendMode(2)
            anim:SetColor('0xFFFFFFFF')
            return play_field:CreateObject('tool_cutter',anim,946,683,300,0,0.9,0.9)
        end,
        nil,
        function()
            local anim = CreateAnimation('data/Texture/Tools/04_cutter/Cutter_big.png',0,0,230,273,1,0)
            anim:SetHotSpot(115,136)
            anim:SetBlendMode(2)
            anim:SetColor('0xFFFFFFFF')
            return play_field:CreateObject('tool_cutter_info_icon',anim,935,573,300,0,0.5,0.5)
        end);
	
	RegisterTool(
        '04_lock_part',
        'TOOL_INFO_04_LOCK_PART',
        'TOOL_HINT_04_LOCK_PART',
        function()
            local anim = CreateAnimation('data/Texture/Tools/05_lock_part/Lock_part_05.png',0,0,112,112,1,0)
            anim:SetHotSpot(56,56)
            anim:SetBlendMode(2)
            anim:SetColor('0xFFFFFFFF')
            return play_field:CreateObject('tool_lock_part_4',anim,512,384,300,0,0.6,0.6)
        end,
        nil,
        function()
            local anim = CreateAnimation('data/Texture/Tools/05_lock_part/Lock_part_05.png',0,0,112,112,1,0)
            anim:SetHotSpot(56,56)
            anim:SetBlendMode(2)
            anim:SetColor('0xFFFFFFFF')
            return play_field:CreateObject('tool_lock_part_info_icon',anim,512,384,300,0,1,1)
        end);
    
    RegisterTool(
        '04_pick',
        'TOOL_INFO_04_PICK',
        'TOOL_HINT_04_PICK',
        function()
            local anim = CreateAnimation('data/Texture/Tools/04_pick/Pick.png',0,0,58,80,1,0)
            anim:SetHotSpot(29,40)
            anim:SetBlendMode(2)
            anim:SetColor('0xFFFFFFFF')
            return play_field:CreateObject('tool_pick',anim,668,657,300,0,0.8,0.8)
        end,
        nil,
        function()
            local anim = CreateAnimation('data/Texture/Tools/04_pick/Pick_big.png',0,0,167,230,1,0)
            anim:SetHotSpot(83,115)
            anim:SetBlendMode(2)
            anim:SetColor('0xFFFFFFFF')
            return play_field:CreateObject('tool_pick_info_icon',anim,764,601,300,0,1,1)
        end);
	
	RegisterTool(
        '04_fretsaw',
        'TOOL_INFO_04_FRETSAW',
        'TOOL_HINT_04_FRETSAW',
        function()
            local anim = CreateAnimation('data/Texture/Tools/04_fretsaw/Fretsaw.png',0,0,80,8,1,0)
            anim:SetHotSpot(40,4)
            anim:SetBlendMode(2)
            anim:SetColor('0xFFFFFFFF')
            return play_field:CreateObject('tool_fretsaw',anim,512,384,300,0,0.9,0.9)
        end,
        nil,
        function()
            local anim = CreateAnimation('data/Texture/Tools/04_fretsaw/Fretsaw_big.png',0,0,230,22,1,0)
            anim:SetHotSpot(115,11)
            anim:SetBlendMode(2)
            anim:SetColor('0xFFFFFFFF')
            return play_field:CreateObject('tool_fretsaw_inco_icon',anim,512,384,300,0,1,1)
        end);
    
    RegisterTool(
        '05_lamp',
        'TOOL_INFO_05_LAMP',
        'TOOL_HINT_05_LAMP',
        function()
            local anim = CreateAnimation('data/Texture/Tools/05_lamp/Lamp.png',0,0,44,78,1,0)
            anim:SetHotSpot(21,40)
            anim:SetBlendMode(2)
            anim:SetColor('0xFFFFFFFF')
            return play_field:CreateObject('tool_lamp',anim,512,384,300,0,0.9,0.9)
        end,
        nil,
        function()
            local anim = CreateAnimation('data/Texture/Tools/05_lamp/Lamp_big.png',0,0,121,230,1,0)
            anim:SetHotSpot(60,115)
            anim:SetBlendMode(2)
            anim:SetColor('0xFFFFFFFF')
            return play_field:CreateObject('tool_lamp_info_icon',anim,512,384,300,0,1,1)
        end);
        
    RegisterTool(
        '05_match',
        'TOOL_INFO_05_MATCH',
        'TOOL_HINT_05_MATCH',
        function()
            local anim = CreateAnimation('data/Texture/Tools/05_match/Match.png',0,0,80,40,1,0)
            anim:SetHotSpot(40,20)
            anim:SetBlendMode(2)
            anim:SetColor('0xFFFFFFFF')
            return play_field:CreateObject('tool_match',anim,512,384,300,0,0.8,0.8)
        end,
        nil,
        function()
            local anim = CreateAnimation('data/Texture/Tools/05_match/Match_big.png',0,0,230,115,1,0)
            anim:SetHotSpot(115,57)
            anim:SetBlendMode(2)
            anim:SetColor('0xFFFFFFFF')
            return play_field:CreateObject('tool_match_info_icon',anim,512,384,300,0,1,1)
        end);
    
    RegisterTool(
        '05_matchbox',
        'TOOL_INFO_05_MATCHBOX',
        'TOOL_HINT_05_MATCHBOX',
        function()
            local anim = CreateAnimation('data/Texture/Tools/05_matchbox/Matchbox.png',0,0,80,80,1,0)
            anim:SetHotSpot(40,40)
            anim:SetBlendMode(2)
            anim:SetColor('0xFFFFFFFF')
            return play_field:CreateObject('tool_matchbox',anim,512,384,300,0,0.9,0.9)
        end,
        nil,
        function()
            local anim = CreateAnimation('data/Texture/Tools/05_matchbox/Matchbox_big.png',0,0,206,199,1,0)
            anim:SetHotSpot(103,99)
            anim:SetBlendMode(2)
            anim:SetColor('0xFFFFFFFF')
            return play_field:CreateObject('tool_matchbox_info_icon',anim,512,384,300,0,1,1)
        end);
        
	RegisterTool(
        '05_safe_valve',
        'TOOL_INFO_05_SAFE_VALVE',
        'TOOL_HINT_05_SAFE_VALVE',
        function()
            local anim = CreateAnimation('data/Texture/Tools/05_safe_valve/Safe_valve.png',0,0,80,80,1,0)
            anim:SetHotSpot(40,40)
            anim:SetBlendMode(2)
            anim:SetColor('0xFFFFFFFF')
            return play_field:CreateObject('tool_safe_valve',anim,757,723,300,0,1,1)
        end,
        nil,
        function()
            local anim = CreateAnimation('data/Texture/Tools/05_safe_valve/Safe_valve_big.png',0,0,230,188,1,0)
            anim:SetHotSpot(115,94)
            anim:SetBlendMode(2)
            anim:SetColor('0xFFFFFFFF')
            return play_field:CreateObject('tool_safe_valve_info_icon',anim,865,677,300,0,1,1)
        end);
        
    RegisterTool(
        '05_lock_part',
        'TOOL_INFO_05_LOCK_PART',
        'TOOL_HINT_05_LOCK_PART',
        function()
            local anim = CreateAnimation('data/Texture/Tools/05_lock_part/Lock_part_05.png',0,0,112,112,1,0)
            anim:SetHotSpot(56,56)
            anim:SetBlendMode(2)
            anim:SetColor('0xFFFFFFFF')
            return play_field:CreateObject('tool_lock_part_5',anim,512,384,300,0,0.6,0.6)
        end,
        nil,
        function()
            local anim = CreateAnimation('data/Texture/Tools/05_lock_part/Lock_part_05.png',0,0,112,112,1,0)
            anim:SetHotSpot(56,56)
            anim:SetBlendMode(2)
            anim:SetColor('0xFFFFFFFF')
            return play_field:CreateObject('tool_lock_part_info_icon',anim,512,384,300,0,1,1)
        end);
    
    RegisterTool(
        '05_knife',
        'TOOL_INFO_05_KNIFE',
        'TOOL_HINT_05_KNIFE',
        function()
            local anim = CreateAnimation('data/Texture/Tools/05_knife/Knife.png',0,0,80,80,1,0)
            anim:SetHotSpot(35,40)
            anim:SetBlendMode(2)
            anim:SetColor('0xFFFFFFFF')
            return play_field:CreateObject('tool_knife',anim,512,384,300,0,0.73,0.73)
        end,
        nil,
        function()
            local anim = CreateAnimation('data/Texture/Tools/05_knife/Knife_big.png',0,0,180,155,1,0)
            anim:SetHotSpot(90,77)
            anim:SetBlendMode(2)
            anim:SetColor('0xFFFFFFFF')
            return play_field:CreateObject('tool_knife_info_icon',anim,512,384,300,0,1,1)
        end);
    
    RegisterTool(
        '05_scroll_retort',
        'TOOL_INFO_05_SCROLL_RETORT',
        'TOOL_HINT_05_SCROLL_RETORT',
        function()
            local anim = CreateAnimation('data/Texture/Tools/05_scroll_retort/ScrollRetort.png',0,0,80,80,1,0)
            anim:SetHotSpot(40,40)
            anim:SetBlendMode(2)
            anim:SetColor('0xFFFFFFFF')
            return play_field:CreateObject('tool_scroll_retort',anim,512,384,300,0,0.8,0.8)
        end,
        nil,
        function()
            local anim = CreateAnimation('data/Texture/Tools/05_scroll_retort/ScrollRetort_big.png',0,0,244,78,1,0)
            anim:SetHotSpot(122,39)
            anim:SetBlendMode(2)
            anim:SetColor('0xFFFFFFFF')
            return play_field:CreateObject('tool_scroll_retort_info_icon',anim,512,384,300,0,1,1)
        end);
        
    RegisterTool(
        '05_soap',
        'TOOL_INFO_05_SOAP',
        'TOOL_HINT_05_SOAP',
        function()
            local anim = CreateAnimation('data/Texture/Tools/05_soap/Soap.png',0,0,80,80,1,0)
            anim:SetHotSpot(40,40)
            anim:SetBlendMode(2)
            anim:SetColor('0xFFFFFFFF')
            return play_field:CreateObject('tool_soap',anim,512,384,300,0,0.8,0.8)
        end,
        nil,
        function()
            local anim = CreateAnimation('data/Texture/Tools/05_soap/Soap_big.png',0,0,230,230,1,0)
            anim:SetHotSpot(115,115)
            anim:SetBlendMode(2)
            anim:SetColor('0xFFFFFFFF')
            return play_field:CreateObject('tool_soap_info_icon',anim,512,384,300,0,1,1)
        end);
    
    RegisterTool(
        '06_owl_button',
        'TOOL_INFO_06_OWL_BUTTON',
        'TOOL_HINT_06_OWL_BUTTON',
        function()
            local anim = CreateAnimation('data/Texture/Tools/06_owl_button/OwlButton.png',0,0,79,174,1,0)
            anim:SetHotSpot(39,87)
            anim:SetBlendMode(2)
            anim:SetColor('0xFFFFFFFF')
            return play_field:CreateObject('tool_owl_button',anim,512,384,300,0,0.4,0.4)
        end,
        nil,
        function()
            local anim = CreateAnimation('data/Texture/Tools/06_owl_button/OwlButton_big.png',0,0,230,506,1,0)
            anim:SetHotSpot(115,253)
            anim:SetBlendMode(2)
            anim:SetColor('0xFFFFFFFF')
            return play_field:CreateObject('tool_owl_button_info_icon',anim,512,384,300,0,1,1)
        end);
        
    RegisterTool(
        '06_scoop_net',
        'TOOL_INFO_06_SCOOP_NET',
        'TOOL_HINT_06_SCOOP_NET',
        function()
            local anim = CreateAnimation('data/Texture/Tools/06_scoop_net/ScoopNet.png',0,0,80,80,1,0)
            anim:SetHotSpot(40,40)
            anim:SetBlendMode(2)
            anim:SetColor('0xFFFFFFFF')
            return play_field:CreateObject('tool_scoop_net',anim,512,384,300,0,0.8,0.8)
        end,
        nil,
        function()
            local anim = CreateAnimation('data/Texture/Tools/06_scoop_net/ScoopNet_big.png',0,0,230,230,1,0)
            anim:SetHotSpot(115,115)
            anim:SetBlendMode(2)
            anim:SetColor('0xFFFFFFFF')
            return play_field:CreateObject('tool_scoop_net_info_icon',anim,512,384,300,0,1,1)
        end);
    
    RegisterTool(
        '06_key',
        'TOOL_INFO_06_KEY',
        'TOOL_HINT_06_KEY',
        function()
            local anim = CreateAnimation('data/Texture/Tools/06_key/Key.png',0,0,79,27,1,0)
            anim:SetHotSpot(39,13)
            anim:SetBlendMode(2)
            anim:SetColor('0xFFFFFFFF')
            return play_field:CreateObject('tool_key',anim,512,384,300,0,0.9,0.9)
        end,
        nil,
        function()
            local anim = CreateAnimation('data/Texture/Tools/06_key/Key_big.png',0,0,230,78,1,0)
            anim:SetHotSpot(115,39)
            anim:SetBlendMode(2)
            anim:SetColor('0xFFFFFFFF')
            return play_field:CreateObject('tool_key_info_icon',anim,512,384,300,0,1,1)
        end);
    
    RegisterTool(
        '06_valve',
        'TOOL_INFO_06_VALVE',
        'TOOL_HINT_06_VALVE',
        function()
            local anim = CreateAnimation('data/Texture/Tools/06_valve/Valve.png',0,0,79,56,1,0)
            anim:SetHotSpot(39,28)
            anim:SetBlendMode(2)
            anim:SetColor('0xFFFFFFFF')
            return play_field:CreateObject('tool_06_valve',anim,512,384,300,0,0.9,0.9)
        end,
        nil,
        function()
            local anim = CreateAnimation('data/Texture/Tools/06_valve/Valve_big.png',0,0,230,162,1,0)
            anim:SetHotSpot(115,81)
            anim:SetBlendMode(2)
            anim:SetColor('0xFFFFFFFF')
            return play_field:CreateObject('tool_06_valve_info_icon',anim,512,384,300,0,1,1)
        end);
        
    RegisterTool(
        '06_button',
        'TOOL_INFO_06_BUTTON',
        'TOOL_HINT_06_BUTTON',
        function()
            local anim = CreateAnimation('data/Texture/Tools/06_button/Button.png',0,0,79,79,1,0)
            anim:SetHotSpot(39,39)
            anim:SetBlendMode(2)
            anim:SetColor('0xFFFFFFFF')
            return play_field:CreateObject('tool_06_button',anim,512,384,300,0,0.7,0.7)
        end,
        nil,
        function()
            local anim = CreateAnimation('data/Texture/Tools/06_button/Button_big.png',0,0,230,230,1,0)
            anim:SetHotSpot(115,115)
            anim:SetBlendMode(2)
            anim:SetColor('0xFFFFFFFF')
            return play_field:CreateObject('tool_06_button_info_icon',anim,512,384,300,0,1,1)
        end);
        
    RegisterTool(
        '06_hammer',
        'TOOL_INFO_06_HAMMER',
        'TOOL_HINT_06_HAMMER',
        function()
            local anim = CreateAnimation('data/Texture/Tools/06_hammer/Hammer.png',0,0,79,79,1,0)
            anim:SetHotSpot(39,39)
            anim:SetBlendMode(2)
            anim:SetColor('0xFFFFFFFF')
            return play_field:CreateObject('tool_hammer',anim,512,384,300,0,0.9,0.9)
        end,
        nil,
        function()
            local anim = CreateAnimation('data/Texture/Tools/06_hammer/Hammer_big.png',0,0,180,223,1,0)
            anim:SetHotSpot(90,111)
            anim:SetBlendMode(2)
            anim:SetColor('0xFFFFFFFF')
            return play_field:CreateObject('tool_hammer_info_icon',anim,512,384,300,0,1,1)
        end);
    
    RegisterTool(
        '06_ball',
        'TOOL_INFO_06_BALL',
        'TOOL_HINT_06_BALL',
        function()
            local anim = CreateAnimation('data/Texture/Tools/06_ball/Ball1.png',0,0,82,82,1,0)
            anim:SetHotSpot(41,41)
            anim:SetBlendMode(2)
            anim:SetColor('0xFFFFFFFF')
            return play_field:CreateObject('tool_ball_1',anim,512,384,300,0,0.7,0.7)
        end,
        nil,
        function()
            local anim = CreateAnimation('data/Texture/Tools/06_ball/Ball1_big.png',0,0,231,232,1,0)
            anim:SetHotSpot(115, 90)
            anim:SetBlendMode(2)
            anim:SetColor('0xFFFFFFFF')
            return play_field:CreateObject('tool_ball_1_info_icon',anim,512,384,300,0,1,1)
        end);
        
    
    RegisterTool(
        '18_bell',
        'TOOL_INFO_18_BELL',
        'TOOL_HINT_18_BELL',
        function()
            local anim = CreateAnimation('data/Texture/Tools/18_bell/Bell.png',0,0,24,79,1,0)
            anim:SetHotSpot(12,39)
            anim:SetBlendMode(2)
            anim:SetColor('0xFFFFFFFF')
            return play_field:CreateObject('tool_bell',anim,512,384,300,0,0.9,0.9)
        end,
        nil,
        function()
            local anim = CreateAnimation('data/Texture/Tools/18_bell/Bell_big.png',0,0,71,230,1,0)
            anim:SetHotSpot(35,115)
            anim:SetBlendMode(2)
            anim:SetColor('0xFFFFFFFF')
            return play_field:CreateObject('tool_bell_info_icon',anim,512,384,300,0,1,1)
        end);
    
    RegisterTool(
        '07_button',
        'TOOL_INFO_07_BUTTON',
        'TOOL_HINT_07_BUTTON',
        function()
            local anim = CreateAnimation('data/Texture/Tools/07_button/Button.png',0,0,79,79,1,0)
            anim:SetHotSpot(39,39)
            anim:SetBlendMode(2)
            anim:SetColor('0xFFFFFFFF')
            return play_field:CreateObject('tool_07_button',anim,512,384,300,0,0.7,0.7)
        end,
        nil,
        function()
            local anim = CreateAnimation('data/Texture/Tools/07_button/Button_big.png',0,0,230,230,1,0)
            anim:SetHotSpot(115,115)
            anim:SetBlendMode(2)
            anim:SetColor('0xFFFFFFFF')
            return play_field:CreateObject('tool_07_Button_info_icon',anim,512,384,300,0,1,1)
        end);
    
    RegisterTool(
        '07_pincers',
        'TOOL_INFO_07_PINCERS',
        'TOOL_HINT_07_PINCERS',
        function()
            local anim = CreateAnimation('data/Texture/Tools/07_pincers/Pincers.png',0,0,115,48,1,0)
            anim:SetHotSpot(57,24)
            anim:SetBlendMode(2)
            anim:SetColor('0xFFFFFFFF')
            return play_field:CreateObject('tool_pincers',anim,512,384,300,0,0.6,0.6)
        end,
        nil,
        function()
            local anim = CreateAnimation('data/Texture/Tools/07_pincers/Pincers_big.png',0,0,230,78,1,0)
            anim:SetHotSpot(115,29)
            anim:SetBlendMode(2)
            anim:SetColor('0xFFFFFFFF')
            return play_field:CreateObject('tool_pincers_info_icon',anim,512,384,300,0,1,1)
        end);

    RegisterTool(
        '07_flask',
        'TOOL_INFO_07_FLASK',
        'TOOL_HINT_07_FLASK',
        function()
            local anim = CreateAnimation('data/Texture/Tools/07_flask/Flask.png',0,0,88,50,1,0)
            anim:SetHotSpot(44,25)
            anim:SetBlendMode(2)
            anim:SetColor('0xFFFFFFFF')
            return play_field:CreateObject('tool_flask',anim,512,384,300,0,0.9,-0.9)
        end,
        nil,
        function()
            local anim = CreateAnimation('data/Texture/Tools/07_flask/Flask_big.png',0,0,91,327,1,0)
            anim:SetHotSpot(45,163)
            anim:SetBlendMode(2)
            anim:SetColor('0xFFFFFFFF')
            return play_field:CreateObject('tool_flask_info_icon',anim,512,384,100,0,1,1)
        end);
        
    RegisterTool(
        '07_pipette',
        'TOOL_INFO_07_PIPETTE',
        'TOOL_HINT_07_PIPETTE',
        function()
            local anim = CreateAnimation('data/Texture/Tools/07_pipette/Pipette.png',0,0,86,57,1,0)
            anim:SetHotSpot(43,28)
            anim:SetBlendMode(2)
            anim:SetColor('0xFFFFFFFF')
            return play_field:CreateObject('tool_pipette',anim,512,384,300,0,0.8,0.8)
        end,
        nil,
        function()
            local anim = CreateAnimation('data/Texture/Tools/07_pipette/Pipette_big.png',0,0,241,153,1,0)
            anim:SetHotSpot(120,76)
            anim:SetBlendMode(2)
            anim:SetColor('0xFFFFFFFF')
            return play_field:CreateObject('tool_pipette_info_icon',anim,512,384,300,0,1,1)
        end);
    
    RegisterTool(
        '08_doorknob',
        'TOOL_INFO_08_DOORKNOB',
        'TOOL_HINT_08_DOORKNOB',
        function()
            local anim = CreateAnimation('data/Texture/Tools/08_doorknob/Doorknob.png',0,0,46,80,1,0)
            anim:SetHotSpot(10,40)
            anim:SetBlendMode(2)
            anim:SetColor('0xFFFFFFFF')
            return play_field:CreateObject('tool_doorknob',anim,105,596,300,0,0.9,0.9)
        end,
        nil,
        function()
            local anim = CreateAnimation('data/Texture/Tools/08_doorknob/Doorknob_big.png',0,0,230,400,1,0)
            anim:SetHotSpot(30,170)
            anim:SetBlendMode(2)
            anim:SetColor('0xFFFFFFFF')
            return play_field:CreateObject('tool_doorknob_info_icon',anim,250,561,300,0,1,1)
        end);
    
    RegisterTool(
        '09_key',
        'TOOL_INFO_09_KEY',
        'TOOL_HINT_09_KEY',
        function()
            local anim = CreateAnimation('data/Texture/Tools/09_key/Key09.png',0,0,80,80,1,0)
            anim:SetHotSpot(40,40)
            anim:SetBlendMode(2)
            anim:SetColor('0xFFFFFFFF')
            return play_field:CreateObject('Key09',anim,512,384,300,0,0.85,0.85)
        end,
        nil,
        function()
            local anim = CreateAnimation('data/Texture/Tools/09_key/Key09_big.png',0,0,133,198,1,0)
            anim:SetHotSpot(66,99)
            anim:SetBlendMode(2)
            anim:SetColor('0xFFFFFFFF')
            return play_field:CreateObject('Key09_big',anim,512,384,300,0,1,1)
        end);
        
     RegisterTool(
        '09_tail',
        'TOOL_INFO_09_TAIL',
        'TOOL_HINT_09_TAIL',
        function()
            local anim = CreateAnimation('data/Texture/Tools/09_tail/Tail.png',0,0,71,71,1,0)
            anim:SetHotSpot(35,35)
            anim:SetBlendMode(2)
            anim:SetColor('0xFFFFFFFF')
            return play_field:CreateObject('tool_tail09',anim,496,701,100,0,1,1)
        end,
        nil,
        function()
            local anim = CreateAnimation('data/Texture/Tools/09_tail/09_Tail_5.png',0,0,98,103,1,0)
            anim:SetHotSpot(49,51)
            anim:SetBlendMode(2)
            anim:SetColor('0xFFFFFFFF')
            return play_field:CreateObject('tool_tail09_info_icon',anim,377,186,300,0,1,1)
        end);
    
    RegisterTool(
        '09_lever',
        'TOOL_INFO_09_LEVER',
        'TOOL_HINT_09_LEVER',
        function()
            local anim = CreateAnimation('data/Texture/Tools/09_lever/Lever.png',0,0,79,31,1,0)
            anim:SetHotSpot(39,15)
            anim:SetBlendMode(2)
            anim:SetColor('0xFFFFFFFF')
            return play_field:CreateObject('tool_lever',anim,512,384,300,0,1,1)
        end,
        nil,
        function()
            local anim = CreateAnimation('data/Texture/Tools/09_lever/Lever_big.png',0,0,230,91,1,0)
            anim:SetHotSpot(115,45)
            anim:SetBlendMode(2)
            anim:SetColor('0xFFFFFFFF')
            return play_field:CreateObject('tool_tever_info_icon',anim,512,384,300,0,1,1)    
        end);    
        
    RegisterTool(
        '09_duster',
        'TOOL_INFO_09_DUSTER',
        'TOOL_HINT_09_DUSTER',
        function()
            local anim = CreateAnimation('data/Texture/Tools/09_duster/Duster.png',0,0,80,80,1,0)
            anim:SetHotSpot(40,40)
            anim:SetBlendMode(2)
            anim:SetColor('0xFFFFFFFF')
            return play_field:CreateObject('tool_duster',anim,512,384,300,0,0.9,0.9)
        end,
        nil,
        function()
            local anim = CreateAnimation('data/Texture/Tools/09_duster/Duster_big.png',0,0,230,230,1,0)
            anim:SetHotSpot(115,115)
            anim:SetBlendMode(2)
            anim:SetColor('0xFFFFFFFF')
            return play_field:CreateObject('tool_duster_info_icon',anim,512,384,300,0,1,1)
        end);
    
    RegisterTool(
        '09_duster_wet',
        'TOOL_INFO_09_DUSTER_WET',
        'TOOL_HINT_09_DUSTER_WET',
        function()
            local anim = CreateAnimation('data/Texture/Tools/09_duster_wet/DusterWet.png',0,0,79,79,1,0)
            anim:SetHotSpot(39,39)
            anim:SetBlendMode(2)
            anim:SetColor('0xFFFFFFFF')
            return play_field:CreateObject('tool_duster_wet',anim,512,384,300,0,0.9,0.9)
        end,
        nil,
        function()
            local anim = CreateAnimation('data/Texture/Tools/09_duster_wet/DusterWet_big.png',0,0,230,230,1,0)
            anim:SetHotSpot(115,115)
            anim:SetBlendMode(2)
            anim:SetColor('0xFFFFFFFF')
            return play_field:CreateObject('tool_duster_wet_info_icon',anim,512,384,300,0,1,1)
        end);
        
    RegisterTool(
        '12_goblet',
        'TOOL_INFO_12_GOBLET',
        'TOOL_HINT_12_GOBLET',
        function()
            local anim = CreateAnimation('data/Texture/Tools/12_goblet/Goblet.png',0,0,80,80,1,0)
            anim:SetHotSpot(40,40)
            anim:SetBlendMode(2)
            anim:SetColor('0xFFFFFFFF')
            return play_field:CreateObject('tool_goblet',anim,327,314,300,0,0.9,0.9)
        end,
        nil,
        function()
            local anim = CreateAnimation('data/Texture/Tools/12_goblet/Goblet_big.png',0,0,230,230,1,0)
            anim:SetHotSpot(115,115)
            anim:SetBlendMode(2)
            anim:SetColor('0xFFFFFFFF')
            return play_field:CreateObject('tool_goblet_info_icon',anim,512,384,300,0,1,1)
        end);
    
    RegisterTool(
        '12_corkscrew',
        'TOOL_INFO_12_CORKSCREW',
        'TOOL_HINT_12_CORKSCREW',
        function()
            local anim = CreateAnimation('data/Texture/Tools/12_corkscrew/Corkscrew.png',0,0,80,80,1,0)
            anim:SetHotSpot(37,40)
            anim:SetBlendMode(2)
            anim:SetColor('0xFFFFFFFF')
            return play_field:CreateObject('tool_corkscrew',anim,416,70,300,0,0.9,0.9)
        end,
        nil,
        function()
            local anim = CreateAnimation('data/Texture/Tools/12_corkscrew/Corkscrew_big.png',0,0,230,230,1,0)
            anim:SetHotSpot(115,115)
            anim:SetBlendMode(2)
            anim:SetColor('0xFFFFFFFF')
            return play_field:CreateObject('tool_corkscrew_info_icon',anim,526,133,300,0,1,1)
        end);

    RegisterTool(
        '12_wine_bottle',
        'TOOL_INFO_12_WINE_BOTTLE',
        'TOOL_HINT_12_WINE_BOTTLE',
        function()
            local anim = CreateAnimation('data/Texture/Tools/12_wine_bottle/Wine_bottle.png',0,0,80,80,1,0)
            anim:SetHotSpot(40,40)
            anim:SetBlendMode(2)
            anim:SetColor('0xFFFFFFFF')
            return play_field:CreateObject('tool_wine_bottle',anim,512,384,300,0,1,1)
        end,
        nil,
        function()
            local anim = CreateAnimation('data/Texture/Tools/12_wine_bottle/Wine_bottle_big.png',0,0,230,230,1,0)
            anim:SetHotSpot(115,115)
            anim:SetBlendMode(2)
            anim:SetColor('0xFFFFFFFF')
            return play_field:CreateObject('tool_wine_bottle_info_icon',anim,512,384,300,0,1,1)
        end);
	
	RegisterTool(
        '12_wine_glass',
        'TOOL_INFO_12_WINE_GLASS',
        'TOOL_HINT_12_WINE_GLASS',
        function()
            local anim = CreateAnimation('data/Texture/Tools/12_wine_glass/Wine_glass.png',0,0,80,80,1,0)
            anim:SetHotSpot(35,40)
            anim:SetBlendMode(2)
            anim:SetColor('0xFFFFFFFF')
            return play_field:CreateObject('tool_wine_glass',anim,512,384,300,0,0.9,0.9)
        end,
        nil,
        function()
            local anim = CreateAnimation('data/Texture/Tools/12_wine_glass/Wine_glass_big.png',0,0,230,230,1,0)
            anim:SetHotSpot(115,115)
            anim:SetBlendMode(2)
            anim:SetColor('0xFFFFFFFF')
            return play_field:CreateObject('tool_wine_glass_info_icon',anim,512,384,300,0,1,1)
        end);
    
    RegisterTool(
        '13_stone',
        'TOOL_INFO_13_STONE',
        'TOOL_HINT_13_STONE',
        function()
            local anim = CreateAnimation('data/Texture/Tools/13_stone/Stone.png',0,0,80,80,1,0)
            anim:SetHotSpot(40,40)
            anim:SetBlendMode(2)
            anim:SetColor('0xFFFFFFFF')
            return play_field:CreateObject('tool_stone',anim,512,384,300,0,1,1)
        end,
        nil,
        function()
            local anim = CreateAnimation('data/Texture/Tools/13_stone/Stone_big.png',0,0,214,150,1,0)
            anim:SetHotSpot(100,60)
            anim:SetBlendMode(2)
            anim:SetColor('0xFFFFFFFF')
            return play_field:CreateObject('tool_stone_info_icon',anim,512,384,300,0,1,1)
        end);
        
    RegisterTool(
        '13_flock',
        'TOOL_INFO_13_FLOCK',
        'TOOL_HINT_13_FLOCK',
        function()
            local anim = CreateAnimation('data/Texture/Tools/13_flock/Flock.png',0,0,79,41,1,0)
            anim:SetHotSpot(40,21)
            anim:SetBlendMode(2)
            anim:SetColor('0xFFFFFFFF')
            return play_field:CreateObject('tool_flock',anim,512,384,300,0,1,1)
        end,
        nil,
        function()
            local anim = CreateAnimation('data/Texture/Tools/13_flock/Flock_big.png',0,0,230,230,1,0)
            anim:SetHotSpot(115,115)
            anim:SetBlendMode(2)
            anim:SetColor('0xFFFFFFFF')
            return play_field:CreateObject('tool_flock_info_icon',anim,512,384,300,0,1,1)
        end);
    
    RegisterTool(
        '13_blood_pipette',
        'TOOL_INFO_13_BLOOD_PIPETTE',
        'TOOL_HINT_13_BLOOD_PIPETTE',
        function()
            local anim = CreateAnimation('data/Texture/Tools/13_blood_pipette/BloodPipette.png',0,0,79,79,1,0)
            anim:SetHotSpot(39,39)
            anim:SetBlendMode(2)
            anim:SetColor('0xFFFFFFFF')
            return play_field:CreateObject('tool_blood_pipette',anim,512,384,300,0,0.7,0.7)
        end,
        nil,
        function()
            local anim = CreateAnimation('data/Texture/Tools/13_blood_pipette/BloodPipette_big.png',0,0,230,230,1,0)
            anim:SetHotSpot(115,115)
            anim:SetBlendMode(2)
            anim:SetColor('0xFFFFFFFF')
            return play_field:CreateObject('tool_blood_pipette_info_icon',anim,512,384,300,0,1,1)
        end);
    
    RegisterTool(
        '14_button',
        'TOOL_INFO_14_BUTTON',
        'TOOL_HINT_14_BUTTON',
        function()
            local anim = CreateAnimation('data/Texture/Tools/14_button/Button.png',0,0,80,80,1,0)
            anim:SetHotSpot(40,40)
            anim:SetBlendMode(2)
            anim:SetColor('0xFFFFFFFF')
            return play_field:CreateObject('tool_14_button',anim,512,384,300,0,0.8,0.8)
        end,
        nil,
        function()
            local anim = CreateAnimation('data/Texture/Tools/14_button/Button_big.png',0,0,230,230,1,0)
            anim:SetHotSpot(115,115)
            anim:SetBlendMode(2)
            anim:SetColor('0xFFFFFFFF')
            return play_field:CreateObject('tool_14_button_info_icon',anim,512,384,300,0,1,1)
        end);
    
    RegisterTool(
        '14_bearing',
        'TOOL_INFO_14_BEARING',
        'TOOL_HINT_14_BEARING',
        function()
            local anim = CreateAnimation('data/Texture/Tools/14_bearing/Bearing.png',0,0,78,79,1,0)
            anim:SetHotSpot(39,39)
            anim:SetBlendMode(2)
            anim:SetColor('0xFFFFFFFF')
            return play_field:CreateObject('tool_bearing',anim,512,384,300,0,0.9,0.9)
        end,
        nil,
        function()
            local anim = CreateAnimation('data/Texture/Tools/14_bearing/Bearing_big.png',0,0,227,230,1,0)
            anim:SetHotSpot(113,115)
            anim:SetBlendMode(2)
            anim:SetColor('0xFFFFFFFF')
            return play_field:CreateObject('tool_bearing_info_icon',anim,512,384,300,0,1,1)
        end);
    
    RegisterTool(
        '14_scissors',
        'TOOL_INFO_14_SCISSORS',
        'TOOL_HINT_14_SCISSORS',
        function()
            local anim = CreateAnimation('data/Texture/Tools/14_scissors/Scissors.png',0,0,80,80,1,0)
            anim:SetHotSpot(40,40)
            anim:SetBlendMode(2)
            anim:SetColor('0xFFFFFFFF')
            return play_field:CreateObject('tool_scissors',anim,512,384,300,0,0.85,0.85)
        end,
        nil,
        function()
            local anim = CreateAnimation('data/Texture/Tools/14_scissors/Scissors_big.png',0,0,230,230,1,0)
            anim:SetHotSpot(115,115)
            anim:SetBlendMode(2)
            anim:SetColor('0xFFFFFFFF')
            return play_field:CreateObject('tool_scissors_info_icon',anim,512,384,300,0,1,1)
        end);
    
    RegisterTool(
        '14_hammer',
        'TOOL_INFO_14_HAMMER',
        'TOOL_HINT_14_HAMMER',
        function()
            local anim = CreateAnimation('data/Texture/Tools/14_hammer/Hammer.png',0,0,79,30,1,0)
            anim:SetHotSpot(39,15)
            anim:SetBlendMode(2)
            anim:SetColor('0xFFFFFFFF')
            return play_field:CreateObject('tool_hammer_14',anim,512,384,300,0,0.9,0.9)
        end,
        nil,
        function()
            local anim = CreateAnimation('data/Texture/Tools/14_hammer/Hammer_big.png',0,0,230,86,1,0)
            anim:SetHotSpot(115,43)
            anim:SetBlendMode(2)
            anim:SetColor('0xFFFFFFFF')
            return play_field:CreateObject('tool_hammer_14_info_icon',anim,512,384,300,0,1,1)
        end);
    
    RegisterTool(
        '14_brush',
        'TOOL_INFO_14_BRUSH',
        'TOOL_HINT_14_BRUSH',
        function()
            local anim = CreateAnimation('data/Texture/Tools/14_brush/Brush.png',0,0,30,79,1,0)
            anim:SetHotSpot(15,39)
            anim:SetBlendMode(2)
            anim:SetColor('0xFFFFFFFF')
            return play_field:CreateObject('tool_brush',anim,512,384,100,0,0.9,0.9)
        end,
        nil,
        function()
            local anim = CreateAnimation('data/Texture/Tools/14_brush/Brush_big.png',0,0,87,230,1,0)
            anim:SetHotSpot(43,115)
            anim:SetBlendMode(2)
            anim:SetColor('0xFFFFFFFF')
            return play_field:CreateObject('tool_brush_info_icon',anim,512,384,300,0,1,1)
        end);
    
    RegisterTool(
        '14_brush_wet',
        'TOOL_INFO_14_BRUSH_WET',
        'TOOL_HINT_14_BRUSH_WET',
        function()
            local anim = CreateAnimation('data/Texture/Tools/14_brush_wet/BrushWet.png',0,0,30,79,1,0)
            anim:SetHotSpot(15,39)
            anim:SetBlendMode(2)
            anim:SetColor('0xFFFFFFFF')
            return play_field:CreateObject('tool_brush_wet',anim,512,384,100,0,0.9,0.9)
        end,
        nil,
        function()
            local anim = CreateAnimation('data/Texture/Tools/14_brush_wet/BrushWet_big.png',0,0,87,230,1,0)
            anim:SetHotSpot(43,115)
            anim:SetBlendMode(2)
            anim:SetColor('0xFFFFFFFF')
            return play_field:CreateObject('tool_brush_wet_info_icon',anim,512,384,300,0,1,1)
        end);
                
    RegisterTool(
        '15_ball',
        'TOOL_INFO_15_BALL',
        'TOOL_HINT_15_BALL',
        function()
            local anim = CreateAnimation('data/Texture/Tools/15_ball/Ball2.png',0,0,77,78,1,0)
            anim:SetHotSpot(38,39)
            anim:SetBlendMode(2)
            anim:SetColor('0xFFFFFFFF')
            return play_field:CreateObject('tool_ball_2',anim,512,384,300,0,0.7,0.7)
        end,
        nil,
        function()
            local anim = CreateAnimation('data/Texture/Tools/15_ball/Ball2_big.png',0,0,210,210,1,0)
            anim:SetHotSpot(105,80)
            anim:SetBlendMode(2)
            anim:SetColor('0xFFFFFFFF')
            return play_field:CreateObject('tool_ball_2_info_icon',anim,512,384,300,0,1,1)
        end);
        
    RegisterTool(
        '15_wrench',
        'TOOL_INFO_15_WRENCH',
        'TOOL_HINT_15_WRENCH',
        function()
            local anim = CreateAnimation('data/Texture/Tools/15_wrench/Wrench.png',0,0,79,79,1,0)
            anim:SetHotSpot(39,39)
            anim:SetBlendMode(2)
            anim:SetColor('0xFFFFFFFF')
            return play_field:CreateObject('tool_wrench',anim,512,384,300,0,0.8,0.8)
        end,
        nil,
        function()
            local anim = CreateAnimation('data/Texture/Tools/15_wrench/Wrench_big.png',0,0,230,230,1,0)
            anim:SetHotSpot(115,115)
            anim:SetBlendMode(2)
            anim:SetColor('0xFFFFFFFF')
            return play_field:CreateObject('tool_wrench_info_icon',anim,512,384,300,0,1,1)
        end);
        
    RegisterTool(
        '15_wolf',
        'TOOL_INFO_15_WOLF',
        'TOOL_HINT_15_WOLF',
        function()
            local anim = CreateAnimation('data/Texture/Tools/15_wolf/Wolf.jpg',0,0,79,79,1,0)
            anim:SetHotSpot(39,39)
            anim:SetBlendMode(2)
            anim:SetColor('0xFFFFFFFF')
            return play_field:CreateObject('tool_wolf',anim,512,384,300,0,0.6,0.6)
        end,
        nil,
        function()
            local anim = CreateAnimation('data/Texture/Tools/15_wolf/Wolf_big.jpg',0,0,148,148,1,0)
            anim:SetHotSpot(74,74)
            anim:SetBlendMode(2)
            anim:SetColor('0xFFFFFFFF')
            return play_field:CreateObject('tool_wolf_info_icon',anim,512,384,300,0,1,1)
        end);
        
    RegisterTool(
        '15_screwdriver',
        'TOOL_INFO_15_SCREWDRIVER',
        'TOOL_HINT_15_SCREWDRIVER',
        function()
            local anim = CreateAnimation('data/Texture/Tools/15_screwdriver/Screwdriver.png',0,0,80,32,1,0)
            anim:SetHotSpot(40,16)
            anim:SetBlendMode(2)
            anim:SetColor('0xFFFFFFFF')
            return play_field:CreateObject('tool_15_screwdriver',anim,512,384,300,0,0.8,0.8)
        end,
        nil,
        function()
            local anim = CreateAnimation('data/Texture/Tools/15_screwdriver/Screwdriver_big.png',0,0,230,91,1,0)
            anim:SetHotSpot(115,45)
            anim:SetBlendMode(2)
            anim:SetColor('0xFFFFFFFF')
            return play_field:CreateObject('tool_15_screwdriver_info_icon',anim,512,384,300,0,1,1)
        end);
        
    RegisterTool(
        '15_acid',
        'TOOL_INFO_15_ACID',
        'TOOL_HINT_15_ACID',
        function()
            local anim = CreateAnimation('data/Texture/Tools/15_acid/Acid.png',0,0,58,79,1,0)
            anim:SetHotSpot(29,39)
            anim:SetBlendMode(2)
            anim:SetColor('0xFFFFFFFF')
            return play_field:CreateObject('tool_acid',anim,512,384,300,0,0.8,0.8)
        end,
        nil,
        function()
            local anim = CreateAnimation('data/Texture/Tools/15_acid/Acid_big.png',0,0,168,230,1,0)
            anim:SetHotSpot(84,115)
            anim:SetBlendMode(2)
            anim:SetColor('0xFFFFFFFF')
            return play_field:CreateObject('tool_acid_info_icon',anim,512,384,300,0,1,1)
        end);
        
    
    RegisterTool(
        '16_key',
        'TOOL_INFO_16_KEY',
        'TOOL_HINT_16_KEY',
        function()
            local anim = CreateAnimation('data/Texture/Tools/16_key/Key.png',0,0,79,27,1,0)
            anim:SetHotSpot(39,13)
            anim:SetBlendMode(2)
            anim:SetColor('0xFFFFFFFF')
            return play_field:CreateObject('tool_16_key',anim,512,384,300,0,0.9,0.9)
        end,
        nil,
        function()
            local anim = CreateAnimation('data/Texture/Tools/16_key/Key_big.png',0,0,230,78,1,0)
            anim:SetHotSpot(115,39)
            anim:SetBlendMode(2)
            anim:SetColor('0xFFFFFFFF')
            return play_field:CreateObject('tool_16_key_info_icon',anim,512,384,300,0,1,1)
        end);
    
    RegisterTool(
        '16_scalpel',
        'TOOL_INFO_16_SCALPEL',
        'TOOL_HINT_16_SCALPEL',
        function()
            local anim = CreateAnimation('data/Texture/Tools/16_scalpel/Scalpel.png',0,0,13,79,1,0)
            anim:SetHotSpot(6,39)
            anim:SetBlendMode(2)
            anim:SetColor('0xFFFFFFFF')
            return play_field:CreateObject('tool_scalpel',anim,512,384,300,0,0.9,0.9)
        end,
        nil,
        function()
            local anim = CreateAnimation('data/Texture/Tools/16_scalpel/Scalpel_big.png',0,0,37,230,1,0)
            anim:SetHotSpot(18,100)
            anim:SetBlendMode(2)
            anim:SetColor('0xFFFFFFFF')
            return play_field:CreateObject('tool_scalpel_info_icon',anim,512,384,300,0,1,1)
        end);
        
    RegisterTool(
        '17_glass',
        'TOOL_INFO_17_GLASS',
        'TOOL_HINT_17_GLASS',
        function()
            local anim = CreateAnimation('data/Texture/Tools/17_glass/Glass.png',0,0,79,58,1,0)
            anim:SetHotSpot(39,29)
            anim:SetBlendMode(2)
            anim:SetColor('0xFFFFFFFF')
            return play_field:CreateObject('tool_glass',anim,512,384,300,0,0.8,0.8)
        end,
        nil,
        function()
            local anim = CreateAnimation('data/Texture/Tools/17_glass/Glass_big.png',0,0,132,130,1,0)
            anim:SetHotSpot(66,35)
            anim:SetBlendMode(2)
            anim:SetColor('0xFFFFFFFF')
            return play_field:CreateObject('tool_glass_info_icon',anim,512,384,300,0,1,1)
        end);
        
    RegisterTool(
        '17_microscope',
        'TOOL_INFO_17_MICROSCOPE',
        'TOOL_HINT_17_MICROSCOPE',
        function()
            local anim = CreateAnimation('data/Texture/Tools/17_microscope/Microscope.png',0,0,80,80,1,0)
            anim:SetHotSpot(40,40)
            anim:SetBlendMode(2)
            anim:SetColor('0xFFFFFFFF')
            return play_field:CreateObject('tool_microscope',anim,512,384,300,0,0.9,0.9)
        end,
        nil,
        function()
            local anim = CreateAnimation('data/Texture/Tools/17_microscope/Microscope_big.png',0,0,230,230,1,0)
            anim:SetHotSpot(115,115)
            anim:SetBlendMode(2)
            anim:SetColor('0xFFFFFFFF')
            return play_field:CreateObject('tool_microscope_info_icon',anim,512,384,300,0,1,1)
        end);
        
    RegisterTool(
        '17_pipette',
        'TOOL_INFO_17_PIPETTE',
        'TOOL_HINT_17_PIPETTE',
        function()
            local anim = CreateAnimation('data/Texture/Tools/17_pipette/Pipette.png',0,0,80,80,1,0)
            anim:SetHotSpot(40,40)
            anim:SetBlendMode(2)
            anim:SetColor('0xFFFFFFFF')
            return play_field:CreateObject('tool_17_pipette',anim,512,384,300,0,0.8,0.8)
        end,
        nil,
        function()
            local anim = CreateAnimation('data/Texture/Tools/17_pipette/Pipette_big.png',0,0,230,230,1,0)
            anim:SetHotSpot(115,115)
            anim:SetBlendMode(2)
            anim:SetColor('0xFFFFFFFF')
            return play_field:CreateObject('tool_17_pipette_info_icon',anim,512,384,300,0,1,1)
        end);
        
    RegisterTool(
        '17_seashell',
        'TOOL_INFO_17_SEASHELL',
        'TOOL_HINT_17_SEASHELL',
        function()
            local anim = CreateAnimation('data/Texture/Tools/17_seashell/Seashell.png',0,0,80,80,1,0)
            anim:SetHotSpot(40,40)
            anim:SetBlendMode(2)
            anim:SetColor('0xFFFFFFFF')
            return play_field:CreateObject('tool_seashell',anim,512,384,300,0,0.9,0.9)
        end,
        nil,
        function()
            local anim = CreateAnimation('data/Texture/Tools/17_seashell/Seashell_big.png',0,0,230,230,1,0)
            anim:SetHotSpot(115,115)
            anim:SetBlendMode(2)
            anim:SetColor('0xFFFFFFFF')
            return play_field:CreateObject('tool_seashell_info_icon',anim,512,384,300,0,1,1)
        end);
        
    RegisterTool(
        '18_glove',
        'TOOL_INFO_18_GLOVE',
        'TOOL_HINT_18_GLOVE',
        function()
            local anim = CreateAnimation('data/Texture/Tools/18_glove/Glove.png',0,0,79,48,1,0)
            anim:SetHotSpot(39,24)
            anim:SetBlendMode(2)
            anim:SetColor('0xFFFFFFFF')
            return play_field:CreateObject('tool_glove',anim,512,384,300,0,0.9,0.9)
        end,
        nil,
        function()
            local anim = CreateAnimation('data/Texture/Tools/18_glove/Glove_big.png',0,0,230,140,1,0)
            anim:SetHotSpot(115,70)
            anim:SetBlendMode(2)
            anim:SetColor('0xFFFFFFFF')
            return play_field:CreateObject('tool_glove_info_icon',anim,512,384,300,0,1,1)
        end);
        
    RegisterTool(
        '18_ladder',
        'TOOL_INFO_18_LADDER',
        'TOOL_HINT_18_LADDER',
        function()
            local anim = CreateAnimation('data/Texture/Tools/18_ladder/Ladder.png',0,0,20,79,1,0)
            anim:SetHotSpot(10,39)
            anim:SetBlendMode(2)
            anim:SetColor('0xFFFFFFFF')
            return play_field:CreateObject('tool_ladder',anim,512,384,300,0,0.9,0.9)
        end,
        nil,
        function()
            local anim = CreateAnimation('data/Texture/Tools/18_ladder/Ladder_big.png',0,0,57,230,1,0)
            anim:SetHotSpot(28,100)
            anim:SetBlendMode(2)
            anim:SetColor('0xFFFFFFFF')
            return play_field:CreateObject('tool_ladder_info_icon',anim,512,384,300,0,1,1)
        end);
            
     RegisterTool(
        '19_button',
        'TOOL_INFO_19_BUTTON',
        'TOOL_HINT_19_BUTTON',
        function()
            local anim = CreateAnimation('data/Texture/Tools/19_button/Button.png',0,0,80,80,1,0)
            anim:SetHotSpot(40,40)
            anim:SetBlendMode(2)
            anim:SetColor('0xFFFFFFFF')
            return play_field:CreateObject('tool_19_button',anim,512,384,300,0,0.65,0.65)
        end,
        nil,
        function()
            local anim = CreateAnimation('data/Texture/Tools/19_button/Button_big.png',0,0,230,230,1,0)
            anim:SetHotSpot(115,115)
            anim:SetBlendMode(2)
            anim:SetColor('0xFFFFFFFF')
            return play_field:CreateObject('tool_19_button_info_icon',anim,512,384,100,0,1,1)
        end);
        
    RegisterTool(
        '20_button',
        'TOOL_INFO_20_BUTTON',
        'TOOL_HINT_20_BUTTON',
        function()
            local anim = CreateAnimation('data/Texture/Tools/20_button/ButtonWide.png',0,0,80,80,1,0)
            anim:SetHotSpot(40,40)
            anim:SetBlendMode(2)
            anim:SetColor('0xFFFFFFFF')
            return play_field:CreateObject('tool_20_button',anim,512,384,300,0,0.85,0.85)
        end,
        nil,
        function()
            local anim = CreateAnimation('data/Texture/Tools/20_button/ButtonWide_big.png',0,0,230,230,1,0)
            anim:SetHotSpot(115,115)
            anim:SetBlendMode(2)
            anim:SetColor('0xFFFFFFFF')
            return play_field:CreateObject('tool_20_button_info_icon',anim,512,384,300,0,1,1)
        end); 
      
    RegisterTool(
        '20_boar_wool',
        'TOOL_INFO_20_BOAR_WOOL',
        'TOOL_HINT_20_BOAR_WOOL',
        function()
            local anim = CreateAnimation('data/Texture/Tools/20_boar_wool/BoarWool.png',0,0,80,80,1,0)
            anim:SetHotSpot(40,40)
            anim:SetBlendMode(2)
            anim:SetColor('0xFFFFFFFF')
            return play_field:CreateObject('tool_boar_wool',anim,512,384,300,0,1,1)
        end,
        nil,
        function()
            local anim = CreateAnimation('data/Texture/Tools/20_boar_wool/BoarWool_big.png',0,0,230,230,1,0)
            anim:SetHotSpot(115,115)
            anim:SetBlendMode(2)
            anim:SetColor('0xFFFFFFFF')
            return play_field:CreateObject('tool_boar_wool_info_icon',anim,512,384,300,0,1,1)
        end);  
        
    RegisterTool(
        '20_wolf_wool',
        'TOOL_INFO_20_WOLF_WOOL',
        'TOOL_HINT_20_WOLF_WOOL',
        function()
            local anim = CreateAnimation('data/Texture/Tools/20_wolf_wool/WolfWool.png',0,0,79,41,1,0)
            anim:SetHotSpot(40,21)
            anim:SetBlendMode(2)
            anim:SetColor('0xFFFFFFFF')
            return play_field:CreateObject('tool_wolf_wool',anim,512,384,300,0,1,1)
        end,
        nil,
        function()
            local anim = CreateAnimation('data/Texture/Tools/20_wolf_wool/WolfWool_big.png',0,0,230,230,1,0)
            anim:SetHotSpot(115,115)
            anim:SetBlendMode(2)
            anim:SetColor('0xFFFFFFFF')
            return play_field:CreateObject('tool_wolf_wool_info_icon',anim,512,384,300,0,1,1)
        end);    
    
    RegisterTool(
        '20_razor',
        'TOOL_INFO_20_RAZOR',
        'TOOL_HINT_20_RAZOR',
        function()
            local anim = CreateAnimation('data/Texture/Tools/20_razor/Razor.png',0,0,79,62,1,0)
            anim:SetHotSpot(39,31)
            anim:SetBlendMode(2)
            anim:SetColor('0xFFFFFFFF')
            return play_field:CreateObject('tool_razor',anim,512,384,300,0,0.9,0.9)
        end,
        nil,
        function()
            local anim = CreateAnimation('data/Texture/Tools/20_razor/Razor_big.png',0,0,230,180,1,0)
            anim:SetHotSpot(115,70)
            anim:SetBlendMode(2)
            anim:SetColor('0xFFFFFFFF')
            return play_field:CreateObject('tool_razor_info_icon',anim,512,384,300,0,1,1)
        end);
            
    RegisterTool(
        '21_pitchfork',
        'TOOL_INFO_21_PITCHFORK',
        'TOOL_HINT_21_PITCHFORK',
        function()
            local anim = CreateAnimation('data/Texture/Tools/21_pitchfork/Pitchfork.png',0,0,13,80,1,0)
            anim:SetHotSpot(6,40)
            anim:SetBlendMode(2)
            anim:SetColor('0xFFFFFFFF')
            return play_field:CreateObject('tool_pitchfork',anim,512,384,300,0,0.9,0.9)
        end,
        nil,
        function()
            local anim = CreateAnimation('data/Texture/Tools/21_pitchfork/Pitchfork_big.png',0,0,47,280,1,0)
            anim:SetHotSpot(23,140)
            anim:SetBlendMode(2)
            anim:SetColor('0xFFFFFFFF')
            return play_field:CreateObject('tool_pitchfork_info_icon',anim,512,384,300,0,1,1)
        end);
        
    RegisterTool(
        '21_kettle',
        'TOOL_INFO_21_KETTLE',
        'TOOL_HINT_21_KETTLE',
        function()
            local anim = CreateAnimation('data/Texture/Tools/21_kettle/Kettle.png',0,0,79,79,1,0)
            anim:SetHotSpot(39,39)
            anim:SetBlendMode(2)
            anim:SetColor('0xFFFFFFFF')
            return play_field:CreateObject('tool_kettle',anim,512,384,300,0,0.8,0.8)
        end,
        nil,
        function()
            local anim = CreateAnimation('data/Texture/Tools/21_kettle/Kettle_big.png',0,0,230,230,1,0)
            anim:SetHotSpot(115,115)
            anim:SetBlendMode(2)
            anim:SetColor('0xFFFFFFFF')
            return play_field:CreateObject('tool_kettle_info_icon',anim,512,384,300,0,1,1)
        end);

    RegisterTool(
        '21_comb',
        'TOOL_INFO_21_COMB',
        'TOOL_HINT_21_COMB',
        function()
            local anim = CreateAnimation('data/Texture/Tools/21_comb/Comb.png',0,0,79,62,1,0)
            anim:SetHotSpot(39,31)
            anim:SetBlendMode(2)
            anim:SetColor('0xFFFFFFFF')
            return play_field:CreateObject('tool_comb',anim,512,384,300,0,0.7,0.7)
        end,
        nil,
        function()
            local anim = CreateAnimation('data/Texture/Tools/21_comb/Comb_big.png',0,0,230,180,1,0)
            anim:SetHotSpot(115,90)
            anim:SetBlendMode(2)
            anim:SetColor('0xFFFFFFFF')
            return play_field:CreateObject('tool_comb_info_icon',anim,512,384,300,0,1,1)
        end);
        
    RegisterTool(
        '22_butterfly_nut',
        'TOOL_INFO_22_BUTTERFLY_NUT',
        'TOOL_HINT_22_BUTTERFLY_NUT',
        function()
            local anim = CreateAnimation('data/Texture/Tools/22_butterfly_nut/Butterfly_nut.png',0,0,79,46,1,0)
            anim:SetHotSpot(39,23)
            anim:SetBlendMode(2)
            anim:SetColor('0xFFFFFFFF')
            return play_field:CreateObject('tool_butterfly_nut',anim,512,384,300,0,0.9,0.9)
        end,
        nil,
        function()
            local anim = CreateAnimation('data/Texture/Tools/22_butterfly_nut/Butterfly_nut_big.png',0,0,230,126,1,0)
            anim:SetHotSpot(115,63)
            anim:SetBlendMode(2)
            anim:SetColor('0xFFFFFFFF')
            return play_field:CreateObject('tool_butterfly_nut_info_icon',anim,512,384,300,0,1,1)
        end);
    
    RegisterTool(
        '22_kettle_full',
        'TOOL_INFO_22_KETTLE_FULL',
        'TOOL_HINT_22_KETTLE_FULL',
        function()
            local anim = CreateAnimation('data/Texture/Tools/22_kettle_full/KettleFull.png',0,0,80,80,1,0)
            anim:SetHotSpot(40,40)
            anim:SetBlendMode(2)
            anim:SetColor('0xFFFFFFFF')
            return play_field:CreateObject('tool_kettle_full',anim,512,384,300,0,0.8,0.8)
        end,
        nil,
        function()
            local anim = CreateAnimation('data/Texture/Tools/22_kettle_full/KettleFull_big.png',0,0,230,230,1,0)
            anim:SetHotSpot(115,115)
            anim:SetBlendMode(2)
            anim:SetColor('0xFFFFFFFF')
            return play_field:CreateObject('tool_kettle_full_info_icon',anim,512,384,300,0,1,1)
        end);
        
    RegisterTool(
        '23_monkey',
        'TOOL_INFO_23_MONKEY',
        'TOOL_HINT_23_MONKEY',
        function()
            local anim = CreateAnimation('data/Texture/Tools/23_monkey/Monkey.png',0,0,76,79,1,0)
            anim:SetHotSpot(39,40)
            anim:SetBlendMode(2)
            anim:SetColor('0xFFFFFFFF')
            return play_field:CreateObject('tool_monkey',anim,512,384,300,0,0.7,0.7)
        end,
        nil,
        function()
            local anim = CreateAnimation('data/Texture/Tools/23_monkey/Monkey_big.png',0,0,135,141,1,0)
            anim:SetHotSpot(68,71)
            anim:SetBlendMode(2)
            anim:SetColor('0xFFFFFFFF')
            return play_field:CreateObject('tool_monkey_info_icon',anim,512,384,300,0,1,1)
        end);
        
    RegisterTool(
        '23_wrench',
        'TOOL_INFO_23_WRENCH',
        'TOOL_HINT_23_WRENCH',
        function()
            local anim = CreateAnimation('data/Texture/Tools/23_wrench/Wrench.png',0,0,79,18,1,0)
            anim:SetHotSpot(39,9)
            anim:SetBlendMode(2)
            anim:SetColor('0xFFFFFFFF')
            return play_field:CreateObject('tool_wrench',anim,512,384,300,0,1,1)
        end,
        nil,
        function()
            local anim = CreateAnimation('data/Texture/Tools/23_wrench/Wrench_big.png',0,0,230,52,1,0)
            anim:SetHotSpot(115,26)
            anim:SetBlendMode(2)
            anim:SetColor('0xFFFFFFFF')
            return play_field:CreateObject('tool_wrench_info_icon',anim,512,384,300,0,1,1)
        end);
      
    RegisterTool(
        '23_hoop',
        'TOOL_INFO_23_HOOP',
        'TOOL_HINT_23_HOOP',
        function()
            local anim = CreateAnimation('data/Texture/Tools/23_hoop/Hoop.png',0,0,79,68,1,0)
            anim:SetHotSpot(39,34)
            anim:SetBlendMode(2)
            anim:SetColor('0xFFFFFFFF')
            return play_field:CreateObject('tool_hoop',anim,512,384,300,0,0.8,0.8)
        end,
        nil,
        function()
            local anim = CreateAnimation('data/Texture/Tools/23_hoop/Hoop_big.png',0,0,230,198,1,0)
            anim:SetHotSpot(115,99)
            anim:SetBlendMode(2)
            anim:SetColor('0xFFFFFFFF')
            return play_field:CreateObject('tool_hoop_info_icon',anim,512,384,300,0,1,1)
        end);
        
    RegisterTool(
        '24_combination_pliers',
        'TOOL_INFO_24_COMBINATION_PLIERS',
        'TOOL_HINT_24_COMBINATION_PLIERS',
        function()
            local anim = CreateAnimation('data/Texture/Tools/24_combination_pliers/CombinationPliers.png',0,0,41,79,1,0)
            anim:SetHotSpot(20,39)
            anim:SetBlendMode(2)
            anim:SetColor('0xFFFFFFFF')
            return play_field:CreateObject('tool_combination_pliers',anim,512,384,300,0,0.8,0.8)
        end,
        nil,
        function()
            local anim = CreateAnimation('data/Texture/Tools/24_combination_pliers/CombinationPliers_big.png',0,0,114,222,1,0)
            anim:SetHotSpot(57,91)
            anim:SetBlendMode(2)
            anim:SetColor('0xFFFFFFFF')
            return play_field:CreateObject('tool_combination_pliers_info_icon',anim,512,384,300,0,1,1)
        end);
        
    RegisterTool(
        '24_crowbar',
        'TOOL_INFO_24_CROWBAR',
        'TOOL_HINT_24_CROWBAR',
        function()
            local anim = CreateAnimation('data/Texture/Tools/24_crowbar/Crowbar.png',0,0,80,20,1,0)
            anim:SetHotSpot(40,10)
            anim:SetBlendMode(2)
            anim:SetColor('0xFFFFFFFF')
            return play_field:CreateObject('tool_crowbar',anim,512,384,300,0,1,1)
        end,
        nil,
        function()
            local anim = CreateAnimation('data/Texture/Tools/24_crowbar/Crowbar_big.png',0,0,222,48,1,0)
            anim:SetHotSpot(111,24)
            anim:SetBlendMode(2)
            anim:SetColor('0xFFFFFFFF')
            return play_field:CreateObject('tool_crowbar_info_icon',anim,512,384,300,0,1,1)
        end);
        
    RegisterTool(
        '24_axe',
        'TOOL_INFO_24_AXE',
        'TOOL_HINT_24_AXE',
        function()
            local anim = CreateAnimation('data/Texture/Tools/24_axe/Axe.png',0,0,79,40,1,0)
            anim:SetHotSpot(39,20)
            anim:SetBlendMode(2)
            anim:SetColor('0xFFFFFFFF')
            return play_field:CreateObject('tool_axe',anim,512,384,300,0,0.9,0.9)
        end,
        nil,
        function()
            local anim = CreateAnimation('data/Texture/Tools/24_axe/Axe_big.png',0,0,230,116,1,0)
            anim:SetHotSpot(115,58)
            anim:SetBlendMode(2)
            anim:SetColor('0xFFFFFFFF')
            return play_field:CreateObject('tool_axe_info_icon',anim,512,384,300,0,1,1)
        end);
    
    if EXTRAS_BUILD and __EXTRAS_SCENE then
        RegisterExtrasTools();
    end
end

function RegisterExtrasTools()
    RegisterTool(
        'E_stool',
        'TOOL_INFO_E_STOOL',
        'TOOL_HINT_E_STOOL',
        function()
            local anim = CreateAnimation('data/Texture/Tools/Extras/E_stool/Stool.png',0,0,74,83,1,0)
            anim:SetHotSpot(37,41)
            anim:SetBlendMode(2)
            anim:SetColor('0xFFFFFFFF')
            return play_field:CreateObject('Stool',anim,317,659,100,0,0.8,0.8)
        end,
        nil,
        function()
            local anim = CreateAnimation('data/Texture/Tools/Extras/E_stool/Stool_big.png',0,0,202,232,1,0)
            anim:SetHotSpot(101,116)
            anim:SetBlendMode(2)
            anim:SetColor('0xFFFFFFFF')
            return play_field:CreateObject('Stool_big',anim,458,629,100,0,1,1)
        end);

    RegisterTool(
        'E_statue',
        'TOOL_INFO_E_STATUE',
        'TOOL_HINT_E_STATUE',
        function()
            local anim = CreateAnimation('data/Texture/Tools/Extras/E_statue/Statue.png',0,0,34,80,1,0)
            anim:SetHotSpot(17,40)
            anim:SetBlendMode(2)
            anim:SetColor('0xFFFFFFFF')
            return play_field:CreateObject('Statue',anim,945,517,100,0,0.9,0.9)
        end,
        nil,
        function()
            local anim = CreateAnimation('data/Texture/Tools/Extras/E_statue/Statue_big.png',0,0,97,230,1,0)
            anim:SetHotSpot(48,115)
            anim:SetBlendMode(2)
            anim:SetColor('0xFFFFFFFF')
            return play_field:CreateObject('Statue_big',anim,898,588,100,0,1,1)
        end);

    RegisterTool(
        'E_doorknob',
        'TOOL_INFO_E_DOORKNOB',
        'TOOL_HINT_E_DOORKNOB',
        function()
            local anim = CreateAnimation('data/Texture/Tools/Extras/E_doorknob/Doorknob.png',0,0,84,36,1,0)
            anim:SetHotSpot(42,18)
            anim:SetBlendMode(2)
            anim:SetColor('0xFFFFFFFF')
            return play_field:CreateObject('tool_e_doorknob',anim,512,384,300,0,1,1)
        end,
        nil,
        function()
            local anim = CreateAnimation('data/Texture/Tools/Extras/E_doorknob/Doorknob_big.png',0,0,228,86,1,0)
            anim:SetHotSpot(114,43)
            anim:SetBlendMode(2)
            anim:SetColor('0xFFFFFFFF')
            return play_field:CreateObject('tool_e_doorknob_info_icon',anim,512,384,300,0,1,1)
        end);
        
    RegisterTool(
        'E_pencil',
        'TOOL_INFO_E_PENCIL',
        'TOOL_HINT_E_PENCIL',
        function()
            local anim = CreateAnimation('data/Texture/Tools/Extras/E_pencil/Pencil.png',0,0,79,79,1,0)
            anim:SetHotSpot(39,39)
            anim:SetBlendMode(2)
            anim:SetColor('0xFFFFFFFF')
            return play_field:CreateObject('tool_e_pencil',anim,512,384,300,0,0.65,0.65)
        end,
        nil,
        function()
            local anim = CreateAnimation('data/Texture/Tools/Extras/E_pencil/Pencil_big.png',0,0,230,230,1,0)
            anim:SetHotSpot(115,115)
            anim:SetBlendMode(2)
            anim:SetColor('0xFFFFFFFF')
            return play_field:CreateObject('tool_e_pencil_info_icon',anim,512,384,300,0,1,1)
        end);
        
    RegisterTool(
        'E_tile2',
        'TOOL_INFO_E_TILE2',
        'TOOL_HINT_E_TILE2',
        function()
            local anim = CreateAnimation('data/Texture/Tools/Extras/E_tile2/Tile2.png',0,0,80,80,1,0)
            anim:SetHotSpot(40,40)
            anim:SetBlendMode(2)
            anim:SetColor('0xFFFFFFFF')
            return play_field:CreateObject('tool_tile2',anim,512,384,300,0,0.7,0.7)
        end,
        nil,
        function()
            local anim = CreateAnimation('data/Texture/Tools/Extras/E_tile2/Tile2_big.png',0,0,230,230,1,0)
            anim:SetHotSpot(115,115)
            anim:SetBlendMode(2)
            anim:SetColor('0xFFFFFFFF')
            return play_field:CreateObject('tool_tile2_info_icon',anim,512,384,300,0,1,1)
        end);
        
    RegisterTool(
        'E_tile5',
        'TOOL_INFO_E_TILE5',
        'TOOL_HINT_E_TILE5',
        function()
            local anim = CreateAnimation('data/Texture/Tools/Extras/E_tile5/Tile5.png',0,0,79,79,1,0)
            anim:SetHotSpot(39,39)
            anim:SetBlendMode(2)
            anim:SetColor('0xFFFFFFFF')
            return play_field:CreateObject('tool_tile5',anim,512,384,300,0,0.7,0.7)
        end,
        nil,
        function()
            local anim = CreateAnimation('data/Texture/Tools/Extras/E_tile5/Tile5_big.png',0,0,230,230,1,0)
            anim:SetHotSpot(115,115)
            anim:SetBlendMode(2)
            anim:SetColor('0xFFFFFFFF')
            return play_field:CreateObject('tool_tile5_info_icon',anim,512,384,300,0,1,1)
        end);
    
	RegisterTool(
        'E_tile6',
        'TOOL_INFO_E_TILE6',
        'TOOL_HINT_E_TILE6',
        function()
            local anim = CreateAnimation('data/Texture/Tools/Extras/E_tile6/Tile6.png',0,0,80,80,1,0)
            anim:SetHotSpot(40,40)
            anim:SetBlendMode(2)
            anim:SetColor('0xFFFFFFFF')
            return play_field:CreateObject('tool_tile6',anim,512,384,300,0,0.7,0.7)
        end,
        nil,
        function()
            local anim = CreateAnimation('data/Texture/Tools/Extras/E_tile6/Tile6_big.png',0,0,230,230,1,0)
            anim:SetHotSpot(115,115)
            anim:SetBlendMode(2)
            anim:SetColor('0xFFFFFFFF')
            return play_field:CreateObject('tool_tile6_info_icon',anim,512,384,300,0,1,1)
        end);
	
    RegisterTool(
        'E_clip',
        'TOOL_INFO_E_CLIP',
        'TOOL_HINT_E_CLIP',
        function()
            local anim = CreateAnimation('data/Texture/Tools/Extras/E_clip/Clip.png',0,0,80,80,1,0)
            anim:SetHotSpot(40,40)
            anim:SetBlendMode(2)
            anim:SetColor('0xFFFFFFFF')
            return play_field:CreateObject('tool_e_clip',anim,512,384,300,0,0.65,0.65)
        end,
        nil,
        function()
            local anim = CreateAnimation('data/Texture/Tools/Extras/E_clip/Clip_big.png',0,0,230,230,1,0)
            anim:SetHotSpot(115,115)
            anim:SetBlendMode(2)
            anim:SetColor('0xFFFFFFFF')
            return play_field:CreateObject('tool_e_clip_info_icon',anim,512,384,300,0,1,1)
        end);
        
    RegisterTool(
        'E_magnet',
        'TOOL_INFO_E_MAGNET',
        'TOOL_HINT_E_MAGNET',
        function()
            local anim = CreateAnimation('data/Texture/Tools/Extras/E_magnet/Magnet.png',0,0,68,68,1,0)
            anim:SetHotSpot(34,34)
            anim:SetBlendMode(2)
            anim:SetColor('0xFFFFFFFF')
            return play_field:CreateObject('tool_e_magnet',anim,512,384,300,0,1,1)
        end,
        nil,
        function()
            local anim = CreateAnimation('data/Texture/Tools/Extras/E_magnet/Magnet_big.png',0,0,230,230,1,0)
            anim:SetHotSpot(115,115)
            anim:SetBlendMode(2)
            anim:SetColor('0xFFFFFFFF')
            return play_field:CreateObject('tool_e_magnet_info_icon',anim,512,384,300,0,1,1)
        end);
        
    RegisterTool(
        'E_tile3',
        'TOOL_INFO_E_TILE3',
        'TOOL_HINT_E_TILE3',
        function()
            local anim = CreateAnimation('data/Texture/Tools/Extras/E_tile3/Tile3.png',0,0,79,79,1,0)
            anim:SetHotSpot(39,39)
            anim:SetBlendMode(2)
            anim:SetColor('0xFFFFFFFF')
            return play_field:CreateObject('tool_e_tile3',anim,512,384,300,0,0.7,0.7)
        end,
        nil,
        function()
            local anim = CreateAnimation('data/Texture/Tools/Extras/E_tile3/Tile3_big.png',0,0,230,230,1,0)
            anim:SetHotSpot(115,115)
            anim:SetBlendMode(2)
            anim:SetColor('0xFFFFFFFF')
            return play_field:CreateObject('tool_e_tile3_info_icon',anim,512,384,300,0,1,1)
        end);
        
    RegisterTool(
        'E_tile7',
        'TOOL_INFO_E_TILE7',
        'TOOL_HINT_E_TILE7',
        function()
            local anim = CreateAnimation('data/Texture/Tools/Extras/E_tile7/Tile7.png',0,0,79,79,1,0)
            anim:SetHotSpot(39,39)
            anim:SetBlendMode(2)
            anim:SetColor('0xFFFFFFFF')
            return play_field:CreateObject('tool_e_tile7',anim,512,384,300,0,0.7,0.7)
        end,
        nil,
        function()
            local anim = CreateAnimation('data/Texture/Tools/Extras/E_tile7/Tile7_big.png',0,0,230,230,1,0)
            anim:SetHotSpot(115,115)
            anim:SetBlendMode(2)
            anim:SetColor('0xFFFFFFFF')
            return play_field:CreateObject('tool_e_tile7_info_icon',anim,512,384,300,0,1,1)
        end);
        
    RegisterTool(
        'E_tile8',
        'TOOL_INFO_E_TILE8',
        'TOOL_HINT_E_TILE8',
        function()
            local anim = CreateAnimation('data/Texture/Tools/Extras/E_tile8/Tile8.png',0,0,79,79,1,0)
            anim:SetHotSpot(40,40)
            anim:SetBlendMode(2)
            anim:SetColor('0xFFFFFFFF')
            return play_field:CreateObject('tool_e_tile8',anim,512,384,300,0,0.7,0.7)
        end,
        nil,
        function()
            local anim = CreateAnimation('data/Texture/Tools/Extras/E_tile8/Tile8_big.png',0,0,230,230,1,0)
            anim:SetHotSpot(115,115)
            anim:SetBlendMode(2)
            anim:SetColor('0xFFFFFFFF')
            return play_field:CreateObject('tool_e_tile8_info_icon',anim,512,384,300,0,1,1)
        end);
        
    RegisterTool(
        'E_duster',
        'TOOL_INFO_E_DUSTER',
        'TOOL_HINT_E_DUSTER',
        function()
            local anim = CreateAnimation('data/Texture/Tools/Extras/E_duster/Duster.png',0,0,79,79,1,0)
            anim:SetHotSpot(39,39)
            anim:SetBlendMode(2)
            anim:SetColor('0xFFFFFFFF')
            return play_field:CreateObject('tool_e_duster',anim,512,384,300,0,1,1)
        end,
        nil,
        function()
            local anim = CreateAnimation('data/Texture/Tools/Extras/E_duster/Duster_big.png',0,0,230,230,1,0)
            anim:SetHotSpot(115,115)
            anim:SetBlendMode(2)
            anim:SetColor('0xFFFFFFFF')
            return play_field:CreateObject('tool_e_duster_info_icon',anim,512,384,300,0,1,1)
        end);
        
    RegisterTool(
        'E_signet_ring',
        'TOOL_INFO_E_SIGNET_RING',
        'TOOL_HINT_E_SIGNET_RING',
        function()
            local anim = CreateAnimation('data/Texture/Tools/Extras/E_signet_ring/SignetRing.png',0,0,79,79,1,0)
            anim:SetHotSpot(39,39)
            anim:SetBlendMode(2)
            anim:SetColor('0xFFFFFFFF')
            return play_field:CreateObject('tool_e_signet_ring',anim,512,384,300,0,1,1)
        end,
        nil,
        function()
            local anim = CreateAnimation('data/Texture/Tools/Extras/E_signet_ring/SignetRing_big.png',0,0,230,230,1,0)
            anim:SetHotSpot(115,115)
            anim:SetBlendMode(2)
            anim:SetColor('0xFFFFFFFF')
            return play_field:CreateObject('tool_e_signet_ring_info_icon',anim,512,384,300,0,1,1)
        end);
        
    RegisterTool(
        'E_tile1',
        'TOOL_INFO_E_TILE1',
        'TOOL_HINT_E_TILE1',
        function()
            local anim = CreateAnimation('data/Texture/Tools/Extras/E_tile1/Tile1.png',0,0,79,79,1,0)
            anim:SetHotSpot(39,39)
            anim:SetBlendMode(2)
            anim:SetColor('0xFFFFFFFF')
            return play_field:CreateObject('tool_e_tile1',anim,512,384,300,0,0.7,0.7)
        end,
        nil,
        function()
            local anim = CreateAnimation('data/Texture/Tools/Extras/E_tile1/Tile1_big.png',0,0,230,230,1,0)
            anim:SetHotSpot(115,115)
            anim:SetBlendMode(2)
            anim:SetColor('0xFFFFFFFF')
            return play_field:CreateObject('tool_e_tile1_info_icon',anim,512,384,300,0,1,1)
        end);
    
    RegisterTool(
        'E_key',
        'TOOL_INFO_E_KEY',
        'TOOL_HINT_E_KEY',
        function()
            local anim = CreateAnimation('data/Texture/Tools/Extras/E_key/Key.png',0,0,80,80,1,0)
            anim:SetHotSpot(40,40)
            anim:SetBlendMode(2)
            anim:SetColor('0xFFFFFFFF')
            return play_field:CreateObject('tool_e_key',anim,512,384,300,0,0.7,0.7)
        end,
        nil,
        function()
            local anim = CreateAnimation('data/Texture/Tools/Extras/E_key/Key_big.png',0,0,230,230,1,0)
            anim:SetHotSpot(115,115)
            anim:SetBlendMode(2)
            anim:SetColor('0xFFFFFFFF')
            return play_field:CreateObject('tool_e_key_info_icon',anim,512,384,300,0,1,1)
        end);  
        
    RegisterTool(
        'E_tile4',
        'TOOL_INFO_E_TILE4',
        'TOOL_HINT_E_TILE4',
        function()
            local anim = CreateAnimation('data/Texture/Tools/Extras/E_tile4/Tile4.png',0,0,79,79,1,0)
            anim:SetHotSpot(39,39)
            anim:SetBlendMode(2)
            anim:SetColor('0xFFFFFFFF')
            return play_field:CreateObject('tool_e_tile4',anim,512,384,300,0,0.7,0.7)
        end,
        nil,
        function()
            local anim = CreateAnimation('data/Texture/Tools/Extras/E_tile4/Tile4_big.png',0,0,230,230,1,0)
            anim:SetHotSpot(115,115)
            anim:SetBlendMode(2)
            anim:SetColor('0xFFFFFFFF')
            return play_field:CreateObject('tool_e_tile4_info_icon',anim,512,384,300,0,1,1)
        end);
        
        RegisterTool(
        'E_weight',
        'TOOL_INFO_E_WEIGHT',
        'TOOL_HINT_E_WEIGHT',
        function()
            local anim = CreateAnimation('data/Texture/Tools/Extras/E_weight/Weight.png',0,0,36,85,1,0)
            anim:SetHotSpot(18,42)
            anim:SetBlendMode(2)
            anim:SetColor('0xFFFFFFFF')
            return play_field:CreateObject('tool_e_weight',anim,512,384,300,0,0.9,0.9)
        end,
        nil,
        function()
            local anim = CreateAnimation('data/Texture/Tools/Extras/E_weight/Weight_big.png',0,0,91,234,1,0)
            anim:SetHotSpot(46,117)
            anim:SetBlendMode(2)
            anim:SetColor('0xFFFFFFFF')
            return play_field:CreateObject('tool_e_weight_info_icon',anim,512,384,300,0,1,1)
        end);
        
        RegisterTool(
        'E_pendulum',
        'TOOL_INFO_E_PENDULUM',
        'TOOL_HINT_E_PENDULUM',
        function()
            local anim = CreateAnimation('data/Texture/Tools/Extras/E_pendulum/Pendulum.png',0,0,79,72,1,0)
            anim:SetHotSpot(39,36)
            anim:SetBlendMode(2)
            anim:SetColor('0xFFFFFFFF')
            return play_field:CreateObject('tool_e_pendulum',anim,512,384,300,0,0.8,0.8)
        end,
        nil,
        function()
            local anim = CreateAnimation('data/Texture/Tools/Extras/E_pendulum/Pendulum_big.png',0,0,230,211,1,0)
            anim:SetHotSpot(115,105)
            anim:SetBlendMode(2)
            anim:SetColor('0xFFFFFFFF')
            return play_field:CreateObject('tool_e_pendulum_info_icon',anim,512,384,300,0,1,1)
        end);
end

--**********************************************

function RegisterTool(  name,
                        info_text,
                        hint_text,
                        create_tool,
                        create_icon,
                        create_info_icon)
                        
    if not game_state.tools then
        game_state.tools = {}
    end

    local info              = {}
    info.create_tool        = create_tool
    info.create_icon        = create_icon
    info.create_info_icon   = create_info_icon
    info.info_text          = info_text
    info.hint_text          = hint_text
    game_state.tools[name]  = info

    if game_state.level_mode == 'quest'
       and HasGameState('ToolFound', name)
       and not HasGameState('ToolApplied', name)
    then
        assert(info.create_tool ~= nil)

        info.tool = info.create_tool()
        --[[
        local icon
        if info.create_icon then
            icon = info.create_icon()
        end
        --]]

	    local inv = play_field:GetLevelScreen():GetInventory()
	    inv:AddTool(name, CInventory.ToolInfo(info.tool, icon));
	    inv:MoveToolToFreeSlot(name, 0.)

	    if not HasGameState('ToolInfoShown', name) then
	        AddGameState('ToolInfoShown', name)
            local window_info = CreateToolWindow(name)
            window_info.SetVisible(true)
	    end
    end
end

--**********************************************

function RegisterToolFindInfo(name, trigger_name, on_find, on_load_when_tool_found)
    local info                   = game_state.tools[name]
    info.text_alias              = text_alias
    info.trigger_name            = trigger_name
    info.on_find                 = on_find
    info.on_load_when_tool_found = on_load_when_tool_found
    info.find_scene              = game_state.scene_path

    if HasGameState('ToolFound', name) then
        if on_load_when_tool_found then
            on_load_when_tool_found(name)
        end
    else
        if game_state.level_mode == 'hidden_object' then
            if trigger_name == nil then
            else
                if type(trigger_name) == 'string' then
                    assert(play_field:HasObject(trigger_name))
                    
                    game_state.custom_cursors[trigger_name] = 'CursorActive'
                    RegisterQuestObjects(trigger_name);
                else
                    assert(type(info.trigger_name) == 'table')
                    for i, v in ipairs(info.trigger_name) do
                        assert(play_field:HasObject(v))
                        
                        local state_value = game_state.scene_path.."("..v..")"
                        if not HasGameState('TaskObjectFound', state_value) then
                            game_state.custom_cursors[v] = 'CursorActive'
                            
                            RegisterQuestObjects(v);
                        else
                            --table.remove(info.trigger_name, i)
                            info.trigger_name[i] = nil
                        end
                    end
                end
            end
        end
        if game_state.level_mode == 'quest'
        or game_state.level_mode == 'mini_game'
        then
            game_state.custom_cursors[trigger_name] = 'CursorActive'
            RegisterQuestObjects(trigger_name);
        end
        
        --[[
        if text_alias then
            play_field:GetLevelScreen():AddTaskSafe(CreateTask(text_alias, '', trigger_name))
        end
        ]]
    end
end

-- Use in HO scenes only
-- In replayable HO scenes use DefineToolFindOrder instead
function RegisterToolFindInfoHO(name, task_name)
	assert(game_state.level_mode == 'hidden_object')
    local info = game_state.tools[name]
    assert(info)
    info.text_alias = text_alias
    info.task_name  = task_name
    info.find_scene = game_state.scene_path
	game_state.clear_task_object_found_states_on_finish = true
end

-- Use in replayable HO scenes
-- Must be called before "AddRandomTasks" call
-- Usage sample:
-- DefineToolFindOrder({tool1_name, CreateTask(ALIAS11, ALIAS12, obj11_name, obj12_name)},
--					   {tool2_name, CreateTask(ALIAS21, ALIAS22, obj21_name)})
function DefineToolFindOrder(...)
    local arg = {...}
	local tool_registered = false

    for i, v in ipairs(arg) do
		assert(type(v) == 'table')

		local tool_name = v[1]
		local tool_task = v[2]

		if not HasGameState('ToolFound', tool_name) then
		    if not tool_registered then
                RegisterToolFindInfoHO(tool_name, tool_task:GetTextSingular())
                AddTask(tool_task)
                tool_registered = true
                if i == table.getn(arg) then
                    game_state.clear_task_object_found_states_on_finish = false
                else
                    game_state.clear_task_object_found_states_on_finish = true
                end
            end
        else
            for i, v in ipairs(game_state.created_task_objects) do
                if tool_task:HasObject(v) then
                    play_field:GetObject(v):SetVisible(false);
                end
            end
		end
	end

	-- HO scene without tool finding or all tools already found
	assert(tool_registered)
end


--**********************************************

function RegisterToolApplyInfo(name, target_name, on_get, on_drop, on_apply, on_load_when_tool_applied, on_click)
    local info = game_state.tools[name]
    info.target_name = target_name
    info.on_get = on_get
    info.on_drop = on_drop
    info.on_apply = on_apply
    info.on_load_when_tool_applied = on_load_when_tool_applied
    info.on_click = on_click

    if HasGameState('ToolApplied', name) then
        if on_load_when_tool_applied then
            on_load_when_tool_applied(name)
        end
    else
        if info.target_name ~= nil then
            if type(info.target_name) == 'string' then
                game_state.custom_cursors[info.target_name] = 'CursorActive'
                RegisterQuestObjects(info.target_name);
                
                if HasGameState('ToolTargetClicked', name.."("..game_state.scene_path.."\\"..target_name..")") then
                    game_state.ignore_on_highlight[target_name] = true;
                end
            else
                local i = 1
                while info.target_name[i] do
                --for ii, v in pairs(info.target_name) do
                    local v = info.target_name[i]
                    if HasGameState('ToolTargetUsed', v) then
                        if on_load_when_tool_applied then
                            on_load_when_tool_applied(name, v)
                        end
                        table.remove(info.target_name, i)
                        --info.target_name[i] = nil
                    else
                        game_state.custom_cursors[v] = 'CursorActive'
                        RegisterQuestObjects(v);
                        
                        if HasGameState('ToolTargetClicked', name.."("..game_state.scene_path.."\\"..v..")") then
                            game_state.ignore_on_highlight[v] = true;
                        end
                        
                        i = i + 1
                    end
                end
            end
        end
    end
end

--**********************************************

function GetTool(name)
    return game_state.tools[name]
end

--**********************************************

function AddTool(tool_name)
    local tool_info = game_state.tools[tool_name]

    tool_info.tool = tool_info.create_tool()
    --[[
    local icon
    if tool_info.create_icon then
        icon = tool_info.create_icon()
    end
    --]]
    
    play_field:OnToolFound(tool_name, tool_info.tool, icon)
end

function RegisterWrongApplyDialog(tool_name, area_name, dialog_name)
    if game_state.wrong_apply_dialogs[tool_name] == nil then
        game_state.wrong_apply_dialogs[tool_name] = {}
    end
    
    if type(area_name) == 'table' then
        for i, area in ipairs(area_name) do
            game_state.wrong_apply_dialogs[tool_name][area] = dialog_name;
        end
    else
        game_state.wrong_apply_dialogs[tool_name][area_name] = dialog_name;
    end
end

function GetWrongApplyDialog(tool_name, area_name)
    local dialog = nil
    
    if game_state.wrong_apply_dialogs[tool_name] == nil then
        return nil
    end
    
    return game_state.wrong_apply_dialogs[tool_name][area_name];
end

--**********************************************
--      TASKS
--**********************************************

function CreateTask(text_singular, text_plural, ...)
    local arg  = {...}
   	local task = CTask(text_singular, text_plural)
    
    if not game_state.created_task_objects then
		game_state.created_task_objects = {}
	end
    
    for i, v in ipairs(arg) do
        if play_field:HasObject(v)
        then
            local state_value = game_state.scene_path.."("..v..")"
            
            if HasGameState("TaskObjectFound", state_value) then
                play_field:GetObject(v):SetOpacity(0.)
            else
                task:AddObject(v)
            end
            
            table.insert(game_state.created_task_objects, v)
        end
    end

    assert(not play_field:GetLevelScreen():HasTask(task))

    return task
end

--**********************************************

function CLevelScreen:AddTaskSafe(task)
    if task:GetNumberOfObjects() > 0 then
        self:AddTask(task)
    end
end

--**********************************************

function ManualCreateTask(text_singular)
   	local task = Task(text_singular, '')
    assert(not play_field:GetLevelScreen():HasTask(task))
    return task
end

--**********************************************

function GetActiveTaskStateName(task)
	return game_state.scene_path.."("..task:GetTextSingular()..")"
end

function AddTask(task)
    if not HasGameState("AllSceneTaskObjectsFound", game_state.scene_path) then
        play_field:GetLevelScreen():AddTask(task)
        AddGameState("TaskIsActive", GetActiveTaskStateName(task))
    end
end

--**********************************************

function AddRandomTasks(...)
    
    if HasGameState("AllSceneTaskObjectsFound", game_state.scene_path) then
        return;
    end
    
    local arg = {...}
    local random_objects = {}

    local has_active_state = function(task)
		return HasGameState("TaskIsActive",
							GetActiveTaskStateName(task))
	end
	local add_active_state = function(task)
		AddGameState("TaskIsActive",
					 GetActiveTaskStateName(task))
	end
    
    local has_generated_tasks = false
    for i, v in ipairs(arg) do
        if has_active_state(v) then
			has_generated_tasks = true
			break
        end
    end
    
    for i, v in ipairs(arg) do
		if (not has_generated_tasks and v:GetNumberOfObjects() > 0) or
		   has_active_state(v)
		then
            table.insert(random_objects, v)
        end
    end

    RandomTableSort(random_objects)

    local n = table.getn(random_objects)
	-- 12 - 'puppet show' tasks number limit
	if GM:IsDebugTasksMode() then
	    n = table.getn(random_objects);
	else
        if n > 12 - play_field:GetLevelScreen():GetNTasks() then
            n = 12 - play_field:GetLevelScreen():GetNTasks()
        end
    end

    local level_screen = play_field:GetLevelScreen()
    for i = 1, n do
		local task = random_objects[i]
        level_screen:AddTask(task)
        if not has_active_state(task) then
		    add_active_state(task)
		end
    end
end

--**********************************************

function RemoveFromTask(obj_name)
    local level = play_field:GetLevelScreen()
    local task = level:GetTask(obj_name)
    task:OnObjectFound(obj_name)
end

--**********************************************
-- TODO: Replace with more OO variant if possible
function AssignZoneMethods(zone)
end

--**********************************************
--      ZOOM ZONES
--**********************************************

function RegisterZoomZone(zone, trigger_name)
    if not game_state.zones then
        game_state.zones = {}
    end

    zone.trigger_name = trigger_name
    table.insert(game_state.zones, zone)

    if trigger_name then
        game_state.custom_cursors[trigger_name] = 'CursorGlass'
        RegisterQuestObjects(trigger_name);
    end
    
    if trigger_name ~= nil and zone.is_visited then
        game_state.ignore_on_highlight[trigger_name] = true;
    end
end

--**********************************************

function EnableActiveZoneCloseButton()	
	if game_state.active_zone then
		game_state.active_zone.close_button:Go()
	end
end

function CreateZoomZone(trigger_name, close_button_message, ...)
    local arg = {...}

    local zone                = {}
    zone.is_visible           = false
    zone.fading_enabled       = true
    zone.objects              = {}
    zone.objects_visibility   = {}
    
    zone.close_button_message = close_button_message
    zone.border_name          = 'zoom_border_across'
    zone.is_fullscreen_zone   = false;
    zone.topZ                 = 0;
    zone.bottomZ              = 10000;
    
    if trigger_name ~= nil then
        zone.is_visited = HasGameState('ZoomZoneVisited', game_state.scene_path.."("..trigger_name..")");
    else
        zone.is_visited = false;
    end
    
   -- table.insert(arg, 'zoom_button_back')
   -- table.insert(arg, true)
    
    table.insert(arg, 'zoom_glass_anim')
    table.insert(arg, true)

    local biggest_object = nil;
    local biggest_size   = 0;

    for i = 1, table.getn(arg), 2 do
        local obj_name   = arg[i]
        local is_visible = arg[i + 1]
        
        zone.objects_visibility[obj_name] = is_visible
        
        if play_field:HasObject(obj_name) then
            local obj      = play_field:GetObject(obj_name)
            local w        = obj:GetAnimation():GetWidth();
            local h        = obj:GetAnimation():GetHeight();
            local obj_size = math.sqrt(w*w + h*h);
            
            if (obj_size > biggest_size)
            then
                biggest_object = obj;
                biggest_size   = obj_size;
            end
            
            if obj_name ~= 'zoom_glass_anim' and obj:GetScrZ() < zone.bottomZ then
                zone.bottomZ = obj:GetScrZ();
            end
            
            if obj_name ~= 'zoom_glass_anim' and obj:GetScrZ() > zone.topZ then
                zone.topZ = obj:GetScrZ();
            end
            
            if string.find(obj_name, 'area_') == 1 then
                obj:GetAnimation():SetColor('0x01FFFFFF')
            else
                obj:GetAnimation():SetColor('0xFFFFFFFF')
            end
            
            obj:SetOpacity(0.)
            zone.objects[obj_name] = true
            
            if (game_state.min_zone_z == nil) or (obj:GetZ() < game_state.min_zone_z)
            then
                game_state.min_zone_z = obj:GetZ()
            end
        end
    end
    
    if biggest_object:GetAnimation():GetHeight() > biggest_object:GetAnimation():GetWidth() then
        zone.border_name = 'zoom_border_upright'
    end
    
    -- create border
    zone.objects_visibility[zone.border_name] = true
    
    if play_field:HasObject(zone.border_name) then
        local obj = play_field:GetObject( zone.border_name );
        
        obj:GetAnimation():SetColor('0xFFFFFFFF')
        obj:SetOpacity(0.)
        zone.objects[zone.border_name] = true
        
        if  (game_state.min_zone_z == nil) or (obj:GetZ() < game_state.min_zone_z)
        then
            game_state.min_zone_z = obj:GetZ();
        end
        
        obj:SetXY(biggest_object:GetX(), biggest_object:GetY());
    end
    
    -- zoom zone functions
    zone.IsVisible = function()
        return zone.is_visible
    end
    
    zone.SetOffset = function(x, y)
        local obj;
        for obj_name, visible in pairs(zone.objects) do
            obj = play_field:GetObject(obj_name);
            obj:SetXY(obj:GetX() + x, obj:GetY() + y);
        end
    end
    
    zone.SetVisible = function(is_visible, time)
    	--play_field:GetObject('zoom_fade'):DestroyChildren()
	    --play_field:GetObject('zoom_fade'):SetOpacity(0.8)
        
        if not time then
	        time = ZOOM_ZONE_APPEARING_TIME
	    end
        
        if zone.is_visible ~= is_visible then
            zone.is_visible = is_visible

            if is_visible then
                if not zone.is_fullscreen_zone then
                    local border = play_field:GetObject( zone.border_name );
                    border:SetXY(zone.biggest_object:GetX(), zone.biggest_object:GetY());
                    border:SetZ(zone.topZ + 0.001);
                    
                    local glass = play_field:GetObject('zoom_glass_anim');
                    glass:AttachTo( border );
                    
                    if zone.border_name == 'zoom_border_upright' then
                        glass:SetScale(0.9);
                        glass:SetX( ZOOM_ZONE_UPRIGHT_GLASS_ANIM_POS.x )
                        glass:SetY( ZOOM_ZONE_UPRIGHT_GLASS_ANIM_POS.y )
                    else
                        glass:SetScale(1);
                        glass:SetX( ZOOM_ZONE_ACROSS_GLASS_ANIM_POS.x )
                        glass:SetY( ZOOM_ZONE_ACROSS_GLASS_ANIM_POS.y )
                    end
                end
                
                if zone.fading_enabled then
                    local fade_obj = play_field:GetObject('zoom_fade');
                    
                    fade_obj:DestroyChildren()
                    fade_obj:ChangeOpacity(0., 0.7, time)
                    fade_obj:SetZ(zone.bottomZ - 0.001);
                end
                
                game_state.active_zone = zone
                active_zones:Push(zone);
                game_state.locker:AddRef()
                
                if zone.on_open then
                    zone.on_open(zone)
                end
                
                if zone.trigger_name and (not zone.is_visited) then
                    AddGameState('ZoomZoneVisited', game_state.scene_path.."("..zone.trigger_name..")");
                    zone.is_visited = true
                    
                    game_state.ignore_on_highlight[zone.trigger_name] = true;
                end
                
            else    
                if zone.fading_enabled then
                    local fade_obj = play_field:GetObject('zoom_fade');
                    
                    fade_obj:DestroyChildren()
                    fade_obj:SetOpacity(0.)
                end
                
                active_zones:Pop();
                game_state.active_zone = active_zones:GetTop();
                game_state.locker:Release()
                
                if zone.on_close then
                    zone.on_close(zone)
                end

                play_field:GetObject('object_highlight'):Hide()
            end

            --zone.close_button:SetVisible(is_visible)

            if is_visible then
                if zone.close_button then
                    --zone.close_button:Go()
                    zone.close_button:Show()
                    --play_field:GetObject('zoom_button_back'):AttachTo(zone.close_button)
                    TimerDoString("EnableActiveZoneCloseButton()", 0.3, play_field:GetTimer())
                end
            else
                if zone.close_button then
                    zone.close_button:Stop()
                    zone.close_button:Hide()
                end
            end
            
            local obj = nil;
            
            for i, v in pairs(zone.objects) do
                if v == true and play_field:HasObject(i) then
                    obj = play_field:GetObject(i)
                    
                    if is_visible then
                        if zone.objects_visibility[i] == true then
                            obj:ChangeOpacity(obj:GetOpacity(), obj:GetMaxOpacity(), time)
                        end
                    else
                        if obj:GetOpacity() ~= 0. then
                            obj:ChangeOpacity(obj:GetOpacity(), 0., time)
                        end
                    end
                end
            end
        end
    end
    
    zone.IsVisited = function()
        return zone.is_visited;
    end

    zone.SetObjectVisible = function(name, is_visible, time)
        zone.objects_visibility[name] = is_visible
        
        local obj = play_field:GetObject(name);
        
        if obj:GetOpacity() ~= 0. and not is_visible then
            if time then
               obj:ChangeOpacity(obj:GetOpacity(), 0., time);
            else
                obj:SetOpacity(0.)
            end
        end
        
        if obj:GetOpacity() == 0. and is_visible and zone.is_visible then
            if time then
                obj:ChangeOpacity(0., 1., time);
            else
                obj:SetOpacity(1.)
            end
        end
    end

    zone.IsObjectVisible = function(name)
        return zone.objects_visibility[name]
    end

    zone.HasObject = function(object_name)
        return zone.objects[object_name] == true
    end

    zone.AddObject = function(object_name)
        zone.objects[object_name] = true
        zone.objects_visibility[object_name] = true
    end

    zone.RemoveObject = function(object_name)
        zone.objects[object_name] = false
    end

    zone.Disable = function()
        if not zone.disabled and zone.trigger_name then
            play_field:IgnoreOnTestPoint(zone.trigger_name)
            game_state.locked_objects[zone.trigger_name] = true
            game_state.custom_cursors[zone.trigger_name] = nil
            zone.disabled = true;
        end
    end
    
    zone.IsDisable = function()
        return zone.disabled;
    end
    
    -- create close button and position glass
    if biggest_object then
        zone.biggest_object = biggest_object

        local biggest_object_w = biggest_object:GetAnimation():GetWidth()
        
        if biggest_object_w == 1024 then
            zone.RemoveObject( zone.border_name )
            zone.RemoveObject( 'zoom_glass_anim' )
            zone.is_fullscreen_zone = true;
        else
            local close_btn_pos;
            local close_btn_scale;
            
            if zone.border_name == 'zoom_border_upright' then
                close_btn_pos   = ZOOM_ZONE_UPRIGHT_CLOSE_SMALL_BUTTON_POS;
                close_btn_scale = 0.9;
            else
                close_btn_pos   = ZOOM_ZONE_ACROSS_CLOSE_SMALL_BUTTON_POS;
                close_btn_scale = 1;
            end
            
            zone.close_button = CreateCloseZoomButton(close_btn_pos,
                                                      zone.close_button_message,
                                                      play_field:GetLevelScreen())
            zone.close_button:SetScale(close_btn_scale);
            zone.close_button:SetZ(zone.topZ + 2);
        end

        if zone.close_button then
            zone.close_button:AttachTo(biggest_object)
            zone.close_button:Stop();
            zone.close_button:Hide();
            --play_field:GetObject('zoom_button_back'):AttachTo(zone.close_button)
        end
    end

    RegisterZoomZone(zone, trigger_name)
    
    return zone
end

--**********************************************

currentCursor = nil

function SetCursor(cursor_name, ignoreMDB)

    if play_field and play_field.mouseDownBlocked and not ignoreMDB
    then
        return;
    end

    ---- immediate cursor change ----
    GetGameApp():SetCustomCursor(cursor_name)
    --Console:Log("Set cursor: "..cursor_name);

    if (currentCursor ~= cursor_name)
    then
    
        currentCursor = cursor_name;
        if (currentCursor ~= "CursorDefault")
        then
            PlaySound("Cursor_change");
        end
    
    end
end

function StartLevel(level_path, deep_fade)
    if not game_state.scene_is_destroying then
        active_zones:PopAll()
        game_state.scene_is_destroying = true
        local load_next_level = "load_level('"..level_path.."')"
        local delay = 0.1
        if deep_fade then
            delay = 0.5
        end
        local do_to_load_next_level = ''
        if play_field then
            do_to_load_next_level = do_to_load_next_level..'DestroyCurrentLevel() '
        end
        do_to_load_next_level = do_to_load_next_level..load_next_level
        GTimerDoString(do_to_load_next_level, delay)
        GTimerDoString("GetGameApp():SetCustomCursor('CursorDefault')", delay)
    end
end

function GoToMainMenu()
    PlayAmbientMusic(nil);
    CleanUpGameResources();
    StartMainMenu();
end

function StartCycledAnimation(obj_name, delay, period)
    if play_field:HasObject(obj_name) then
        local obj = play_field:GetObject(obj_name)
        local timer = play_field:GetTimer()
        if obj:GetAnimation():GetMode() ~= HGEANIM_NOLOOP + HGEANIM_PINGPONG then
            obj:GetAnimation():SetMode(HGEANIM_NOLOOP)
        end

        if delay == 0 then
            delay = period
            obj:GetAnimation():Play()
        else
            obj:GetAnimation():Stop()
        end

        local action = "StartCycledAnimation('"..obj_name.."', 0, "..period..")"
        TimerDoString(action, delay, timer)
    end
end

function StartCycledAnimationEx(obj_name, delay, period, hide_when_not_playing)
    if play_field:HasObject(obj_name) then
        local obj = play_field:GetObject(obj_name)
        local timer = play_field:GetTimer()
        if obj:GetAnimation():GetMode() ~= HGEANIM_NOLOOP + HGEANIM_PINGPONG then
            obj:GetAnimation():SetMode(HGEANIM_NOLOOP)
        end

        local anim_length = GetAnimationLength(obj:GetAnimation())

        if delay == 0 then
            delay = period
            obj:GetAnimation():Play()
            obj:SetVisible(true)
            TimerDoString("play_field:GetObject('"..obj_name.."'):SetVisible(false)", anim_length, timer)
        else
            obj:SetVisible(false)
        end

        local action = "StartCycledAnimationEx('"..
                        obj_name..
                        "', 0, "..
                        period..
                        ','..
                        tostring(hide_when_not_playing)..
                        ")"

        TimerDoString(action, delay, timer)
    end
end

--[[
function StartCycledAnimationEx(obj_name, delay, period, do_on_iter_start, do_on_iter_end)
    local obj = play_field:GetObject(obj_name)
    local timer = play_field:GetLevelScreen():GetTimer()
    obj:GetAnimation():SetMode(HGEANIM_NOLOOP)
    local anim_length = GetAnimationLength(obj:GetAnimation())

    if delay == 0 then
        delay = period
        obj:GetAnimation():Play()
        loadstring(do_on_iter_start)
        TimerDoString(do_on_iter_end, anim_length, timer)
    end

    local action = "StartCycledAnimationEx('"..
                    obj_name..
                    "', 0, "..
                    period..
                    ','..
                    "\""..do_on_iter_start.."\""..
                    ','..
                    "\""..do_on_iter_end.."\""..
                    ")"

    TimerDoString(action, delay, timer)
end
]]
--[[
function LoadTutorial()
	local anim = CreateAnimation('data/Texture/Scenes/Tutorial/Notepad.png',0,0,814,672,1,0)
	anim:SetHotSpot(407,336)
	anim:SetBlendMode(2)
	anim:SetColor('0x00FFFFFF')
	--play_field:CreateObject('notepad',anim,615,384,230,0,1,1)
	play_field:CreateObject('notepad',anim,512,384,330,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/Tutorial/Page1.png',0,0,777,493,1,0)
	anim:SetHotSpot(388,246)
	anim:SetBlendMode(2)
	anim:SetColor('0x00FFFFFF')
	--play_field:CreateObject('page1',anim,611,352,231,0,1,1)
	play_field:CreateObject('page1',anim,508,352,331,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/Tutorial/Page2.png',0,0,785,555,1,0)
	anim:SetHotSpot(392,277)
	anim:SetBlendMode(2)
	anim:SetColor('0x00FFFFFF')
	--play_field:CreateObject('page2',anim,615,384,231,0,1,1)
	play_field:CreateObject('page2',anim,512,384,331,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/Tutorial/Page3.png',0,0,779,587,1,0)
	anim:SetHotSpot(389,293)
	anim:SetBlendMode(2)
	anim:SetColor('0x00FFFFFF')
	--play_field:CreateObject('page3',anim,615,384,231,0,1,1)
	play_field:CreateObject('page3',anim,512,384,331,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/Tutorial/Page4.png',0,0,717,526,1,0)
	anim:SetHotSpot(358,263)
	anim:SetBlendMode(2)
	anim:SetColor('0x00FFFFFF')
	--play_field:CreateObject('page4',anim,603,377,231,0,1,1)
	play_field:CreateObject('page4',anim,500,377,331,0,1,1)

    local level_name = play_field:GetName()
    if level_name ~= 'data/Scenes/1_booth.lua' then
        local anim = CreateAnimation('data/Texture/Scenes/Common/shadow.png',0,0,512,384,1,0)
        anim:SetHotSpot(256,192)
        anim:SetBlendMode(2)
        anim:SetColor('0x44FFFFFF')
        play_field:CreateObject('comics_shadow',anim,512,384,200,0,2,2)
    else
        local anim = CreateAnimation('data/Texture/Scenes/Common/shadow_circle.png',0,0,512,384,1,0)
        anim:SetHotSpot(256,192)
        anim:SetBlendMode(2)
        anim:SetColor('0x44FFFFFF')
        play_field:CreateObject('comics_shadow',anim,512,384,200,0,2,2)
    end
    play_field:GetObject('comics_shadow'):SetOpacity(0.0)
end

function ShowTutorial()
    if game_state.next_button == nil then
        game_state.next_button =
            --CreateNextButton(Vector(945., 727.), 'NEXT_TUTORIAL_SLIDE', play_field:GetLevelScreen())
            CreateNextButton(Vector(842., 727.), 'NEXT_TUTORIAL_SLIDE', play_field:GetLevelScreen())
    else
        game_state.next_button:SetVisible(true)
        game_state.next_button:Go()
    end

    local pf = play_field
    if pf:HasObject('notepad') then
        pf:GetObject('notepad'):SetOpacity(1.)
    end
    if pf:HasObject('page1') then
        pf:GetObject('page1'):SetOpacity(1.)
    end
    if pf:HasObject('page2') then
        pf:GetObject('page2'):SetOpacity(0.)
    end
    if pf:HasObject('page3') then
        pf:GetObject('page3'):SetOpacity(0.)
    end
    if pf:HasObject('page4') then
        pf:GetObject('page4'):SetOpacity(0.)
    end
end

function ShowNextTutorialSlide()
	local pf = play_field
    pf:GetObject('notepad'):SetOpacity(1.)
    local curr_page
    local next_page
    if pf:GetObject('page1'):GetOpacity() > 0. then
        curr_page = 'page1'
        next_page = 'page2'
    end
    if pf:GetObject('page2'):GetOpacity() > 0. then
        curr_page = 'page2'
        next_page = 'page3'
    end
    if pf:GetObject('page3'):GetOpacity() > 0. then
        curr_page = 'page3'
        next_page = 'page4'
    end
    if pf:GetObject('page4'):GetOpacity() > 0. then
        curr_page = 'page4'
        next_page = ''
    end
    pf:GetObject(curr_page):ChangeOpacity(pf:GetObject(curr_page):GetOpacity(), 0., 0.2)
    if next_page ~= '' then
        pf:GetObject(next_page):ChangeOpacity(pf:GetObject(next_page):GetOpacity(), 1., 0.2)
    else
        pf:GetObject('notepad'):ChangeOpacity(1., 0., 0.2)
        game_state.next_button:SetVisible(false)
        game_state.next_button:Stop()

        if game_state.first_help_showing == true then
            game_state.first_help_showing = false
            TimerDoString('ShowFirstComics()', 0.2, pf:GetTimer())
        end
    end
end
--]]
function GetAdditionalHintObjects(objects)
    if game_state.custom_cursors ~= nil then
        for i, v in pairs(game_state.custom_cursors) do
            local obj_name = i
            local obj_cursor = game_state.custom_cursors[obj_name]
            
            if obj_cursor ~= nil
                and obj_cursor ~= ''
                and play_field:HasObject(obj_name)
                and play_field:GetObject(obj_name):IsVisible()
                and play_field:GetObject(obj_name):GetOpacity() ~= 0.
                and (game_state.current_visible_zone == nil or game_state.current_visible_zone.HasObject(obj_name))
                and game_state.ignore_on_hinting[obj_name] ~= true
            then
                objects:push_back(obj_name)
            end
        end
    end
end

function SetIgnoreOnHinting(obj_name, is_ignore)
    game_state.ignore_on_hinting[obj_name] = ((is_ignore) and true or nil)
end

function GetHintZ(object)
    if game_state.current_visible_zone ~= nil and
       not game_state.current_visible_zone.HasObject(object:GetName())
    then
        return game_state.min_zone_z - 0.1
    else
        return object:GetZ() + 150.
    end
end
--[[
function AddStartTool(obj_name, photo_name)
    local pf = play_field
    RemoveFromTask(obj_name)
    pf:OnToolFound(pf:GetObject(obj_name), pf:GetObject(photo_name))
    pf:GetLevelScreen():GetPhone():SetTaskListVisible(true)
end

function FutureToolComicsRequest(obj_name)
    if game_state.future_comics ~= nil and
       game_state.future_comics[obj_name] == true and
       custom_cursors[obj_name] == 'CursorActive'
    then    
        game_state.future_comics[obj_name] = false
        local i = math.random(0, 1)
        local comics_name = ''
        if i == 1 then
            comics_name = 'ComicsTool_1'
        else
            comics_name = 'ComicsTool_2'
        end
        local action = "play_field:CreateComics('"..comics_name.."', '', true)"
        TimerDoString(action, 1.5, play_field:GetTimer())
    end
end
--]]

function CreateInfoWindow(...)
    local arg = {...}
    local zone = CreateZoomZone(nil,
                                'CloseInfoWindow',
                                'zoom_info_back', true,
                                'zoom_info_button', true)
    zone.RemoveObject( zone.border_name )
    zone.fading_enabled = false
    
    zone.close_button:Hide();
    zone.close_button = CreateCloseInfoButton(Vector(511,570),
                                              zone.close_button_message,
                                              play_field:GetLevelScreen())
   --zone.close_button:AttachTo(biggest_object)

    for i, v in ipairs(arg) do
        if play_field:HasObject(v) then
            local obj = play_field:GetObject(v)
            obj:GetAnimation():SetColor('0xFFFFFFFF')
            obj:SetOpacity(0.)
            zone.AddObject(v)
        end
    end
    return zone
end

function CreateToolWindow(toolName)
    local toolInfo = game_state.tools[toolName];
    local tool     = toolInfo.tool;
    local text     = toolInfo.info_text;
    local create_info_icon = toolInfo.create_info_icon
    tool:Hide();
    
    play_field:GetObject('zoom_info_back'):DestroyChildren()

    local icon = create_info_icon()
    icon:SetXY(512, 335)
    icon:SetZ(play_field:GetObject('zoom_info_back'):GetZ() + 2)
    
    local h_scale = 145 / icon:GetAnimation():GetHeight()
    local w_scale = 200 / icon:GetAnimation():GetWidth()
    local scale = (w_scale > h_scale) and h_scale or  w_scale
    
    if scale < 1.0 then
        icon:SetScale(scale)
    end

    local zone = CreateInfoWindow(icon:GetName())

    local te1 = CreateTextEntity(COMICS_FONT, 'CONGRATULATIONS')
    te1:AttachTo(play_field:GetObject('zoom_info_back'))
    te1:SetScale(0.8)
    te1:SetXY(0, -105.)
    te1:SetZ(0.1)

    local te2 = CreateTextEntity(COMICS_FONT, text)
    te2:AttachTo(play_field:GetObject('zoom_info_back'))
    te2:SetScale(0.8)
    te2:SetXY(0, 100.)
    te2:SetZ(0.1)
    
    toolInfo.notInInventoryYet = true;

    zone.on_close = function(zone)
        local toolAnchor = play_field:GetLevelScreen():GetInventory():GetObject('tools_anchor');
        
        zone.RemoveObject(icon:GetName())
        local ef = CreateAnimationEffector()
        ef:AttachTo(icon)
        ef:SetKey(_TRACK_X, 0, icon:GetX())
        ef:SetKey(_TRACK_Y, 0, icon:GetY())
        ef:SetKey(_TRACK_S, 0, icon:GetScale())
        
        ef:SetKey(_TRACK_X, TOOL_FLY_TIME, toolAnchor:GetX())
        ef:SetKey(_TRACK_Y, TOOL_FLY_TIME, toolAnchor:GetY())
        ef:SetKey(_TRACK_S, TOOL_FLY_TIME, icon:GetScale() * 0.2)
        
        ef:SetKey(_TRACK_O, TOOL_FLY_TIME - 0.0001, icon:GetOpacity());
        ef:SetKey(_TRACK_O, TOOL_FLY_TIME, 0);
        ef:Play();
        
        icon:AddParticleSystem('data/ParticleSystem/ObjectMoveTail.psi',
                               'ZoneHighlightParticle',
                               true)
        
        game_state.fly_tools:AddRef();
        gToolName = toolName;
        play_field:TimerDoString('game_state.fly_tools:Release();' ..
                                 'InventoryOnToolFound(gToolName);',
                                 TOOL_FLY_TIME);
    end
    
    PlaySound("Window_open");

    return zone
end

function CPlayField:GetTopRightCornerScr(game_object_name, obj_to_place)
    if play_field:HasObject(game_object_name) then
        local obj = play_field:GetObject(game_object_name)
        local pos = Vector(obj:GetX(), obj:GetY())
        pos.x = pos.x - obj:GetAnimation():GetHotX()
        pos.y = pos.y - obj:GetAnimation():GetHotY()
        pos.x = pos.x - obj_to_place:GetX()
        pos.y = pos.y - obj_to_place:GetY()
        pos.x = pos.x + obj_to_place:GetAnimation():GetHotX()
        pos.y = pos.y + obj_to_place:GetAnimation():GetHotY()
        return Vector(pos.x + obj:GetAnimation():GetWidth(), pos.y)
    else
        return Vector()
    end
end

function GameStateExists(state)
    if __EXTRAS_SCENE then
        state = EXTRAS_MODE_PREFIX..state
    end
    
    return game_state.state:HasState(state)
end

function HasGameState(state, value)
    if __EXTRAS_SCENE then
        state = EXTRAS_MODE_PREFIX..state
    end
    
    local is_state_exists = game_state.state:HasState(state)
    return is_state_exists and (not value or game_state.state:GetState(state):HasValue(value))
end

function AddGameState(state, value)
    if __EXTRAS_SCENE then
        state = EXTRAS_MODE_PREFIX..state
    end
    
    game_state.state:AddState(state, value)
end

function GetGameState(state)
    if __EXTRAS_SCENE then
        state = EXTRAS_MODE_PREFIX..state
    end
    
    return game_state.state:GetState(state)
end

function SetGameState(state, value)
    if __EXTRAS_SCENE then
        state = EXTRAS_MODE_PREFIX..state
    end
    
    game_state.state:SetState(state, value)
end

function RemoveGameState(state, value)
    if __EXTRAS_SCENE then
        state = EXTRAS_MODE_PREFIX..state
    end
    
    if not value then
        game_state.state:RemoveState(state)
    else
        game_state.state:RemoveState(state, value)
    end
end

function RegisterActiveObject(obj_name, on_click, on_load_when_clicked, multi_use, without_cursor, cursor_name)

    local state_value = game_state.scene_path..'('..obj_name..')'
    if HasGameState('ObjectClicked', state_value) then
        game_state.ignore_on_highlight[obj_name] = true;
        
        if on_load_when_clicked then
            on_load_when_clicked(obj_name)
        end
    end
    
    if multi_use or not HasGameState('ObjectClicked', state_value) then
        if not game_state.active_objects then
            game_state.active_objects = {}
        end
        game_state.active_objects[obj_name] = {}
        game_state.active_objects[obj_name].on_click = on_click
        game_state.active_objects[obj_name].on_load_when_clicked = on_load_when_clicked
        game_state.active_objects[obj_name].multi_use = multi_use
        
        if not without_cursor then
            if cursor_name then
                game_state.custom_cursors[obj_name] = cursor_name
            else
                game_state.custom_cursors[obj_name] = 'CursorActive'
            end
            
            RegisterQuestObjects(obj_name);
        end
    end
end

function UnregisterActiveObject(obj_name)
    game_state.active_objects[obj_name] = nil
    game_state.custom_cursors[obj_name] = ''
end

function RegisterMonologObject(obj_name, text_alias, order_type)
	local on_click = function()
	    if type(text_alias) == 'table' then
	        if order_type == 'random' then
	            local index = math.random(tanle.getn(text_alias));
	            local alias = text_alias[index];
	            
	            ShowMonolog(alias, alias)
	        else
	            local alias = nil;
	            
	            for i=1, table.getn(text_alias) do
	                alias = text_alias[i];
	                
	                if not HasGameState('MonologShown', alias) then
	                    break;
	                end
	            end
	            
	            ShowMonolog(alias, alias)
	        end
	    else
	        ShowMonolog(text_alias, text_alias)
	    end
	end
	
	RegisterActiveObject(obj_name, on_click, nil, true, nil, 'CursorGlass')
	UnRegisterQuestObjects(obj_name)
	
	--game_state.ignore_on_highlight[obj_name] = true;
end

function IsMiniGame(path)
    local minigames = {};
    
    --[[
        TODO: change to
            minigames['data/Scenes/Minigames/02_lighter.lua'] = true;
            return (minigames[path] == true);
    --]]
    minigames[1]  = 'data/Scenes/Minigames/02_lighter.lua';
    minigames[2]  = 'data/Scenes/Minigames/04_puzzle.lua';
    minigames[3]  = 'data/Scenes/Minigames/05_cutter.lua';
    minigames[4]  = 'data/Scenes/Minigames/09_Tails.lua';
    minigames[5]  = 'data/Scenes/Minigames/11_wine.lua';
    minigames[6]  = 'data/Scenes/11_Restaurant_MG.lua';
    minigames[7]  = 'data/Scenes/Minigames/05_lock.lua';
    minigames[8]  = 'data/Scenes/Minigames/04_lamp.lua';
    minigames[9]  = 'data/Scenes/Minigames/06_owl_lock.lua';
    minigames[10] = 'data/Scenes/Minigames/06_laundry.lua';
    minigames[11] = 'data/Scenes/Minigames/07_lock.lua';
    minigames[12] = 'data/Scenes/Minigames/13_lock.lua'
    minigames[13] = 'data/Scenes/Minigames/18_lock.lua'
    minigames[14] = 'data/Scenes/Minigames/16_lock.lua'
    
    for index, value in pairs(minigames) do
        if value == path then
            return true;
        end
    end
    
    return false;
end

function MarkLinkZone(trigger_name, cursor_name, is_active, mark_with_ps)
    if is_active then
        game_state.custom_cursors[trigger_name] = cursor_name
        RegisterQuestObjects(trigger_name);
        
        if mark_with_ps
            and not play_field:GetObject(trigger_name):HasParticleSystem()
        then
            play_field:GetObject(trigger_name):AddParticleSystem('data/ParticleSystem/ObjectHighlight.psi',
                                                                 'ZoneHighlightParticle',
                                                                 true);
        end
    else
        game_state.custom_cursors[trigger_name] = ''
        --play_field:GetObject(trigger_name):ResetParticleSystem()
    end
end

function LinkScene(trigger_name, cursor_name, path, mark_with_ps, condition, on_condition_fail, on_scene_visited)
    game_state.linked_scenes[trigger_name]                   = {}
    game_state.linked_scenes[trigger_name].path              = path
    game_state.linked_scenes[trigger_name].parent_scene      = game_state.scene_path;
    game_state.linked_scenes[trigger_name].on_condition_fail = on_condition_fail
    game_state.linked_scenes[trigger_name].on_scene_visited  = on_scene_visited
    game_state.linked_scenes[trigger_name].cursor_name       = cursor_name
    game_state.linked_scenes[trigger_name].mark_with_ps      = mark_with_ps

    if condition then
        game_state.linked_scenes[trigger_name].condition = condition
    end

    local is_closed          = HasGameState('ClosedScene', path)
    local is_visited         = HasGameState('SceneVisited', path)
    local is_allObjectsFound = HasGameState("AllSceneTaskObjectsFound", path)
    
    if is_allObjectsFound then
        mark_with_ps = false;
    end
    
    if condition then
        if condition() then
            MarkLinkZone(trigger_name, cursor_name, true, mark_with_ps)
        else
            MarkLinkZone(trigger_name, cursor_name, true, false)
        end
    else
        if not is_closed then
            MarkLinkZone(trigger_name, cursor_name, true, mark_with_ps)
        elseif is_visited and on_scene_visited then
            MarkLinkZone(trigger_name, cursor_name, true, false)
        end
    end
    
    if is_visited then
        game_state.ignore_on_highlight[trigger_name] = true
    end
end

function RestartHiddenObject(ho_path)
    
    if HasGameState("AllSceneTaskObjectsFound", ho_path) then
        RemoveGameState("AllSceneTaskObjectsFound", ho_path)
        RemoveGameState('ClosedScene',              ho_path)
    end
    
    -- if ho trigger in current scene - relink the scene
    for trigger_name, v in pairs(game_state.linked_scenes) do
        if v.parent_scene == game_state.scene_path 
            and v.path == ho_path
        then    
            LinkScene(trigger_name, v.cursor_name, v.path, true, v.condition, v.on_condition_fail, v.on_scene_visited)
            break;
        end
    end
end

function RegisterQuestObjects(...)
	for i, v in ipairs({...}) do
		game_state.quest_objects[v] = true
	end
end

function UnRegisterQuestObjects(...)
	for i, v in ipairs({...}) do
		game_state.quest_objects[v] = nil;
	end
end

function GetCharacterInfo(name)
    local characters = {}

    characters['Player'] = {}
    characters['Player'].text_color = '0xFFEEEEEE'

    characters['PlayerMonolog'] = {}
    characters['PlayerMonolog'].text_color = characters['Player'].text_color
    characters['PlayerMonolog'].scale = 0.7
    characters['PlayerMonolog'].width = 650.
    characters['PlayerMonolog'].spacing = 0.8

    characters['Restorator'] = {}
    characters['Restorator'].text_color = '0xFFCCCC33'
    
    characters['Dupen'] = {}
    characters['Dupen'].text_color = '0xFFCCCC33'
    
    characters['Coachman'] = {}
    characters['Coachman'].text_color = '0xFFCCCC33'
    
    characters['Banker'] = {}
    characters['Banker'].text_color = '0xFFCCCC33'
    
    characters['Gendarme'] = {}
    characters['Gendarme'].text_color = '0xFFCCCC33'
    
    characters['Boy'] = {}
    characters['Boy'].text_color = '0xFFCCCC33'
    
    characters['Laundress'] = {}
    characters['Laundress'].text_color = '0xFFCCCC33'
    
    characters['Jeweller'] = {}
    characters['Jeweller'].text_color = '0xFFCCCC33'
    
    characters['Doctor'] = {}
    characters['Doctor'].text_color = '0xFFCCCC33'
    
    characters['Lady'] = {}
    characters['Lady'].text_color = '0xFFCCCC33'
    
    characters['Sailor'] = {}
    characters['Sailor'].text_color = '0xFFCCCC33'
    
    
    return characters[name]
end

function ShowMonolog(comics_name, text_alias)
    
    UpdateComicsRequest(); -- for hidding current monolog if any

    local c = CreateComics(comics_name,
                           CreateComicsFrame('PlayerMonolog', text_alias))
    if c then
        c.monolog_mode = true;
        
        c.on_finish = function()
            if HasGameState('ComicsShown', comics_name) then
                RemoveGameState('ComicsShown', comics_name)
            end
            
            if not HasGameState('MonologShown', comics_name) then
                AddGameState('MonologShown', comics_name)
            end
        end
        c.SetVisible(true)
        PlaySound("Curtains_up")
        
        game_state.comics.isMonolog = true;
    end
    
    return true;
end

function UpdateComicsRequest()
    --if game_state.comics and not game_state.comics:IsChangingReplic() then
    if game_state.comics and (game_state.comics.monolog_mode or not game_state.comics:IsChangingReplic())then
        game_state.comics:ShowNextFrame()
    end
end

function GoToMap()
    if HasGameState('BeforMapScreen') then
        local value = GetGameState('BeforMapScreen'):Get(0);
        RemoveGameState('BeforMapScreen', value);
    end
    AddGameState('BeforMapScreen', game_state.scene_path);
    StartLevel('data/Scenes/00_Global_Map.lua');
end

function SetLevelCompletedState(levelName)
    if not HasGameState('LevelCompleted', levelName) then
        AddGameState('LevelCompleted', levelName);
    end
end

function CompleteLevel(levelName)
    if game_state.parent_scene then
        game_state.parent_scene = nil; 
    end
    
    SetLevelCompletedState(levelName)
    GoToMap();
end

function CustomToolApply(tool_name)
    if play_field:GetTool() ~= '' then
        play_field:SetTool('')
    end
    
    InventoryOnToolApplied(tool_name);
    game_state.tool = nil
    local inv = play_field:GetLevelScreen():GetInventory()
    inv:GetToolInfo(tool_name).m_tool:ChangeOpacity(1., 0., 0.2)
    inv:RemoveTool(tool_name)
    assert(not HasGameState('ToolApplied', tool_name))
    AddGameState('ToolApplied', tool_name);
end

function CreateDupenAnimations(screen, ...)
    local args = {...}
    
    for i,v in ipairs(args) do
        if v == 'body' then
            local anim = CreateAnimation('data/Texture/Characters/Dupen/body.png',0,0,376,520,1,0)
            anim:SetHotSpot(188,260)
            anim:SetBlendMode(2)
            anim:SetColor('0x00FFFFFF')
            screen:CreateObject('body',anim,375,508,120,0,1,1)
        elseif v == 'head1' then
            local anim = CreateAnimation('data/Texture/Characters/Dupen/head1.png',0,0,185,244,1,0)
            anim:SetHotSpot(92,122)
            anim:SetBlendMode(2)
            anim:SetColor('0xFFFFFFFF')
            screen:CreateObject('head1',anim,408,202,121,0,1,1)
        elseif v == 'head2' then
            local anim = CreateAnimation('data/Texture/Characters/Dupen/head2.png',0,0,214,252,1,0)
            anim:SetHotSpot(107,126)
            anim:SetBlendMode(2)
            anim:SetColor('0xFFFFFFFF')
            screen:CreateObject('head2',anim,407,200,122,0,1,1)
        end
    end
end
--[[
function UpdateExitConditions()
    if not game_state.ec then
        game_state.ec = {}
    end
    
    game_state.ec[1] = HasGameState('ToolFound', '15_wrench')
    game_state.ec[2] = HasGameState('ToolFound', '13_stone')
    game_state.ec[3] = HasGameState('ToolFound', '07_flask')
    game_state.ec[4] = HasGameState('ToolFound', '13_flock')
end

function CheckExitConditions()
    if game_state.already_exit then
        return;
    end
    
    if game_state.fly_tools:GetNReferences() ~= 0 or game_state.locker:GetNReferences() ~= 0 then
        return;
    end
    
    for i, v in ipairs(game_state.ec) do
        if not v then
            return;
        end
    end
    
    game_state.already_exit = true;
    TimerDoString("exitConfirmationScreen = 1;" ..
                  "ExitToMainMenu();"..
                  "exitConfirmationScreen = nil;",
                  0.3, play_field:GetTimer());
end
--]]
function ShowEndDemoBuild()
    
    endDemoScreen = CreateScreen();
    endDemoScreen:SetLayer(POPUP_WINDOWS_LAYER + 1);
    
    anim = endDemoScreen:CreateAnimation("data/Texture/GUI/Square_dialog_back.png");
    anim:SetHotSpot(309, 237);
    anim:SetPosXY(512, 350);
    anim:SetPosZ(0);
    anim:SetScaleXY(1, 1);
    anim:SetAngle(0);
    anim:SetOpacity(1);
    
    local textBox = CreateTextEntity(INGAME_MENU_FONT, 'END_DEMO_MESSAGE');
	--textBox:SetHotSpot(298, 206);
	textBox:SetXY(212, 280);
	textBox:SetZ(1);
	textBox:SetScale(1.0);
	textBox:SetRect(412, 264, 200, 100);
	textBox:SetBorderSize(600 / textBox:GetScale(), 0)
	textBox:AttachTo(endDemoScreen);
    
    
    local OKButton = MakeButton(512, 570, 100, 40);
    OKButton:GetCaption():SetFont(BUTTONS_FONT);
    OKButton:SetSpriteUp("OKButton");
	OKButton:SetSpriteOver("OKButtonOver");
	OKButton:SetSpriteDown("OKButtonDown");
    OKButton:SetZ(20);
    OKButton:SetActionSound("Menu_button_click");
    
    OKButton:AttachTo(endDemoScreen);
    OKButton:SetAction("CloseEndDemoBuildScreen");
    
    PopUpScreensMgr:Push(endDemoScreen);
end

function CloseEndDemoBuildScreen()

    if endDemoScreen
    then
        PopUpScreensMgr:Pop();
        endDemoScreen = nil;
        
        TimerDoString(  "APP:PerformExit();",
                        0.0,
                        play_field:GetTimer());
    end
    
end

-------------------------------------------------------------------------------------
function PunishClicking()

    play_field.mouseDownBlocked = true;
    TimerDoString("play_field.mouseDownBlocked = false;", 1.5, play_field:GetTimer())
    
    local curMouseX = MouseHolder:GetX();
    local curMouseY = MouseHolder:GetY();
    local endMouseX = 0;
    local endMouseY = 0;
    
    if (curMouseX < 512)
    then
        endMouseX = math.random(600, 900);
    else
        endMouseX = math.random(100, 500)
    end
    
    if (curMouseY < 384)
    then
        endMouseY = math.random(450, 668)
    else
        endMouseY = math.random(100, 300);
    end    
    
    local eff = BuildCursorTrajectory(curMouseX,
                                      curMouseY,
                                      endMouseX,
                                      endMouseY);
    eff:AttachTo(MouseHolder);
    eff:Play();
    
    PlaySound('MousePunish');
end

function BuildCursorTrajectory(xStart, yStart, xEnd, yEnd)

    local slideUp = function(effector, xOffset, yOffset)
    
        effector:SetKey(_TRACK_X, 0, -9.03971612625702 + xOffset);
        effector:SetKey(_TRACK_Y, 0, -1.087678110588 + yOffset);
        effector:SetKey(_TRACK_X, 0.1, -35.918712415678 + xOffset);
        effector:SetKey(_TRACK_Y, 0.1, -16.35894329572 + yOffset);
        effector:SetKey(_TRACK_X, 0.2, -54.778451206019 + xOffset);
        effector:SetKey(_TRACK_Y, 0.2, -43.08024698882 + yOffset);
        effector:SetKey(_TRACK_X, 0.3, -55.000616747998 + xOffset);
        effector:SetKey(_TRACK_Y, 0.3, -74.294729726322 + yOffset);
        effector:SetKey(_TRACK_X, 0.4, -39.31565486476 + xOffset);
        effector:SetKey(_TRACK_Y, 0.4, -100.419120425399 + yOffset);
        effector:SetKey(_TRACK_X, 0.5, -12.016902848862 + xOffset);
        effector:SetKey(_TRACK_Y, 0.5, -116.980770282281 + yOffset);
        effector:SetKey(_TRACK_X, 0.6, 20.377160021529 + xOffset);
        effector:SetKey(_TRACK_Y, 0.6, -124.538072231797 + yOffset);
        effector:SetKey(_TRACK_X, 0.64, 32.705230134861 + xOffset);
        effector:SetKey(_TRACK_Y, 0.64, -125.99738170922 + yOffset);
        effector:SetKey(_TRACK_X, 0.7, 57.067546766499 + xOffset);
        effector:SetKey(_TRACK_Y, 0.7, -133.883052413855 + yOffset);
        effector:SetKey(_TRACK_X, 0.8, 66.5737743546611 + xOffset);
        effector:SetKey(_TRACK_Y, 0.8, -175.427790836715 + yOffset);
        effector:SetKey(_TRACK_X, 0.84, 56.575004743915 + xOffset);
        effector:SetKey(_TRACK_Y, 0.84, -190.035905964726 + yOffset);
        effector:SetKey(_TRACK_X, 0.9, 32.795787661179 + xOffset);
        effector:SetKey(_TRACK_Y, 0.9, -199.955445026108 + yOffset);
        effector:SetKey(_TRACK_X, 0.96, 12.49305740035 + xOffset);
        effector:SetKey(_TRACK_Y, 0.96, -184.716271154549 + yOffset);
        effector:SetKey(_TRACK_X, 1, 10.519410621768 + xOffset);
        effector:SetKey(_TRACK_Y, 1, -159.032257687091 + yOffset);
        effector:SetKey(_TRACK_X, 1.08, 56.9288506105451 + xOffset);
        effector:SetKey(_TRACK_Y, 1.08, -154.162446362942 + yOffset);
        effector:SetKey(_TRACK_X, 1.1, 66.220540453102 + xOffset);
        effector:SetKey(_TRACK_Y, 1.1, -163.53247458599 + yOffset);
        effector:SetKey(_TRACK_X, 1.16, 74.362822516088 + xOffset);
        effector:SetKey(_TRACK_Y, 1.16, -201.523985031131 + yOffset);
        effector:SetKey(_TRACK_X, 1.2, 71.8900018406169 + xOffset);
        effector:SetKey(_TRACK_Y, 1.2, -217.849626297959 + yOffset);
        effector:SetKey(_TRACK_X, 1.3, 55.310854730489 + xOffset);
        effector:SetKey(_TRACK_Y, 1.3, -255.024304284269 + yOffset);
        effector:SetKey(_TRACK_X, 1.4, 22.532603990254 + xOffset);
        effector:SetKey(_TRACK_Y, 1.4, -283.324869591707 + yOffset);
        effector:SetKey(_TRACK_X, 1.5, -15.771970680188 + xOffset);
        effector:SetKey(_TRACK_Y, 1.5, -294.170972215229 + yOffset);
        effector:SetKey(_TRACK_X, 1.52, -24.881895883868 + xOffset);
        effector:SetKey(_TRACK_Y, 1.52, -294.069968892219 + yOffset);
    
    end
    
    local slideDown = function(effector, xOffset, yOffset)
    
        effector:SetKey(_TRACK_X, 0, 8.99022554700105 + xOffset);
        effector:SetKey(_TRACK_Y, 0, 1.440609568767 + yOffset);
        effector:SetKey(_TRACK_X, 0.1, 36.028422765841 + xOffset);
        effector:SetKey(_TRACK_Y, 0.1, 18.546055327201 + yOffset);
        effector:SetKey(_TRACK_X, 0.2, 51.758827942341 + xOffset);
        effector:SetKey(_TRACK_Y, 0.2, 43.721848202421 + yOffset);
        effector:SetKey(_TRACK_X, 0.3, 51.9543208104041 + xOffset);
        effector:SetKey(_TRACK_Y, 0.3, 76.802873825099 + yOffset);
        effector:SetKey(_TRACK_X, 0.4, 33.915009259882 + xOffset);
        effector:SetKey(_TRACK_Y, 0.4, 102.236925113631 + yOffset);
        effector:SetKey(_TRACK_X, 0.5, 7.33533202798401 + xOffset);
        effector:SetKey(_TRACK_Y, 0.5, 115.800608694381 + yOffset);
        effector:SetKey(_TRACK_X, 0.64, -37.038108729105 + xOffset);
        effector:SetKey(_TRACK_Y, 0.64, 126.154512958838 + yOffset);
        effector:SetKey(_TRACK_X, 0.7, -61.603725710543 + xOffset);
        effector:SetKey(_TRACK_Y, 0.7, 133.014340473786 + yOffset);
        effector:SetKey(_TRACK_X, 0.8, -72.292546397039 + xOffset);
        effector:SetKey(_TRACK_Y, 0.8, 172.63010834575 + yOffset);
        effector:SetKey(_TRACK_X, 0.9, -41.560214157488 + xOffset);
        effector:SetKey(_TRACK_Y, 0.9, 198.041347119345 + yOffset);
        effector:SetKey(_TRACK_X, 0.96, -19.594656236159 + xOffset);
        effector:SetKey(_TRACK_Y, 0.96, 184.30996732763 + yOffset);
        effector:SetKey(_TRACK_X, 1, -15.60402572249 + xOffset);
        effector:SetKey(_TRACK_Y, 1, 158.78166758374 + yOffset);
        effector:SetKey(_TRACK_X, 1.04, -37.486530373706 + xOffset);
        effector:SetKey(_TRACK_Y, 1.04, 144.937110593006 + yOffset);
        effector:SetKey(_TRACK_X, 1.08, -63.902383098331 + xOffset);
        effector:SetKey(_TRACK_Y, 1.08, 151.970715345113 + yOffset);
        effector:SetKey(_TRACK_X, 1.1, -74.10574428385 + xOffset);
        effector:SetKey(_TRACK_Y, 1.1, 160.794966324392 + yOffset);
        effector:SetKey(_TRACK_X, 1.16, -82.512748440206 + xOffset);
        effector:SetKey(_TRACK_Y, 1.16, 199.149385725767 + yOffset);
        effector:SetKey(_TRACK_X, 1.2, -80.46989609807 + xOffset);
        effector:SetKey(_TRACK_Y, 1.2, 215.163812384836 + yOffset);
        effector:SetKey(_TRACK_X, 1.3, -64.751154318798 + xOffset);
        effector:SetKey(_TRACK_Y, 1.3, 252.943713674407 + yOffset);
        effector:SetKey(_TRACK_X, 1.4, -34.445818163542 + xOffset);
        effector:SetKey(_TRACK_Y, 1.4, 281.398356615652 + yOffset);
        effector:SetKey(_TRACK_X, 1.5, 4.97390287573 + xOffset);
        effector:SetKey(_TRACK_Y, 1.5, 294.95593311782 + yOffset);
        effector:SetKey(_TRACK_X, 1.52, 13.354557206115 + xOffset);
        effector:SetKey(_TRACK_Y, 1.52, 294.818437599949 + yOffset);
    
    end
    
    local slideLeft = function(effector, xOffset, yOffset)
    
        effector:SetKey(_TRACK_X, 0, -3.06837694027701 + xOffset);
        effector:SetKey(_TRACK_Y, 0, 8.57231440557001 + yOffset);
        effector:SetKey(_TRACK_X, 0.1, -23.346525897375 + xOffset);
        effector:SetKey(_TRACK_Y, 0.1, 32.144703004253 + yOffset);
        effector:SetKey(_TRACK_X, 0.2, -54.361318185972 + xOffset);
        effector:SetKey(_TRACK_Y, 0.2, 43.159717344779 + yOffset);
        effector:SetKey(_TRACK_X, 0.3, -85.058067013573 + xOffset);
        effector:SetKey(_TRACK_Y, 0.3, 37.60679539729 + yOffset);
        effector:SetKey(_TRACK_X, 0.4, -106.335384420515 + xOffset);
        effector:SetKey(_TRACK_Y, 0.4, 14.820133685241 + yOffset);
        effector:SetKey(_TRACK_X, 0.5, -115.194379016148 + xOffset);
        effector:SetKey(_TRACK_Y, 0.5, -15.332627175341 + yOffset);
        effector:SetKey(_TRACK_X, 0.6, -117.88602018778 + xOffset);
        effector:SetKey(_TRACK_Y, 0.6, -47.315762254909 + yOffset);
        effector:SetKey(_TRACK_X, 0.64, -116.312229914534 + xOffset);
        effector:SetKey(_TRACK_Y, 0.64, -59.897253236076 + yOffset);
        effector:SetKey(_TRACK_X, 0.7, -118.47198148653 + xOffset);
        effector:SetKey(_TRACK_Y, 0.7, -86.482669655594 + yOffset);
        effector:SetKey(_TRACK_X, 0.8, -155.532039146131 + xOffset);
        effector:SetKey(_TRACK_Y, 0.8, -102.972016204771 + yOffset);
        effector:SetKey(_TRACK_X, 0.9, -187.582449794214 + xOffset);
        effector:SetKey(_TRACK_Y, 0.9, -77.051565465185 + yOffset);
        effector:SetKey(_TRACK_X, 0.96, -176.53605962583 + xOffset);
        effector:SetKey(_TRACK_Y, 0.96, -53.610245311822 + yOffset);
        effector:SetKey(_TRACK_X, 1, -152.025122527427 + xOffset);
        effector:SetKey(_TRACK_Y, 1, -45.378799658591 + yOffset);
        effector:SetKey(_TRACK_X, 1.04, -135.591531392891 + xOffset);
        effector:SetKey(_TRACK_Y, 1.04, -64.107242004553 + yOffset);
        effector:SetKey(_TRACK_X, 1.1, -144.854670589658 + xOffset);
        effector:SetKey(_TRACK_Y, 1.1, -100.882751703786 + yOffset);
        effector:SetKey(_TRACK_X, 1.16, -179.705901494543 + xOffset);
        effector:SetKey(_TRACK_Y, 1.16, -117.376804892983 + yOffset);
        effector:SetKey(_TRACK_X, 1.2, -195.991388208058 + xOffset);
        effector:SetKey(_TRACK_Y, 1.2, -119.037704339714 + yOffset);
        effector:SetKey(_TRACK_X, 1.3, -237.468652981892 + xOffset);
        effector:SetKey(_TRACK_Y, 1.3, -110.138710052294 + yOffset);
        effector:SetKey(_TRACK_X, 1.4, -270.465486425857 + xOffset);
        effector:SetKey(_TRACK_Y, 1.4, -85.591244310499 + yOffset);
        effector:SetKey(_TRACK_X, 1.48, -287.882403730511 + xOffset);
        effector:SetKey(_TRACK_Y, 1.48, -56.528686104181 + yOffset);
        effector:SetKey(_TRACK_X, 1.52, -292.250825767185 + xOffset);
        effector:SetKey(_TRACK_Y, 1.52, -41.057401104364 + yOffset);
    
    end
    
    local slideRight = function(effector, xOffset, yOffset)
    
        effector:SetKey(_TRACK_X, 0, 0.88200225637797 + xOffset);
        effector:SetKey(_TRACK_Y, 0, -9.06209596811402 + yOffset);
        effector:SetKey(_TRACK_X, 0.1, 16.432153162213 + xOffset);
        effector:SetKey(_TRACK_Y, 0.1, -36.143623431779 + yOffset);
        effector:SetKey(_TRACK_X, 0.2, 40.391332829886 + xOffset);
        effector:SetKey(_TRACK_Y, 0.2, -54.169515400461 + yOffset);
        effector:SetKey(_TRACK_X, 0.3, 73.1795266975751 + xOffset);
        effector:SetKey(_TRACK_Y, 0.3, -56.593508936083 + yOffset);
        effector:SetKey(_TRACK_X, 0.4, 99.381135117946 + xOffset);
        effector:SetKey(_TRACK_Y, 0.4, -40.411261798199 + yOffset);
        effector:SetKey(_TRACK_X, 0.5, 116.400912290091 + xOffset);
        effector:SetKey(_TRACK_Y, 0.5, -13.495503170807 + yOffset);
        effector:SetKey(_TRACK_X, 0.6, 125.467187337876 + xOffset);
        effector:SetKey(_TRACK_Y, 0.6, 17.529095252879 + yOffset);
        effector:SetKey(_TRACK_X, 0.64, 126.963398402066 + xOffset);
        effector:SetKey(_TRACK_Y, 0.64, 29.822352312656 + yOffset);
        effector:SetKey(_TRACK_X, 0.7, 135.446975376384 + xOffset);
        effector:SetKey(_TRACK_Y, 0.7, 53.734010824257 + yOffset);
        effector:SetKey(_TRACK_X, 0.8, 176.388552559478 + xOffset);
        effector:SetKey(_TRACK_Y, 0.8, 61.712341013617 + yOffset);
        effector:SetKey(_TRACK_X, 0.9, 200.281768985106 + xOffset);
        effector:SetKey(_TRACK_Y, 0.9, 27.685499556685 + yOffset);
        effector:SetKey(_TRACK_X, 0.96, 185.037680472858 + xOffset);
        effector:SetKey(_TRACK_Y, 0.96, 7.03477903415001 + yOffset);
        effector:SetKey(_TRACK_X, 1, 159.900757162837 + xOffset);
        effector:SetKey(_TRACK_Y, 1, 5.69631590068298 + yOffset);
        effector:SetKey(_TRACK_X, 1.04, 146.758894186318 + xOffset);
        effector:SetKey(_TRACK_Y, 1.04, 28.162986476394 + yOffset);
        effector:SetKey(_TRACK_X, 1.08, 153.622706639899 + xOffset);
        effector:SetKey(_TRACK_Y, 1.08, 53.681054986025 + yOffset);
        effector:SetKey(_TRACK_X, 1.1, 163.345076132253 + xOffset);
        effector:SetKey(_TRACK_Y, 1.1, 62.797052901032 + yOffset);
        effector:SetKey(_TRACK_X, 1.16, 202.535815934466 + xOffset);
        effector:SetKey(_TRACK_Y, 1.16, 70.764580548227 + yOffset);
        effector:SetKey(_TRACK_X, 1.2, 219.72382370528 + xOffset);
        effector:SetKey(_TRACK_Y, 1.2, 67.615435689413 + yOffset);
        effector:SetKey(_TRACK_X, 1.3, 257.503976005262 + xOffset);
        effector:SetKey(_TRACK_Y, 1.3, 49.245546043275 + yOffset);
        effector:SetKey(_TRACK_X, 1.4, 283.967626310547 + xOffset);
        effector:SetKey(_TRACK_Y, 1.4, 16.081599360911 + yOffset);
        effector:SetKey(_TRACK_X, 1.5, 294.221432444228 + xOffset);
        effector:SetKey(_TRACK_Y, 1.5, -22.82599589568 + yOffset);
        effector:SetKey(_TRACK_X, 1.52, 293.428698836615 + xOffset);
        effector:SetKey(_TRACK_Y, 1.52, -31.557155228207 + yOffset);
    
    end
    
    local slideRightUp = function(effector, xOffset, yOffset)
    
        effector:SetKey(_TRACK_X, 0, -5.62294000513299 + xOffset);
        effector:SetKey(_TRACK_Y, 0, -7.16114914062302 + yOffset);
        effector:SetKey(_TRACK_X, 0.1, -13.830845383165 + xOffset);
        effector:SetKey(_TRACK_Y, 0.1, -36.965884858066 + yOffset);
        effector:SetKey(_TRACK_X, 0.2, -8.271879529687 + xOffset);
        effector:SetKey(_TRACK_Y, 0.2, -69.196549091659 + yOffset);
        effector:SetKey(_TRACK_X, 0.3, 13.642998123952 + xOffset);
        effector:SetKey(_TRACK_Y, 0.3, -91.425616267855 + yOffset);
        effector:SetKey(_TRACK_X, 0.4, 43.206674851926 + xOffset);
        effector:SetKey(_TRACK_Y, 0.4, -98.80740717525 + yOffset);
        effector:SetKey(_TRACK_X, 0.5, 74.220662441736 + xOffset);
        effector:SetKey(_TRACK_Y, 0.5, -91.215129428317 + yOffset);
        effector:SetKey(_TRACK_X, 0.6, 102.47054342355 + xOffset);
        effector:SetKey(_TRACK_Y, 0.6, -73.652887358457 + yOffset);
        effector:SetKey(_TRACK_X, 0.64, 112.219693026967 + xOffset);
        effector:SetKey(_TRACK_Y, 0.64, -65.967513009712 + yOffset);
        effector:SetKey(_TRACK_X, 0.7, 135.022463552062 + xOffset);
        effector:SetKey(_TRACK_Y, 0.7, -54.316764943519 + yOffset);
        effector:SetKey(_TRACK_X, 0.8, 171.120947804581 + xOffset);
        effector:SetKey(_TRACK_Y, 0.8, -76.971413213853 + yOffset);
        effector:SetKey(_TRACK_X, 0.84, 174.38024727667 + xOffset);
        effector:SetKey(_TRACK_Y, 0.84, -94.371108276504 + yOffset);
        effector:SetKey(_TRACK_X, 0.9, 164.579974962709 + xOffset);
        effector:SetKey(_TRACK_Y, 0.9, -118.199727263561 + yOffset);
        effector:SetKey(_TRACK_X, 0.96, 139.448053534415 + xOffset);
        effector:SetKey(_TRACK_Y, 0.96, -121.780202323334 + yOffset);
        effector:SetKey(_TRACK_X, 1, 119.891134422686 + xOffset);
        effector:SetKey(_TRACK_Y, 1, -105.014441253211 + yOffset);
        effector:SetKey(_TRACK_X, 1.08, 149.264087539416 + xOffset);
        effector:SetKey(_TRACK_Y, 1.08, -68.754534915671 + yOffset);
        effector:SetKey(_TRACK_X, 1.1, 162.459914932197 + xOffset);
        effector:SetKey(_TRACK_Y, 1.1, -68.809928515744 + yOffset);
        effector:SetKey(_TRACK_X, 1.16, 195.081432456547 + xOffset);
        effector:SetKey(_TRACK_Y, 1.16, -89.916520317952 + yOffset);
        effector:SetKey(_TRACK_X, 1.2, 204.876855835255 + xOffset);
        effector:SetKey(_TRACK_Y, 1.2, -103.209040233228 + yOffset);
        effector:SetKey(_TRACK_X, 1.3, 219.440095379941 + xOffset);
        effector:SetKey(_TRACK_Y, 1.3, -141.218734473635 + yOffset);
        effector:SetKey(_TRACK_X, 1.4, 216.273893646389 + xOffset);
        effector:SetKey(_TRACK_Y, 1.4, -184.407979487791 + yOffset);
        effector:SetKey(_TRACK_X, 1.5, 196.857821860992 + xOffset);
        effector:SetKey(_TRACK_Y, 1.5, -219.162756702264 + yOffset);
        effector:SetKey(_TRACK_X, 1.52, 190.344711838745 + xOffset);
        effector:SetKey(_TRACK_Y, 1.52, -225.533026455266 + yOffset);
    
    end
    
    local slideRightDown = function(effector, xOffset, yOffset)
    
        effector:SetKey(_TRACK_X, 0, 7.03153928732297 + xOffset);
        effector:SetKey(_TRACK_Y, 0, -5.78419973430999 + yOffset);
        effector:SetKey(_TRACK_X, 0.1, 37.176688155761 + xOffset);
        effector:SetKey(_TRACK_Y, 0.1, -13.938114294767 + yOffset);
        effector:SetKey(_TRACK_X, 0.2, 66.86461701843 + xOffset);
        effector:SetKey(_TRACK_Y, 0.2, -9.74264632807899 + yOffset);
        effector:SetKey(_TRACK_X, 0.3, 91.7633935117231 + xOffset);
        effector:SetKey(_TRACK_Y, 0.3, 11.728085632032 + yOffset);
        effector:SetKey(_TRACK_X, 0.4, 98.848151817728 + xOffset);
        effector:SetKey(_TRACK_Y, 0.4, 41.697997310104 + yOffset);
        effector:SetKey(_TRACK_X, 0.5, 91.850636224226 + xOffset);
        effector:SetKey(_TRACK_Y, 0.5, 72.765112609022 + yOffset);
        effector:SetKey(_TRACK_X, 0.6, 76.32375686164 + xOffset);
        effector:SetKey(_TRACK_Y, 0.6, 101.113641104391 + yOffset);
        effector:SetKey(_TRACK_X, 0.64, 68.689092421376 + xOffset);
        effector:SetKey(_TRACK_Y, 0.64, 110.864267523804 + yOffset);
        effector:SetKey(_TRACK_X, 0.7, 57.779791345664 + xOffset);
        effector:SetKey(_TRACK_Y, 0.7, 133.771158214032 + yOffset);
        effector:SetKey(_TRACK_X, 0.8, 81.088326824861 + xOffset);
        effector:SetKey(_TRACK_Y, 0.8, 168.362756452112 + yOffset);
        effector:SetKey(_TRACK_X, 0.9, 122.043992520337 + xOffset);
        effector:SetKey(_TRACK_Y, 0.9, 161.197201474475 + yOffset);
        effector:SetKey(_TRACK_X, 0.96, 125.867058678191 + xOffset);
        effector:SetKey(_TRACK_Y, 0.96, 135.815738596584 + yOffset);
        effector:SetKey(_TRACK_X, 1, 109.039006105551 + xOffset);
        effector:SetKey(_TRACK_Y, 1, 117.094813307859 + yOffset);
        effector:SetKey(_TRACK_X, 1.04, 83.859970562661 + xOffset);
        effector:SetKey(_TRACK_Y, 1.04, 123.688447994507 + yOffset);
        effector:SetKey(_TRACK_X, 1.08, 70.669419607438 + xOffset);
        effector:SetKey(_TRACK_Y, 1.08, 146.58589561117 + yOffset);
        effector:SetKey(_TRACK_X, 1.1, 71.098189061699 + xOffset);
        effector:SetKey(_TRACK_Y, 1.1, 159.9066329514 + yOffset);
        effector:SetKey(_TRACK_X, 1.16, 93.176334106938 + xOffset);
        effector:SetKey(_TRACK_Y, 1.16, 193.252563653885 + yOffset);
        effector:SetKey(_TRACK_X, 1.2, 107.556872641374 + xOffset);
        effector:SetKey(_TRACK_Y, 1.2, 203.179538819108 + yOffset);
        effector:SetKey(_TRACK_X, 1.3, 147.260948065385 + xOffset);
        effector:SetKey(_TRACK_Y, 1.3, 216.904667166253 + yOffset);
        effector:SetKey(_TRACK_X, 1.4, 189.424026241209 + xOffset);
        effector:SetKey(_TRACK_Y, 1.4, 212.166842162061 + yOffset);
        effector:SetKey(_TRACK_X, 1.5, 224.186386536905 + xOffset);
        effector:SetKey(_TRACK_Y, 1.5, 191.905553566562 + yOffset);
        effector:SetKey(_TRACK_X, 1.52, 229.799701198938 + xOffset);
        effector:SetKey(_TRACK_Y, 1.52, 185.171144285294 + yOffset);
    
    end
    
    local slideLeftUp = function(effector, xOffset, yOffset)
    
        effector:SetKey(_TRACK_X, 0, -8.23121178834799 + xOffset);
        effector:SetKey(_TRACK_Y, 0, 3.89187150493598 + yOffset);
        effector:SetKey(_TRACK_X, 0.1, -39.238224252716 + xOffset);
        effector:SetKey(_TRACK_Y, 0.1, 6.22125069435299 + yOffset);
        effector:SetKey(_TRACK_X, 0.2, -68.957785532129 + xOffset);
        effector:SetKey(_TRACK_Y, 0.2, -7.92072791495298 + yOffset);
        effector:SetKey(_TRACK_X, 0.3, -86.737156024036 + xOffset);
        effector:SetKey(_TRACK_Y, 0.3, -33.553115935798 + yOffset);
        effector:SetKey(_TRACK_X, 0.4, -85.66988843075 + xOffset);
        effector:SetKey(_TRACK_Y, 0.4, -64.711054376899 + yOffset);
        effector:SetKey(_TRACK_X, 0.5, -70.612921907803 + xOffset);
        effector:SetKey(_TRACK_Y, 0.5, -92.29653120598 + yOffset);
        effector:SetKey(_TRACK_X, 0.6, -49.900707934417 + xOffset);
        effector:SetKey(_TRACK_Y, 0.6, -116.81530062933 + yOffset);
        effector:SetKey(_TRACK_X, 0.64, -39.891412569818 + xOffset);
        effector:SetKey(_TRACK_Y, 0.64, -124.598920445173 + yOffset);
        effector:SetKey(_TRACK_X, 0.7, -22.619859321146 + xOffset);
        effector:SetKey(_TRACK_Y, 0.7, -144.924823658319 + yOffset);
        effector:SetKey(_TRACK_X, 0.8, -37.165548641156 + xOffset);
        effector:SetKey(_TRACK_Y, 0.8, -182.789970502846 + yOffset);
        effector:SetKey(_TRACK_X, 0.9, -78.157137839603 + xOffset);
        effector:SetKey(_TRACK_Y, 0.9, -187.124506722545 + yOffset);
        effector:SetKey(_TRACK_X, 0.96, -86.921676884314 + xOffset);
        effector:SetKey(_TRACK_Y, 0.96, -162.73801288644 + yOffset);
        effector:SetKey(_TRACK_X, 1, -75.410338089164 + xOffset);
        effector:SetKey(_TRACK_Y, 1, -139.585652010555 + yOffset);
        effector:SetKey(_TRACK_X, 1.04, -50.547025774795 + xOffset);
        effector:SetKey(_TRACK_Y, 1.04, -141.208356863968 + yOffset);
        effector:SetKey(_TRACK_X, 1.1, -31.092842025985 + xOffset);
        effector:SetKey(_TRACK_Y, 1.1, -173.762597694997 + yOffset);
        effector:SetKey(_TRACK_X, 1.16, -44.073326872195 + xOffset);
        effector:SetKey(_TRACK_Y, 1.16, -210.069196259872 + yOffset);
        effector:SetKey(_TRACK_X, 1.2, -54.414471700592 + xOffset);
        effector:SetKey(_TRACK_Y, 1.2, -222.759207611574 + yOffset);
        effector:SetKey(_TRACK_X, 1.3, -90.035866093615 + xOffset);
        effector:SetKey(_TRACK_Y, 1.3, -245.795523591847 + yOffset);
        effector:SetKey(_TRACK_X, 1.4, -130.725830266494 + xOffset);
        effector:SetKey(_TRACK_Y, 1.4, -251.77012879079 + yOffset);
        effector:SetKey(_TRACK_X, 1.48, -163.591782586296 + xOffset);
        effector:SetKey(_TRACK_Y, 1.48, -243.53541713796 + yOffset);
        effector:SetKey(_TRACK_X, 1.52, -177.620573968553 + xOffset);
        effector:SetKey(_TRACK_Y, 1.52, -235.684507446136 + yOffset);
    
    end
    
    local slideLeftDown = function(effector, xOffset, yOffset)
    
        effector:SetKey(_TRACK_X, 0, 5.33838465356303 + xOffset);
        effector:SetKey(_TRACK_Y, 0, 7.37571424379797 + yOffset);
        effector:SetKey(_TRACK_X, 0.1, 12.361900567057 + xOffset);
        effector:SetKey(_TRACK_Y, 0.1, 38.589983539307 + yOffset);
        effector:SetKey(_TRACK_X, 0.2, 5.68300287435704 + xOffset);
        effector:SetKey(_TRACK_Y, 0.2, 67.515033574238 + yOffset);
        effector:SetKey(_TRACK_X, 0.3, -17.570580339365 + xOffset);
        effector:SetKey(_TRACK_Y, 0.3, 91.045085453321 + yOffset);
        effector:SetKey(_TRACK_X, 0.4, -48.310890003843 + xOffset);
        effector:SetKey(_TRACK_Y, 0.4, 96.273956067177 + yOffset);
        effector:SetKey(_TRACK_X, 0.5, -76.696532654084 + xOffset);
        effector:SetKey(_TRACK_Y, 0.5, 87.070258692569 + yOffset);
        effector:SetKey(_TRACK_X, 0.64, -115.394609435155 + xOffset);
        effector:SetKey(_TRACK_Y, 0.64, 63.014813745806 + yOffset);
        effector:SetKey(_TRACK_X, 0.7, -137.615754340351 + xOffset);
        effector:SetKey(_TRACK_Y, 0.7, 50.494929947789 + yOffset);
        effector:SetKey(_TRACK_X, 0.8, -173.186470034838 + xOffset);
        effector:SetKey(_TRACK_Y, 0.8, 70.949370461659 + yOffset);
        effector:SetKey(_TRACK_X, 0.9, -169.423888761733 + xOffset);
        effector:SetKey(_TRACK_Y, 0.9, 110.648870245083 + yOffset);
        effector:SetKey(_TRACK_X, 0.96, -144.182342037245 + xOffset);
        effector:SetKey(_TRACK_Y, 0.96, 116.47131343803 + yOffset);
        effector:SetKey(_TRACK_X, 1, -123.309306278753 + xOffset);
        effector:SetKey(_TRACK_Y, 1, 101.241881474389 + yOffset);
        effector:SetKey(_TRACK_X, 1.04, -128.992993576302 + xOffset);
        effector:SetKey(_TRACK_Y, 1.04, 75.979033915497 + yOffset);
        effector:SetKey(_TRACK_X, 1.08, -152.64533178511 + xOffset);
        effector:SetKey(_TRACK_Y, 1.08, 62.273714939489 + yOffset);
        effector:SetKey(_TRACK_X, 1.1, -166.099885376626 + xOffset);
        effector:SetKey(_TRACK_Y, 1.1, 61.298536760653 + yOffset);
        effector:SetKey(_TRACK_X, 1.16, -199.165205072234 + xOffset);
        effector:SetKey(_TRACK_Y, 1.16, 82.474557159416 + yOffset);
        effector:SetKey(_TRACK_X, 1.2, -209.04460001559 + xOffset);
        effector:SetKey(_TRACK_Y, 1.2, 95.242981590946 + yOffset);
        effector:SetKey(_TRACK_X, 1.3, -224.64419550616 + xOffset);
        effector:SetKey(_TRACK_Y, 1.3, 133.072234889203 + yOffset);
        effector:SetKey(_TRACK_X, 1.4, -223.335557784637 + xOffset);
        effector:SetKey(_TRACK_Y, 1.4, 174.621814570719 + yOffset);
        effector:SetKey(_TRACK_X, 1.5, -205.048260006424 + xOffset);
        effector:SetKey(_TRACK_Y, 1.5, 212.082420911209 + yOffset);
        effector:SetKey(_TRACK_X, 1.52, -199.025018485559 + xOffset);
        effector:SetKey(_TRACK_Y, 1.52, 217.911214405935 + yOffset);
    
    end
    
    local functor = slideDown;
    
    if (xStart < 400)
    then
    
        if (yStart < 300)
        then
            functor = slideRightDown;
        elseif (yStart > 500)
        then
            functor = slideRightUp;
        else
            functor = slideRight;
        end
    
    elseif (xStart > 750)
    then
    
        if (yStart < 300)
        then
            functor = slideLeftDown;
        elseif (yStart > 500)
        then
            functor = slideLeftUp;
        else
            functor = slideLeft;
        end
    
    else
    
        if (yStart < 350)
        then
            functor = slideDown;
        else
            functor = slideUp;        
        end
    
    end
    
    local effector = CreateAnimationEffector();
    functor(effector, xStart, yStart)
    return effector;
    
end

function IsTaskObjectFound(obj_name)
    local state_value = game_state.scene_path.."("..obj_name..")"
    
    return HasGameState("TaskObjectFound", state_value)
end

--------------------------------------------------------------------------------
hidden_zoom_zones = LuaStack:New();

--------------------------------------------------------------------------------
function HideZoomZones()

    while (active_zones:GetTop())
    do
        local zone = active_zones:GetTop();
        if not zone.isFullscreen
        then
            hidden_zoom_zones:Push(zone);
            active_zones:Pop();
            
            -- kinda hiding zoom zone
            for i, v in pairs(zone.objects)
            do
                if v == true and play_field:HasObject(i)
                then
                    obj = play_field:GetObject(i)
                    if obj:GetOpacity() ~= 0.
                    then
                        obj:SetOpacity(0.)
                    end
                end
            end
            
            zone.close_button:Hide()
        else
            break;
        end
    end
    
end

--------------------------------------------------------------------------------
function ShowHiddenZoomZones()

    while (hidden_zoom_zones:GetTop())
    do
        local zone = hidden_zoom_zones:GetTop();
        active_zones:Push(zone);
        
        for i, v in pairs(zone.objects) do
            if v == true and play_field:HasObject(i) and
                zone.objects_visibility[i] == true
            then
                obj = play_field:GetObject(i)
                obj:SetOpacity(obj:GetMaxOpacity())
            end
        end
        zone.close_button:Show();
        hidden_zoom_zones:Pop();
    end
end
--------------------------------------------------------------------------------

function BlockedOnInventoryFull(objName)
    local type = type(objName);
    
    if type == 'string' then
        game_state.blocked_on_full_inventory[objName] = true
    elseif type == 'table' then
        for i, v in ipairs(objName) do
            game_state.blocked_on_full_inventory[v] = true
        end
    end
end
