function OnSceneLoad(screen)
    LoadData(screen)
    DefaultOnSceneLoad('data/Scenes/38_Stairway.lua', 'quest')

	LinkScene('area_39', 'CursorDoorUp', 'data/Scenes/39_Cemetery_Morning_Main.lua', false)
	LoadSound('38_Moving_gravestone', 'data/Sound/38_Stairway/Moving_gravestone.ogg')
	
	LinkScene('area_38_to_35', 'CursorDoorDown', 'data/Scenes/35_Prison_Corridor_Main.lua', false)

	zone_comb = CreateZoomZone('area_zoom',
							   'CloseZoneComb',
							   'BG_Zoom_Skull', true,
							   'Layer_Crowbar', true,
							   'Layer_Crowbar_Over', true)

	local on_click = function()
		play_field:GetObject('Layer_Crowbar'):ChangeOpacity(1., 0., 0.4)
		TimerDoString("zone_comb.SetVisible(false)", 0.7, play_field:GetTimer())
		TimerDoString("FindTool('38_crowbar')", 1.2, play_field:GetTimer())
		zone_comb.close_button:Stop()
		zone_comb.Disable()
		game_state.ignore_on_highlight['area_zoom'] = true
		play_field:GetObject('lomik'):Hide()
	end
	local on_load_when_clicked = function()
		zone_comb.Disable()
		game_state.ignore_on_highlight['area_zoom'] = true
		play_field:GetObject('lomik'):Hide()
		if not HasGameState('ToolFound', '38_crowbar') then
			FindTool('38_crowbar')
		end
	end
	RegisterActiveObject('Layer_Crowbar', on_click, on_load_when_clicked)
	--RegisterToolFindInfo('38_crowbar', 'Layer_Crowbar', on_find, on_load_when_tool_found)

	local on_apply = function()
		play_field:GetObject('Mogila_Dark'):ChangeOpacity(1, 0, 0.5)
		play_field:GetObject('area_tool'):Hide()
		MakeSoundEntity('38_Moving_gravestone'):Play(false);
		
		TimerDoString("ShowMonolog('C_38_GRAVESTONE_OPEN', 'C_38_GRAVESTONE_OPEN');",
		              1.5, play_field:GetTimer());
	end
	local on_load_when_applied = function()
		play_field:GetObject('Mogila_Dark'):SetOpacity(0)
		play_field:GetObject('area_tool'):Hide()
	end
	RegisterToolApplyInfo('38_crowbar', 'area_tool', nil, nil, on_apply, on_load_when_applied)
	RegisterMonologObject('area_tool', 'C_38_GRAVESTONE_CLOSED')
	
	if HasGameState('TaskCompleted', '39_FreeBoy') then
		game_state.ignore_on_highlight['area_39'] = true
	end
end

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

function OnUpdate(dt)
    DefaultOnUpdate(dt)
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/38_Stairway/Layers/Mogila_Dark.jpg',0,0,1024,768,1,0)
	anim:SetHotSpot(512,384)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('Mogila_Dark',anim,512,384,40,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/38_Stairway/Layers/Mogila_Light.jpg',0,0,1024,768,1,0)
	anim:SetHotSpot(512,384)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('Mogila_Light',anim,512,384,38,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_39',anim,664,89,39,0,30,13)
	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_tool',anim,664,89,100,0,30,13)
	local anim = CreateAnimation('data/Texture/Scenes/38_Stairway/Zoom_Skull/BG_Zoom_Skull.jpg',0,0,640,480,1,0)
	anim:SetHotSpot(320,240)
	anim:SetBlendMode(2)
	anim:SetColor('0x00FFFFFF')
	screen:CreateObject('BG_Zoom_Skull',anim,512,384,150,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/38_Stairway/Zoom_Skull/Layer_Crowbar.PNG',0,0,333,135,1,0)
	anim:SetHotSpot(166,67)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('Layer_Crowbar',anim,449,424,152,0,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/38_Stairway/Zoom_Skull/Layer_Crowbar_Over.PNG',0,0,208,96,1,0)
	anim:SetHotSpot(104,48)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('Layer_Crowbar_Over',anim,410,444,153,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_zoom',anim,320,595,100,315,30,20)
	local anim = CreateAnimation('data/Texture/Scenes/38_Stairway/Layers/lomik.png',0,0,150,33,1,0)
	anim:SetHotSpot(75,16)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('lomik',anim,334,537,90,345,1,1)
	local anim = CreateAnimation('data/Texture/Scenes/38_Stairway/Layers/sprajt_lomika.png',0,0,69,49,1,0)
	anim:SetHotSpot(34,24)
	anim:SetBlendMode(2)
	anim:SetColor('0xFFFFFFFF')
	screen:CreateObject('sprajt_lomika',anim,323,543,95,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_38_to_35',anim,507,699,100,0,120,19)
end

function FreeData(screen)
end
-- CLEAR_ON_SAVE_END
