---------------------------------------------------------------------------------------------------
--  Copyright © 2009 PoBros, Incorporated. All Rights Reserved.
--
--  This source code is the proprietary confidential property of PoBros Incorporated.
--  Modification, reproduction, publication, or distribution in any form to any party 
--  other than the licensee is strictly prohibited.
--
--  FOR USE BY AUTHORIZED PERSONS ONLY
---------------------------------------------------------------------------------------------------

require( "scripts/style.lua" );

local yoffset = 0;

dialogs =
{
	chest_dialog_intro =
	{
		name = "chest_dialog_intro";
		image = "autumn_thoughtful";
		sound = "autumn_arrange_these_pieces_easy";
		text = "autumn_arrange_these_pieces_easy";
	};
	
	chest_dialog_oncomplete =
	{
		name = "chest_dialog_oncomplete";
		image = "autumn_amused";
		sound = "autumn_come_to_mama";
		text = "autumn_come_to_mama";
	};
};

---------------------------------------------------------------------------------------------------

MakeDialog
{
	SetStyle( MinigameJigsawStyle );
	
	MinigameChest
	{
		name = "chest";
		lockcorrectpieces = false;
		lockinitialpieces = true;
		returnpieceonmiss = true;
		timetoholdpiece = 350;
		skippiecedelay = 50;
		
		layers =
		{
			bottom =
			{
				image = "minigames/chest/bottom";
				x = 125;
				y = 350 + yoffset;
			};
			
			animation =
			{
				image = "minigames/chest/animation";
				x = 171;
				y = 20 + yoffset;
				flags = kHAlignLeft + kVAlignTop;
				framespeed = 100;
				animation = "once";
				crossfade = false;
				xcenter = 0;
				ycenter = 0;
			};
		};
		
		windowsprite =
		{
			sprite = "minigames/chest/background";
			xcenter = 400;
			ycenter = 300 - yoffset;
		};
		
		playfield =
		{
			field =
			{
				x = 160;
				y = 20 + yoffset;
				w = 475;
				h = 225;
			};
		};

		soundend =
		{
			name = "complete";
			loop = false;
			initialdelay = 0;
			delay = 0;
			sounds = gs_soundMetalGearsTurning;
		};
		
		pieces =
		{
			piece00 = { x = 510; y = 360 + yoffset; index = 0; };
			piece01 = { x = 225; y = 355 + yoffset; index = 1; };
			piece02 = { x = 085; y = 155 + yoffset; index = 2; };
			piece03 = { x = 340; y = 410 + yoffset; index = 3; };
			piece04 = { x = 085; y = 350 + yoffset; index = 4; };
			piece05 = { x = 685; y = 355 + yoffset; index = 5; };
			piece06 = { x = 720; y = 135 + yoffset; index = 6; };
			piece07 = { x = 610; y = 410 + yoffset; index = 7; };
		};
		
		slots =
		{
			slot00 = { x = 228; y = 133 + yoffset; index = {0;4;}; startindex = -1; correctindex = { 0; } };
			slot01 = { x = 284; y = 077 + yoffset; index = {1;5;}; startindex = -1; correctindex = { 1; } };
			slot02 = { x = 340; y = 133 + yoffset; index = {2;6;}; startindex = -1; correctindex = { 2; } };
			slot03 = { x = 284; y = 189 + yoffset; index = {3;7;}; startindex = -1; correctindex = { 3; } };
			slot04 = { x = 453; y = 133 + yoffset; index = {0;4;}; startindex = -1; correctindex = { 4; } };
			slot05 = { x = 509; y = 077 + yoffset; index = {1;5;}; startindex = -1; correctindex = { 5; } };
			slot06 = { x = 565; y = 133 + yoffset; index = {2;6;}; startindex = -1; correctindex = { 6; } };
			slot07 = { x = 509; y = 189 + yoffset; index = {3;7;}; startindex = -1; correctindex = { 7; } };
		};
		
		pieceinfo =
		{
			movetime = 200;
			maxalphahilight = 0.3;
			minalphahilight = 0.1;
			timehilight = 400;
			hidewheninslot = false;
			image = "minigames/chest/pieces";
		};
		
		slotinfo =
		{
			validdistance = 30;
			rejectincorrectpieces = false;
			allowmultiplepieces = false;
		};
	
		MinigameButtons();
		AddMinigameTutorial( 400, 300, "chesttutorial", "tutorial", -1 );
	};
};

---------------------------------------------------------------------------------------------------
