class 'l_10_Dead_ship_shore' (PlayField)

function l_10_Dead_ship_shore:__init(game_scene, name, path)
	PlayField.__init(self, game_scene, name, path)

	-- tool register 
	local tool_note 				= '09_treasure_note'
	local tool_eagle_2 				= '15_golden_eagle_2'
	local tool_bag_of_gold 			= '10_bag_of_gold'
	local tool_charged_hourglass 	= '33_charged_hourglass'
	local tool_shacklers 			= '21_shacklers'

	-- link register 
	self:linkScene('area_link_06',	'CursorDown',	'06_Town')
	self:linkScene('area_link_16',	'CursorUp',		'16_Forest_path')
	--self:linkScene('area_link_15',	'CursorUp',		'15_Old_ship')
	self:linkScene('area_link_11',	'CursorUp',		'11_Drawbridge')

	self:linkScene('area_link_ho',   'CursorEye',    '10_Dead_ship_shore_HO')

	-- zoom register
	self.zoom_boat = self:createZoomZone('Boat')
	self.zoom_Cauldron = self:createZoomZone('Cauldron')
	self.zoom_treasure_spot = self:createZoomZone('Treasure_spot')
	
	-- Hide object 
	self:entityHide('area_link_16', 'area_zoom_Treasure_spot', 'area_click_forrest_block', 'area_apply_tools')


	-- end of survey ----------------------------------------------------
	do
	    if not HasGameState('06_Cantelllo_scorch_03') then		
			local function on_end_cutscene_3()
				--self:showBlackBar('BBT_06_CANTELLLO_SCORCH_3')				
				self:getPanel():setMode(EPanelMode.CUTSCENE)
			    self.timer:add(function()
			    		self.mouseBlocker:pop()
			            showSurveyDialog()
			        end, 0.5)					
			end 

			SetGameState('06_Cantelllo_scorch_03', 'true')
			local furry_cutscene = createVideo({video = 'furry_grandFather_cutscene', sound = 'furry_grandFather_cutscene', scale = 1.51, order = 600, x = 512, y = 384, isLooped = false, isAlpha = false})
			self:startCutScene(furry_cutscene, on_end_cutscene_3, nil)	
			self.mouseBlocker:push()

			local subtitles_1 = nil
			subtitles_1 = Subtitles(current_scene:getPanel())
			subtitles_1:pushReplic('SUB_10_FURY_SPEAK_1_1', 3, 3, true)
			subtitles_1:pushReplic('SUB_10_FURY_SPEAK_1_2', 7, 3, true)

			subtitles_1:play()
			furry_cutscene.onFinish:add( function()
									  	 	subtitles_1:destroy()                                 
									     end)	
		else
			self.mouseBlocker:push()
			self.timer:add( function()
								self.mouseBlocker:pop()
					            showSurveyDialog()
					        end, 0)			
		end
	end
	-----------------------------------------------------------------------

	-- reopen HO ------------------------------------------------------------
	if IsToolApplied('15_door_handle') then
		reopenScene('10_Dead_ship_shore_HO')
	end
	-------------------------------------------------------------------------
		
	-- When returning from 35 locations with tool 15_golden_eagle_2 ----------------
	if IsToolFound(tool_eagle_2) and not HasGameState('Open_Forrest', 'true') then
		self:entityShow('area_click_forrest_block')
		--анимация Молинари заманивает в лабиринт в лес ---
		AddUniqueGameState('Open_Forrest', 'true');
	end

	-- click forrest ------------------------------------------------------
	do   
		local function on_click_forrest(e)
			self:entityHide(e.target)
			self:entityShow('area_link_16')
		end
		self:registerActiveObject('area_click_forrest_block', on_click_forrest)
	end 
	-----------------------------------------------------------------------

	-- When returning from 35 locations  ------------------------------------------
	if  isSceneVisited('35_River') then
		--Cantello animation --
		self:entityShow('area_apply_tools')
	end

	-- apply tool ---------------------------------------------------------
	do  
		local counter = 2
		local function on_apply_tools(e)
			
			if e.toolName == tool_charged_hourglass then
				counter = counter - 1 
				
				if not e.save then
				else
				end			

			elseif e.toolName == tool_shacklers then
				counter = counter - 1
				
				if not e.save then
				else
				end					
			end
			
			if counter == 0 then
				self:entityHide('area_apply_tools')
				--Cantello animation--
			else
				self:getEntityNamed('area_apply_tools'):setCursorOverName('CursorGlass')
			end 	
		end
		self:registerToolApplyInfo(tool_charged_hourglass, 'area_apply_tools', on_apply_tools, 'BBT_10_NEED_TOOLS')
		self:registerToolApplyInfo(tool_shacklers, 'area_apply_tools', on_apply_tools, 'BBT_10_NEED_TOOLS')
	end 	
	-----------------------------------------------------------------------

	-- apply note ---------------------------------------------------------
	do  
		local function on_apply_note(e) 
			self:entityHide(e.target)
			self:entityShow('area_zoom_Treasure_spot')
		end
		self:registerToolApplyInfo(tool_note, 'area_apply_treasure_location_note', on_apply_note, 'BBT_10_NEED_TREASURE_LOCATION_NOTE')
	end 	
	-----------------------------------------------------------------------

	-- if mini game completed ---------------------------------------------
	do 
		if isMiniGameCompleted('10_Chest') then 
			self:findTool(tool_bag_of_gold)
			self.zoom_treasure_spot:closeAndDisable()
		end   	
	end
	-----------------------------------------------------------------------
end

--------------------------------------------------------------------------------
--                      GENERATED CONTENT. DO NOT EDIT.                       --
--------------------------------------------------------------------------------

function l_10_Dead_ship_shore:CreateLoaderTable()
	local objects =
	{
		{ name = 'area_link_06',  entityType = 'SpriteEntity',  x = 512,  y = 718,  order = 100,  scaleX = 11,  scaleY = 2,  color = {r = 1, g = 1, b = 1, a = 0.00392157},  editingLocked = true,  treeItemIsExpanded = true,  width = 100,  height = 100,  },
		{ name = 'area_link_11',  entityType = 'SpriteEntity',  x = 827,  y = 291,  order = 100,  scaleX = 12,  scaleY = 14,  color = {r = 1, g = 1, b = 1, a = 0.00392157},  editingLocked = true,  treeItemIsExpanded = true,  width = 10,  height = 10,  },
		{ name = 'area_link_15',  entityType = 'SpriteEntity',  x = 242,  y = 309,  order = 100,  isVisible = false,  scale = 14,  color = {r = 1, g = 1, b = 1, a = 0.00392157},  editingLocked = true,  treeItemIsExpanded = true,  width = 10,  height = 10,  },
		{ name = 'area_link_16',  entityType = 'SpriteEntity',  x = 992,  y = 387,  order = 100,  scaleX = 12,  scaleY = 14,  color = {r = 1, g = 1, b = 1, a = 0.00392157},  editingLocked = false,  treeItemIsExpanded = true,  width = 10,  height = 10,  },
		{ name = 'bg',  entityType = 'SpriteEntity',  x = 512,  y = 384,  order = 0,  editingLocked = false,  treeItemIsExpanded = true,  texturePath = 'Data/Textures/Scenes/10_Dead_ship_shore/layers/bg.JPG',  width = 1366,  height = 768,  },
		{ name = 'area_zoom_Cauldron',  entityType = 'SpriteEntity',  x = 116,  y = 567,  order = 100,  scaleX = 14,  scaleY = 16,  color = {r = 1, g = 1, b = 1, a = 0.00392157},  editingLocked = true,  treeItemIsExpanded = true,  width = 10,  height = 10,  },
		{ name = 'area_zoom_Boat',  entityType = 'SpriteEntity',  x = 371,  y = 439,  order = 100,  scaleX = 16,  scaleY = 12,  color = {r = 1, g = 1, b = 1, a = 0.00392157},  editingLocked = true,  treeItemIsExpanded = true,  width = 10,  height = 10,  },
		{ name = 'area_zoom_Treasure_spot',  entityType = 'SpriteEntity',  x = 572,  y = 471,  order = 100,  isVisible = false,  scaleX = 16,  scaleY = 12,  color = {r = 1, g = 1, b = 1, a = 0.00392157},  editingLocked = true,  treeItemIsExpanded = true,  width = 10,  height = 10,  },
		{ name = 'area_apply_treasure_location_note',  entityType = 'SpriteEntity',  x = 589,  y = 461,  order = 90,  scaleX = 20,  scaleY = 12,  color = {r = 1, g = 1, b = 1, a = 0.00392157},  editingLocked = true,  treeItemIsExpanded = true,  width = 10,  height = 10,  },
		{ name = 'area_click_forrest_block',  entityType = 'SpriteEntity',  x = 512,  y = 384,  order = 100,  isVisible = false,  scaleX = 138,  scaleY = 78,  color = {r = 1, g = 1, b = 1, a = 0.00392157},  editingLocked = true,  treeItemIsExpanded = true,  width = 10,  height = 10,  },
		{ name = 'area_apply_tools',  entityType = 'SpriteEntity',  x = 851.379,  y = 483.857,  order = 90,  scaleX = 20,  scaleY = 12,  color = {r = 1, g = 1, b = 1, a = 0.00392157},  editingLocked = false,  treeItemIsExpanded = true,  hotSpot = {x = 3.83334, y = 5},  width = 8,  height = 10,  },
		{ name = 'area_link_ho',  entityType = 'SpriteEntity',  x = 548.373,  y = 256.732,  order = 90,  color = {r = 1, g = 1, b = 1, a = 0.00392157},  editingLocked = false,  treeItemIsExpanded = true,  hotSpot = {x = 153, y = 107},  width = 300,  height = 200,  },
		{ name = '10_Dead_ship_shore_Anim_Bg',  entityType = 'CompositionContainer',  x = -171,  y = 0,  order = 1,  isRespondable = false,  editingLocked = false,  treeItemIsExpanded = true,  path = 'Data/Scripts/Scenes/10_Dead_ship_shore/Anim/10_Dead_ship_shore_Anim_Bg.lua',  },
		{ name = '06_vortex',  entityType = 'VideoEntity',  parentName = '10_Dead_ship_shore_Anim_Bg',  x = 757,  y = 130,  order = 0,  isRespondable = false,  scale = 2,  editingLocked = false,  treeItemIsExpanded = false,  path = 'Data/Video/Scenes/10_Dead_ship_shore/06_vortex.webm',  hotSpot = {x = 188, y = 72},  hasAlpha = true,  isLooped = true,  fps = 24,  },
		{ name = 'compositionBG',  entityType = 'CompositionSequence',  parentName = '10_Dead_ship_shore_Anim_Bg',  x = 0,  y = 0,  order = 0,  isRespondable = false,  editingLocked = false,  treeItemIsExpanded = false,  isCyclic = true,  speed = 1,  },
	}
	return objects
end
