---------------------------------------------------------------------------------------------------
--  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 =
{
	jar_dialog_intro =
	{
		name = "jar_dialog_intro";
		image = "autumn_thoughtful";
		sound = "autumn_appears_need_pieces";
		text = "autumn_appears_need_pieces";
	};
	
	jar_dialog_oncomplete =
	{
		name = "jar_dialog_oncomplete";
		image = "autumn_amused";
		sound = "autumn_unlocked_the_mechanism";
		text = "autumn_unlocked_the_mechanism";
	};
};

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

MakeDialog
{
	SetStyle( MinigameJigsawStyle );
	
	MinigameJar
	{
		name = "jar";
		lockcorrectpieces = true;
		lockinitialpieces = false;
		returnpiecesonmiss = true;
		slotpiecespritecollision = true;
		timetoholdpiece = 350;
		skippiecedelay = 50;
		introslidetime = 500;
		introslidetimedelay = 50;
		introslidedistance = 300;
		
		windowsprite =
		{
			sprite = "minigames/jar/background";
			xcenter = 400;
			ycenter = 300 - yoffset;
		};
		
		playfield =
		{
			field =
			{
				x = 200;
				y = yoffset;
				w = 415;
				h = 355;
			};
		};

		pieces =
		{
			piece00 = { x = 650; y = 440 + yoffset; index = 0; };
			piece01 = { x = 151; y = 407 + yoffset; index = 1; };
			piece02 = { x = 130; y = 162 + yoffset; index = 2; };
			piece03 = { x = 54; y = 288 + yoffset; index = 3; };
			piece04 = { x = 57; y = 436 + yoffset; index = 4; };
			piece05 = { x = 29; y = 366 + yoffset; index = 5; };
			piece06 = { x = 40; y = 223 + yoffset; index = 6; };
			piece07 = { x = 107; y = 252 + yoffset; index = 7; };
			piece08 = { x = 62; y = 154 + yoffset; index = 8; };
			piece09 = { x = 204; y = 451 + yoffset; index = 9; };
			piece10 = { x = 659; y = 350 + yoffset; index = 10; };
			piece11 = { x = 715; y = 418 + yoffset; index = 11; };
		};
		
		slots =
		{
			slot00 = { x = 410; y = 39 + yoffset; sprite = { image = "minigames/jar/slot00"; }; index = { 6; }; startindex = -1; };
			slot01 = { x = 293; y = 148 + yoffset; sprite = { image = "minigames/jar/slot01"; }; index = { 4; }; startindex = -1; };
			slot02 = { x = 528; y = 150 + yoffset; sprite = { image = "minigames/jar/slot02"; }; index = { 2; }; startindex = -1; };
			slot03 = { x = 412; y = 272 + yoffset; sprite = { image = "minigames/jar/slot03"; }; index = { 1; }; startindex = -1; };
		};

		pieceinfo =
		{
			movetime = 200;
			maxalphahilight = 0.3;
			minalphahilight = 0.1;
			timehilight = 400;
			hidewheninslot = true;
			image = "minigames/jar/pieces";
		};
		
		slotinfo =
		{
			validdistance = 0;
			rejectincorrectpieces = true;
			allowmultiplepieces = false;
			pieceholdtimefade = 300;
		};
		
		MinigameButtons();
		AddMinigameTutorial( 400, 300, "jartutorial", "tutorial", -1 );
	};
};

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