local zoom_barrel;
local zoom_kettle;

function OnSceneLoad(screen)
    LoadData(screen)
    DefaultOnSceneLoad('data/Scenes/23_Stateroom_Main.lua', 'quest', 'data/Scenes/22_RiverPort_Deck2.lua')
    
    if HasGameState('ToolFound', '23_hoop') then
        AddNoteToNotebook('THE_DUPLEIX_GORILLA');
    end
    
    play_field:GetObject('Layer_barrel_1'    ):SetOpacity(0);
    play_field:GetObject('Layer_barrel_2'    ):SetOpacity(0);
    play_field:GetObject('Layer_hoop1'       ):SetOpacity(0);
    play_field:GetObject('Layer_hoop2'       ):SetOpacity(0);
    play_field:GetObject('Layer_manhole_open'):SetOpacity(0);
    play_field:GetObject('Layer_kettle_small'):SetOpacity(0);
    play_field:GetObject('Fire_small_anim'   ):SetOpacity(0);
    
    play_field:GetObject('area_barrel2'     ):SetVisible(false);
    play_field:GetObject('area_barrel_zoom' ):SetVisible(false);
    play_field:GetObject('area_open_manhole'):SetVisible(false);
    play_field:GetObject('area_hold'        ):SetVisible(false);
    play_field:GetObject('area_sailor'      ):SetVisible(false);
    play_field:GetObject('area_mg'          ):SetVisible(false);
    
    local comics = CreateComics('23_OnEnter',
                                    CreateComicsFrame('Lady',  'C_23_ON_ENTER_1_LADY',  'Lady'),
                                    CreateComicsFrame('Dupen', 'C_23_ON_ENTER_2_DUPEN', 'body', 'head2'),
                                    CreateComicsFrame('Lady',  'C_23_ON_ENTER_3_LADY',  'Lady'),
                                    CreateComicsFrame('Dupen', 'C_23_ON_ENTER_4_DUPEN', 'body', 'head1'),
                                    CreateComicsFrame('Lady',  'C_23_ON_ENTER_5_LADY',  'Lady'),
                                    CreateComicsFrame('Dupen', 'C_23_ON_ENTER_6_DUPEN', 'body', 'head1'),
                                    CreateComicsFrame('Lady',  'C_23_ON_ENTER_7_LADY',  'Lady'));
    if comics then
        BlockAreasOnStartDialog();
        
        comics.on_finish = function()
            UnblockAreasOnStartDialog();
            AddNoteToNotebook('THE_DUPLEIX')
        end
        
        comics.SetVisible(true);
    end
    
    LinkScene('area_cage',
              'CursorUpLeft',
              'data/Scenes/23_Stateroom_Cage_HO.lua',
              true);
    
    LinkScene('area_hold',
              'CursorDownLeft',
              'data/Scenes/24_Hold_Main.lua',
              false);
              
    LinkScene('area_mg',
              'CursorGlass',
              'data/Scenes/Minigames/23_flock.lua',
              false);
              
    
    zoom_barrel = CreateZoomZone('area_barrel_zoom',
                                 'CloseBarrelZone',
                                 'ZOOM_barrel',         true,
                                 'Layer_barrel_cover',  true,
                                 'Layer_wrench',        true);
                                 
    zoom_kettle = CreateZoomZone('area_kettle_zoom',
                                 'CloseKattleZone',
                                 'ZOOM_kattle',         true,
                                 'area_lever',          true,
                                 'Layer_lever',         false,
                                 'Layer_kettle',        false,
                                 'stove_start_anim',    false,
                                 'stove_fire_anim',     false,
                                 'stove_fire2_anim',    false,
                                 'boiling_anim',        false,
                                 'area_kettle_full_apply',  false);
                                 
    zoom_kettle.on_close = function()
        if play_field:GetObject('boiling_anim'):HasParticleSystem() then
            play_field:GetObject('boiling_anim'):ResetParticleSystem();
        end
        
        if game_state.stove_sound then
            game_state.stove_sound:StopSound();
        end
    end
    
    zoom_kettle.on_open = function()
        if game_state.stove_sound then
            game_state.stove_sound:Play(true);
        end
    end
    
    play_field:GetObject('boiling_anim'):SetClipping(512-320, 384-240, 640, 480);

    play_field:GetObject('stove_start_anim'):GetAnimation():SetMode(HGEANIM_FWD + HGEANIM_NOLOOP);
    play_field:GetObject('stove_start_anim'):GetAnimation():Stop();
    
    play_field:GetObject('stove_fire_anim'):GetAnimation():SetMode(HGEANIM_FWD + HGEANIM_LOOP);
    play_field:GetObject('stove_fire_anim'):GetAnimation():Stop();
    
    play_field:GetObject('boiling_anim'):GetAnimation():SetMode(HGEANIM_FWD + HGEANIM_LOOP);
    play_field:GetObject('boiling_anim'):GetAnimation():Stop();
    
    
    RegisterToolApplyInfo('24_axe', {'area_barrel1', 'area_barrel2'}, nil, nil, function(tool_name, obj_name)
                                                                                    if obj_name == 'area_barrel1' then
                                                                                        play_field:GetObject('Layer_barrel_1'):ChangeOpacity(0, 1, 0.3);
                                                                                        play_field:GetObject('area_barrel1'):SetVisible(false);
                                                                                        play_field:GetObject('area_barrel2'):SetVisible(true);
                                                                                        
                                                                                        PlaySound('23_AxeApply');
                                                                                    elseif obj_name == 'area_barrel2' then
                                                                                        play_field:GetObject('Layer_barrel_2'):ChangeOpacity(0, 1, 0.3);
                                                                                        play_field:GetObject('area_barrel2'):SetVisible(false);
                                                                                        
                                                                                        play_field:GetObject('area_barrel_zoom'):SetVisible(true);
                                                                                        
                                                                                        PlaySound('23_AxeApply2');
                                                                                    end
                                                                                end,
                                                                                
                                                                                function(tool_name, obj_name)
                                                                                    if not obj_name then
                                                                                        play_field:GetObject('Layer_barrel_2'):SetOpacity(1);
                                                                                        play_field:GetObject('area_barrel1'):SetVisible(false);
                                                                                        play_field:GetObject('area_barrel2'):SetVisible(false);
                                                                                        
                                                                                        play_field:GetObject('area_barrel_zoom'):SetVisible(true);
                                                                                    elseif obj_name == 'area_barrel1' then
                                                                                        play_field:GetObject('Layer_barrel_1'):SetOpacity(1);
                                                                                        play_field:GetObject('area_barrel1'):SetVisible(false);
                                                                                        play_field:GetObject('area_barrel2'):SetVisible(true);
                                                                                    end
                                                                                end,
                                                                                function(tool_name, obj_name)
                                                                                    if obj_name == 'area_barrel1' then
                                                                                        ShowMonolog('C_23_BARREL_HINT_1', 'C_23_BARREL_HINT_1');
                                                                                    elseif obj_name == 'area_barrel2' then
                                                                                        ShowMonolog('C_23_BARREL_HINT_2', 'C_23_BARREL_HINT_2');
                                                                                    end
                                                                                end);
    
    RegisterToolFindInfo('23_wrench', 'Layer_wrench',                           function(tool_name)
                                                                                    zoom_barrel.Disable();
                                                                                end,
                                                                                function(tool_name)
                                                                                    zoom_barrel.Disable();
                                                                                end);
    
    RegisterToolApplyInfo('23_hoop', 'area_hoop_place', nil, nil,               function(tool_name)
                                                                                    play_field:GetObject('area_hoop_place'):SetVisible(false);
                                                                                    play_field:GetObject('Layer_hoop1'):ChangeOpacity(0, 1, 0.3);
                                                                                    
                                                                                    PlaySound('23_HoopApply');
                                                                                end,
                                                                                function(tool_name)
                                                                                    play_field:GetObject('area_hoop_place'):SetVisible(false);
                                                                                    play_field:GetObject('Layer_hoop1'):SetOpacity(1);
                                                                                end,
                                                                                function()
                                                                                    ShowMonolog('C_23_HOOP_APPLY_HINT', 'C_23_HOOP_APPLY_HINT')
                                                                                end);
    
    RegisterActiveObject('Layer_hoop1',                                         function(obj_name)
                                                                                    play_field:GetObject('Layer_hoop1'):ChangeOpacity(1, 0, 0.3);
                                                                                    play_field:GetObject('Layer_hoop2'):ChangeOpacity(0, 1, 0.3);
                                                                                    
                                                                                    play_field:GetObject('area_open_manhole'):SetVisible(true);
                                                                                    
                                                                                    PlaySound('23_HoopClick')
                                                                                end,
                                                                                function(obj_name)
                                                                                    play_field:GetObject('Layer_hoop1'):SetOpacity(0);
                                                                                    play_field:GetObject('Layer_hoop2'):SetOpacity(1);
                                                                                    
                                                                                    play_field:GetObject('area_open_manhole'):SetVisible(true);
                                                                                end);
    
    RegisterActiveObject('area_open_manhole',                                   function(obj_name)
                                                                                    play_field:GetObject('area_open_manhole'):SetVisible(false);
                                                                                    play_field:GetObject('area_hold'        ):SetVisible(true);
                                                                                    
                                                                                    play_field:GetObject('Layer_manhole_open'):ChangeOpacity(0, 1, OPEN_DOOR_TIME)
                                                                                    play_field:GetObject('Layer_hoop2'       ):ChangeOpacity(1, 0, OPEN_DOOR_TIME)
                                                                                    
                                                                                    PlaySound('23_OpenManhole');
                                                                                end,
                                                                                function(obj_name)
                                                                                    play_field:GetObject('area_open_manhole'):SetVisible(false);
                                                                                    play_field:GetObject('area_hold'        ):SetVisible(true);
                                                                                    
                                                                                    play_field:GetObject('Layer_manhole_open'):SetOpacity(1)
                                                                                    play_field:GetObject('Layer_hoop2'       ):SetOpacity(0)
                                                                                end);

    RegisterActiveObject('area_lever',                                          function(obj_name)
                                                                                    play_field:GetObject(obj_name):SetVisible(false);
                                                                                    
                                                                                    zoom_kettle.SetObjectVisible('Layer_lever', true, 0.3);
                                                                                    zoom_kettle.SetObjectVisible('stove_start_anim', true)
                                                                                    
                                                                                    local anim = play_field:GetObject('stove_start_anim'):GetAnimation();
                                                                                    anim:Play();
                                                                                    
                                                                                    game_state.stove_sound = MakeSoundEntity("23_StoveFire");
                                                                                    game_state.stove_sound:Play(true);
                                                                                    
                                                                                    play_field:TimerDoString("OnStoveStarted()", GetAnimationLength(anim));
                                                                                end,
                                                                                function(obj_name)
                                                                                    play_field:GetObject(obj_name):SetVisible(false);
                                                                                    
                                                                                    zoom_kettle.SetObjectVisible('Layer_lever', true);
                                                                                    
                                                                                    game_state.stove_sound = MakeSoundEntity("23_StoveFire");
                                                                                    
                                                                                    OnStoveStarted();
                                                                                end);
                                                                                
    RegisterToolApplyInfo('22_kettle_full', 'area_kettle_full_apply', nil, nil, function(tool_name)
                                                                                    zoom_kettle.SetObjectVisible('Layer_kettle',     true);
                                                                                    zoom_kettle.SetObjectVisible('stove_fire2_anim', true);
                                                                                    zoom_kettle.SetObjectVisible('stove_fire_anim',  false);
                                                                                    
                                                                                    play_field:GetObject('Fire_small_anim'   ):SetOpacity(1);
                                                                                    play_field:GetObject('Layer_kettle_small'):SetOpacity(1);
                                                                                    play_field:GetObject('boiling_anim'):GetAnimation():Play();
                                                                                    zoom_kettle.SetObjectVisible('boiling_anim', true, 1);
                                                                                    
                                                                                    play_field:GetObject('area_kettle_small_ps'):AddParticleSystem( 'data/ParticleSystem/KettleBoiling.psi',
                                                                                                                                                    'SmokeParticle',
                                                                                                                                                    false);
                                                            
                                                                                    play_field:TimerDoString("RunBoilingParticleSystem()", 1);
                                                                                    PlaySound('23_KettleFullApply');
                                                                                    
                                                                                    zoom_kettle.Disable();
                                                                                    game_state.kettle_boiling = true;
                                                                                    
                                                                                    play_field:GetObject('area_mg'):SetVisible(true);
                                                                                end,
                                                                                function(tool_name) 
                                                                                    play_field:GetObject('Layer_kettle_small'):SetOpacity(1);
                                                                                    play_field:GetObject('Fire_small_anim'   ):SetOpacity(1);
                                                                                    
                                                                                    play_field:GetObject('area_kettle_small_ps'):AddParticleSystem( 'data/ParticleSystem/KettleBoiling.psi',
                                                                                                                                                    'SmokeParticle',
                                                                                                                                                    false);
                                                                                    
                                                                                    zoom_kettle.Disable();
                                                                                    game_state.kettle_boiling = true;
                                                                                    
                                                                                    play_field:GetObject('area_mg'):SetVisible(true);
                                                                                end,
                                                                                function()
                                                                                    ShowMonolog('C_23_HINT_KETTLE_FULL_APPLY', 'C_23_HINT_KETTLE_FULL_APPLY')
                                                                                end);
    
    if HasGameState('MiniGameCompleted', '23_flock') then
        AddNoteToNotebook('THE_DUPLEIX_PUZZLE');
        
        local mg_comics = CreateComics('23_MiniGameCompleted',
                                    CreateComicsFrame('Dupen', 'C_23_MG_COMPLETED_1_DUPEN', 'body', 'head1'));
        if mg_comics then
            mg_comics.on_finish = function()
                game_state.minigame_completed = true;
            end
            mg_comics.SetVisible(true);
        else
            game_state.minigame_completed = true;
        end
    end
    
    if HasGameState('ActionCompleted', game_state.scene_path.."(AllQuestsCompleted)") then
        game_state.all_quests_completed = true;
        
        RunSailorComics();
    end
    
    RegisterToolApplyInfo('20_razor', 'area_sailor', nil, nil,  function(tool_name)
                                                                    RunFinalComics();
                                                                end,
                                                                function(tool_name)
                                                                    RunFinalComics();
                                                                end,
                                                                function()
                                                                    ShowMonolog('C_23_SAILOR_HINT', 'C_23_SAILOR_HINT');
                                                                end);
end

function BlockAreasOnStartDialog()
    play_field:GetObject('area_cage'        ):SetVisible(false);
    play_field:GetObject('area_kettle_zoom' ):SetVisible(false);
    play_field:GetObject('area_barrel1'     ):SetVisible(false);
    play_field:GetObject('area_hoop_place'  ):SetVisible(false);
end

function UnblockAreasOnStartDialog()
    play_field:GetObject('area_cage'        ):SetVisible(true);
    play_field:GetObject('area_kettle_zoom' ):SetVisible(true);
    play_field:GetObject('area_barrel1'     ):SetVisible(true);
    play_field:GetObject('area_hoop_place'  ):SetVisible(true);
end

function RunBoilingParticleSystem()
    if not zoom_kettle.IsVisible() then
        return;
    end
    
    play_field:GetObject('boiling_anim'):AddParticleSystem( 'data/ParticleSystem/Boiling.psi',
                                                            'SmokeParticle',
                                                            true);
    play_field:TimerDoString("CloseKettleZoom();", 2);
end

function CloseKettleZoom()
    zoom_kettle.SetVisible(false);
end

function OnStoveStarted()
    zoom_kettle.SetObjectVisible('stove_start_anim', false)
    zoom_kettle.SetObjectVisible('stove_fire_anim',  true)
    play_field:GetObject('stove_fire_anim'):GetAnimation():Play();
    
    zoom_kettle.SetObjectVisible('area_kettle_full_apply', true);
end

function OnSceneFree(screen)
    DefaultOnSceneFree()
    FreeData(screen)
end

function OnUpdate(dt)
    
    if not game_state.all_quests_completed
        and game_state.kettle_boiling
        and game_state.minigame_completed
        and game_state.locker:GetNReferences() == 0
        and game_state.fly_tools:GetNReferences() == 0
    then
        game_state.all_quests_completed = true;
        AddGameState('ActionCompleted', game_state.scene_path.."(AllQuestsCompleted)");
        
        play_field:TimerDoString("RunSailorComics()", 0.5);
    end
    
    DefaultOnUpdate(dt)
end

function RunSailorComics()
    local sailor_comics = CreateComics('23_SailorComics',
                                        CreateComicsFrame('Sailor', 'C_23_SAILOR_COMICS_1_SAILOR', 'Sailor', 'SailorHandEmpty'),
                                        CreateComicsFrame('Dupen',  'C_23_SAILOR_COMICS_2_DUPEN',  'body',   'head1'),
                                        CreateComicsFrame('Sailor', 'C_23_SAILOR_COMICS_3_SAILOR', 'Sailor', 'SailorHandEmpty'),
                                        CreateComicsFrame('Dupen',  'C_23_SAILOR_COMICS_4_DUPEN',  'body',   'head2'),
                                        CreateComicsFrame('Dupen',  'C_23_SAILOR_COMICS_5_DUPEN',  'body',   'head1'),
                                        CreateComicsFrame('Sailor', 'C_23_SAILOR_COMICS_7_SAILOR', 'Sailor', 'SailorHandEmpty'));
                                        
    if sailor_comics then
        sailor_comics.AddNoFadeOnFineshObject('Sailor');
        sailor_comics.AddNoFadeOnFineshObject('SailorHandEmpty');
            
        sailor_comics.on_finish = function()
            play_field:GetObject('area_sailor'):SetVisible(true);
        end
        
        sailor_comics.SetVisible(true);
    else
        play_field:GetObject('Sailor'         ):SetOpacity(1);
        play_field:GetObject('SailorHandEmpty'):SetOpacity(1);
        play_field:GetObject('area_sailor'    ):SetVisible(true);
    end
end

function RunFinalComics()
    local final_comics = CreateComics('23_FinalComics',
                                        CreateComicsFrame('Sailor', 'C_23_FINAL_1_SAILOR', 'Sailor', 'SailorHandRazor'),
                                        CreateComicsFrame('Sailor', 'C_23_FINAL_2_SAILOR', 'Sailor', 'SailorHandRazor'),
                                        CreateComicsFrame('Sailor', 'C_23_FINAL_3_SAILOR', 'Sailor', 'SailorHandRazor'),
                                        CreateComicsFrame('Sailor', 'C_23_FINAL_4_SAILOR', 'Sailor', 'SailorHandRazor'),
                                        CreateComicsFrame('Sailor', 'C_23_FINAL_5_SAILOR', 'Sailor', 'SailorHandRazor'),
                                        CreateComicsFrame('Sailor', 'C_23_FINAL_6_SAILOR', 'Sailor', 'SailorHandRazor'),
                                        CreateComicsFrame('Sailor', 'C_23_FINAL_7_SAILOR', 'Sailor', 'SailorHandRazor'),
                                        CreateComicsFrame('Sailor', 'C_23_FINAL_8_SAILOR', 'Sailor', 'SailorHandRazor'),
                                        CreateComicsFrame('Lady',   'C_23_FINAL_9_LADY',   'Lady'),
                                        CreateComicsFrame('Dupen',  'C_23_FINAL_10_DUPEN', 'body', 'head1'));

                                        
    if final_comics then
        play_field:GetObject('SailorHandEmpty'):ChangeOpacity(1, 0, ZOOM_ZONE_APPEARING_TIME);
        play_field:GetObject('Sailor'):SetOpacity(1);
        
        final_comics.on_finish = function()
            OnFinalComicsCompleted()
        end
        final_comics.SetVisible(true);
    else
        OnFinalComicsCompleted();
    end
end

function OnFinalComicsCompleted()
    game_state.parent_scene = nil;
    
    if not HasGameState('GameCompleted', 'true') then
        AddGameState('GameCompleted', 'true')
    end
    
    play_field:TimerDoString("StartLevel('data/Scenes/22_RiverPort_Main.lua');", 1);
end

function OnAllItemsFound()
    DefaultOnAllItemsFound()
end

function OnLose()
    DefaultOnLose()
end

function OnExit()
    DefaultOnExit()
end

function OnClose()
    DefaultOnClose()
end

function OnObjectMouseEnter(object)
    DefaultOnObjectMouseEnter(object)
end

function OnObjectMouseLeave(object)
    DefaultOnObjectMouseLeave(object)
end

function OnObjectMouseDown(object)
    local is_wrong_click = not DefaultOnObjectMouseDown(object)
    local obj_name = object:GetName()
    local pf = play_field

    DefaultOnObjectMouseDownProcessed(is_wrong_click);
end

function OnObjectMouseUp(object)
    DefaultOnObjectMouseUp(object)
end

function OnObjectFound(object)
    DefaultOnObjectFound(object)
end

function OnToolFound(tool)
    DefaultOnToolFound(tool)
end

function OnToolApply(tool, object)
    DefaultOnToolApply(tool, object)
end

function OnObjectReachPanel(object)
    DefaultOnObjectReachPanel(object)
end

function OnButtonPress(title)
    DefaultOnButtonPress(title)
end

function OnMouseMove(previous_pos, current_pos)
    DefaultOnMouseMove(previous_pos, current_pos)
end

function OnSetTool(tool)
    DefaultOnSetTool(tool)
end

function LevelLoaded(level)
end

function OnSceneDestroy(playfield)
    DefaultOnSceneDestroy(playfield)
end

--------------------------------------------------------------------------------
-- CLEAR_ON_SAVE_BEGIN
-- Do not edit code listed below (generated by the editor on each save)
function LoadData(screen)
	local anim = CreateAnimation('data/Texture/Scenes/23_Stateroom/Zone_main/Layers/background.jpg',0,0,1024,768,1,0)
	anim:SetHotSpot(512,384)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('background',anim,512,384,100,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/23_Stateroom/Zone_main/Layers/Layer_kettle_small.png',0,0,53,45,1,0)
	anim:SetHotSpot(26,22)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('Layer_kettle_small',anim,675,365,101,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/23_Stateroom/Zone_main/Animations/Fire_small_anim.png',0,0,41,24,20,12)
	anim:SetHotSpot(20,12)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('Fire_small_anim',anim,684,387,102,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/Common/area.png',0,0,8,8,1,0)
	anim:SetHotSpot(4,4)
	anim:SetBlendMode(2)
	anim:SetColor('0x01FFFFFF')
	screen:CreateObject('area_cage',anim,224,358,101,0,10,27)
	local anim = CreateAnimation('data/Texture/Scenes/23_Stateroom/Zone_main/Layers/Layer_barrel_1.jpg',0,0,87,76,1,0)
	anim:SetHotSpot(43,38)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('Layer_barrel_1',anim,140,604,101,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/23_Stateroom/Zone_main/Layers/Layer_barrel_2.jpg',0,0,87,76,1,0)
	anim:SetHotSpot(43,38)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('Layer_barrel_2',anim,140,604,102,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/Common/area_circle.png',0,0,128,128,1,0)
	anim:SetHotSpot(64,64)
	anim:SetBlendMode(2)
	anim:SetColor('0x01FFFFFF')
	screen:CreateObject('area_barrel1',anim,139,600,103,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/Common/area_circle.png',0,0,128,128,1,0)
	anim:SetHotSpot(64,64)
	anim:SetBlendMode(2)
	anim:SetColor('0x01FFFFFF')
	screen:CreateObject('area_barrel2',anim,139,600,103,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/Common/area_circle.png',0,0,128,128,1,0)
	anim:SetHotSpot(64,64)
	anim:SetBlendMode(2)
	anim:SetColor('0x01FFFFFF')
	screen:CreateObject('area_barrel_zoom',anim,139,600,103,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/23_Stateroom/Zone_main/Zoom_barrel/ZOOM_barrel.jpg',0,0,640,480,1,0)
	anim:SetHotSpot(320,240)
	anim:SetBlendMode(2)
	anim:SetColor('0x00FFFFFF')
	screen:CreateObject('ZOOM_barrel',anim,512,384,150,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/23_Stateroom/Zone_main/Zoom_barrel/Layer_barrel_cover.png',0,0,82,125,1,0)
	anim:SetHotSpot(41,62)
	anim:SetBlendMode(2)
	anim:SetColor('0x00FFFFFF')
	screen:CreateObject('Layer_barrel_cover',anim,509,561,152,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/23_Stateroom/Zone_main/Zoom_barrel/Layer_wrench.png',0,0,113,296,1,0)
	anim:SetHotSpot(56,148)
	anim:SetBlendMode(2)
	anim:SetColor('0x00FFFFFF')
	screen:CreateObject('Layer_wrench',anim,533,469,151,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/23_Stateroom/Zone_main/Layers/Layer_hoop1.jpg',0,0,58,58,1,0)
	anim:SetHotSpot(29,29)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('Layer_hoop1',anim,796,607,102,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/23_Stateroom/Zone_main/Layers/Layer_hoop2.jpg',0,0,58,58,1,0)
	anim:SetHotSpot(29,29)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('Layer_hoop2',anim,796,607,103,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/Common/area_circle.png',0,0,128,128,1,0)
	anim:SetHotSpot(64,64)
	anim:SetBlendMode(2)
	anim:SetColor('0x01FFFFFF')
	screen:CreateObject('area_hoop_place',anim,788,603,104,0,0.6,0.6)
	local anim = CreateAnimation('data/Texture/Scenes/Common/area_circle.png',0,0,128,128,1,0)
	anim:SetHotSpot(64,64)
	anim:SetBlendMode(2)
	anim:SetColor('0x01FFFFFF')
	screen:CreateObject('area_open_manhole',anim,826,598,105,0,1.5,1)
	local anim = CreateAnimation('data/Texture/Scenes/23_Stateroom/Zone_main/Layers/Layer_manhole_open.jpg',0,0,394,287,1,0)
	anim:SetHotSpot(197,143)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('Layer_manhole_open',anim,827,544,101,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/Common/area_circle.png',0,0,128,128,1,0)
	anim:SetHotSpot(64,64)
	anim:SetBlendMode(2)
	anim:SetColor('0x01FFFFFF')
	screen:CreateObject('area_hold',anim,820,592,106,0,2,0.8)
	local anim = CreateAnimation('data/Texture/Scenes/23_Stateroom/Zone_main/Zoom_kettle/ZOOM_kattle.jpg',0,0,640,480,1,0)
	anim:SetHotSpot(320,240)
	anim:SetBlendMode(2)
	anim:SetColor('0x00FFFFFF')
	screen:CreateObject('ZOOM_kattle',anim,512,384,160,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/Common/area_circle.png',0,0,128,128,1,0)
	anim:SetHotSpot(64,64)
	anim:SetBlendMode(2)
	anim:SetColor('0x01FFFFFF')
	screen:CreateObject('area_kettle_zoom',anim,674,399,105,0,0.8,0.8)
	local anim = CreateAnimation('data/Texture/Scenes/23_Stateroom/Zone_main/Zoom_kettle/Layer_lever.jpg',0,0,60,60,1,0)
	anim:SetHotSpot(30,30)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('Layer_lever',anim,589,549,161,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/Common/area_circle.png',0,0,128,128,1,0)
	anim:SetHotSpot(64,64)
	anim:SetBlendMode(2)
	anim:SetColor('0x01FFFFFF')
	screen:CreateObject('area_lever',anim,592,544,162,0,0.8,0.8)
	local anim = CreateAnimation('data/Texture/Scenes/23_Stateroom/Zone_main/Zoom_kettle/Animations/stove_start_anim.png',0,0,159,146,26,12)
	anim:SetHotSpot(79,73)
	anim:SetBlendMode(2)
	anim:SetColor('0x00FFFFFF')
	screen:CreateObject('stove_start_anim',anim,555,333,161,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/23_Stateroom/Zone_main/Zoom_kettle/Animations/stove_fire_anim.png',0,0,159,146,20,12)
	anim:SetHotSpot(79,73)
	anim:SetBlendMode(2)
	anim:SetColor('0x00FFFFFF')
	screen:CreateObject('stove_fire_anim',anim,555,333,162,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/23_Stateroom/Zone_main/Zoom_kettle/Animations/stove_fire2_anim.png',0,0,257,146,20,12)
	anim:SetHotSpot(128,73)
	anim:SetBlendMode(2)
	anim:SetColor('0x00FFFFFF')
	screen:CreateObject('stove_fire2_anim',anim,543,392,164,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/Common/area_circle.png',0,0,128,128,1,0)
	anim:SetHotSpot(64,64)
	anim:SetBlendMode(2)
	anim:SetColor('0x00FFFFFF')
	screen:CreateObject('area_kettle_full_apply',anim,562,337,163,0,2,2)
	local anim = CreateAnimation('data/Texture/Scenes/23_Stateroom/Zone_main/Zoom_kettle/Layer_kettle.png',0,0,242,292,1,0)
	anim:SetHotSpot(121,146)
	anim:SetBlendMode(2)
	anim:SetColor('0x00FFFFFF')
	screen:CreateObject('Layer_kettle',anim,535,337,163,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/23_Stateroom/Zone_main/Zoom_kettle/Animations/boiling_anim.png',0,0,102,44,15,12)
	anim:SetHotSpot(51,22)
	anim:SetBlendMode(2)
	anim:SetColor('0x00FFFFFF')
	screen:CreateObject('boiling_anim',anim,563,307,164,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/Common/area.png',0,0,8,8,1,0)
	anim:SetHotSpot(4,4)
	anim:SetBlendMode(2)
	anim:SetColor('0x01FFFFFF')
	screen:CreateObject('area_kettle_small_ps',anim,653,371,101,0,1,1)
	local anim = CreateAnimation('data/Texture/Characters/Lady/Lady.png',0,0,600,727,1,0)
	anim:SetHotSpot(300,363)
	anim:SetBlendMode(2)
	anim:SetColor('0x00FFFFFF')
	screen:CreateObject('Lady',anim,724,404,120,0,1,1)
	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,275,508,110,0,1,1)
	local anim = CreateAnimation('data/Texture/Characters/Dupen/head1.png',0,0,185,244,1,0)
	anim:SetHotSpot(92,122)
	anim:SetBlendMode(2)
	anim:SetColor('0x00FFFFFF')
	screen:CreateObject('head1',anim,308,202,111,0,1,1)
	local anim = CreateAnimation('data/Texture/Characters/Dupen/head2.png',0,0,214,252,1,0)
	anim:SetHotSpot(107,126)
	anim:SetBlendMode(2)
	anim:SetColor('0x00FFFFFF')
	screen:CreateObject('head2',anim,307,200,111,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/Common/area_circle.png',0,0,128,128,1,0)
	anim:SetHotSpot(64,64)
	anim:SetBlendMode(2)
	anim:SetColor('0x01FFFFFF')
	screen:CreateObject('area_mg',anim,499,414,100,0,0.8,0.8)
	local anim = CreateAnimation('data/Texture/Scenes/Common/area_circle.png',0,0,128,128,1,0)
	anim:SetHotSpot(64,64)
	anim:SetBlendMode(2)
	anim:SetColor('0x01FFFFFF')
	screen:CreateObject('area_sailor',anim,743,321,121,0,3.05,4.5)
	local anim = CreateAnimation('data/Texture/Characters/Sailor/Sailor.png',0,0,466,768,1,0)
	anim:SetHotSpot(233,384)
	anim:SetBlendMode(2)
	anim:SetColor('0x00FFFFFF')
	screen:CreateObject('Sailor',anim,700,384,120,0,1,1)
	local anim = CreateAnimation('data/Texture/Characters/Sailor/SailorHandEmpty.png',0,0,139,273,1,0)
	anim:SetHotSpot(69,136)
	anim:SetBlendMode(2)
	anim:SetColor('0x00FFFFFF')
	screen:CreateObject('SailorHandEmpty',anim,896,586,121,0,1,1)
	local anim = CreateAnimation('data/Texture/Characters/Sailor/SailorHandRazor.png',0,0,141,196,1,0)
	anim:SetHotSpot(70,98)
	anim:SetBlendMode(2)
	anim:SetColor('0x00FFFFFF')
	screen:CreateObject('SailorHandRazor',anim,901,443,122,0,1,1)
end

function FreeData(screen)
end
-- CLEAR_ON_SAVE_END
