"use strict";

var DEFINE_DIALOGUE_BOX_GRACE = {
	x: 64,
	y: 8,
	width:32,
	height:1
}

DATA_SDS_DIALOGUE["Grace_c2_leaving_0"]=
	{ 
		x: DEFINE_DIALOGUE_BOX_UPPER.x,
		y: DEFINE_DIALOGUE_BOX_UPPER.y,
		width: DEFINE_DIALOGUE_BOX_UPPER.width,
		height: DEFINE_DIALOGUE_BOX_UPPER.height,
		pauses: false,
		blocks: true,
		title: "[child]",
		script: [
			{command:"buffer", text:"Woooooo~~~w!\n"},			//0
			{command:"wait"},
			{command:"clear"},
			{command:"buffer", text:"You're strong, lady!  D'you have gramma's bracelets?  How'd you get gramma's bracelets?  Are you a good person?  Are you, like, some kind of hero?!  Can you help my mommy?  'Cuz we were down in the Not'lus an'... an' then everything shook an' there was smoke an' mommy got scared and told me to go outside even though I wasn't scared but there was smoke outside an' the fish tried to eat me but I was too fast an' mommy wanted to warn the village but the gate was closed an' then... an'... an' so mommy wanted to warn the man at the shrine in the forest but that's up on land but sometimes mommy can go on land an' that's OK because of the necklace but she didn't have it because of the smoke an' there were ghosts but my friend's a ghost but she wouldn't listen an' so she went to talk to the monkeys but I'm not allowed out of the water an' then there was a big crash an' mommy's on the beach an' there's a tree an' I need to \"tell those lazy oafs Fed an' Ned to come help.\"  What's a \"oaf\"?  Is that like bread?  Mommy brought me bread from the land people town an' it was tasty but I don't think that's what mommy needs because I don't think trees eat bread but if she hit her head she might think they do the gate was closed anyway so I couldn't get in an' then uncle Guy got mad an' I was really scareded an' I ran away but the Not'lus is locked an' mommy has the key but there's the tree an'... an' so I couldn't an' so I came back but the gate was still closed but then you broke it but that's why I think you're special because when I break things mommy gets angry but you broke things an' gramma still gave you her bracelets so you must be a good person so can you help pleeeee~~~ase?\n"},
			{command:"chooseV", choices:{"...what?":5, "You bet!":12}},	
			{command:"clear"},
			{command:"buffer", text:"The tree, duh!\n"},
			{command:"chooseV", choices:{"...what?":8, "Oh, right.":12}},
			{command:"clear"},
			{command:"buffer", text:"Geeez, grown-ups are soooo stupid!  Just follow me already!\n"},
			{command:"wait"},	
			{command:"return", retval:0},
			{command:"clear"},
			{command:"buffer", text:"Yaaaa~~~y!  My name's Gracie!  What's your name?  Are you fast?  Follow me!  Hurry!\n"},	
			{command:"wait"},
			{command:"return", retval:0},
		] // an array of options/commands which will be evaluated in sequence
	};

DATA_SDS_DIALOGUE["Grace_c2_gracie_0"]=
	{ 
		x: DEFINE_DIALOGUE_BOX_UPPER.x,
		y: DEFINE_DIALOGUE_BOX_UPPER.y,
		width: DEFINE_DIALOGUE_BOX_UPPER.width,
		height: DEFINE_DIALOGUE_BOX_UPPER.height,
		pauses: false,
		blocks: true,
		title: "Grace",
		script: [
			{command:"buffer", text:"Come ooooon!  Hurry!\n"},			//0
			{command:"wait"},
			{command:"return", retval:0},
		] // an array of options/commands which will be evaluated in sequence
	};

DATA_SDS_DIALOGUE["Grace_c2_melody_offer"]=
	{ 
		x: DEFINE_DIALOGUE_BOX_LOWER.x,
		y: DEFINE_DIALOGUE_BOX_LOWER.y,
		width: DEFINE_DIALOGUE_BOX_LOWER.width,
		height: DEFINE_DIALOGUE_BOX_LOWER.height,
		pauses: false,
		blocks: true,
		title: "Grace",
		script: [
			{command:"buffer", text:"Ooh!  Mom!  Mommy!  I know the Not'lus like really really really well an' my friend lives there an' I'm not afraid of the dark an' I wanna go see her an' she doesn't I mean miss I don't know your name doesn't know the Not'lus an' an' so I wanna go with her can I pleeeeeease?\n"},			//0
			{command:"chooseV", choices:{"Um...":2, "I... er...":2}},
			{command:"return", retval:0},
		] // an array of options/commands which will be evaluated in sequence
	};

DATA_SDS_DIALOGUE["Grace_c2_melody_0"]=
	{ 
		x: DEFINE_DIALOGUE_BOX_UPPER.x,
		y: DEFINE_DIALOGUE_BOX_UPPER.y,
		width: DEFINE_DIALOGUE_BOX_UPPER.width,
		height: DEFINE_DIALOGUE_BOX_UPPER.height,
		pauses: false,
		blocks: true,
		title: "Grace",
		script: [
			{command:"buffer", text:"This way!  This way!\n"},			//0
			{command:"wait"},
			{command:"return", retval:0},
		] // an array of options/commands which will be evaluated in sequence
	};

DATA_SDS_DIALOGUE["Grace_c2_portal"]=
	{ 
		x: DEFINE_DIALOGUE_BOX_UPPER.x,
		y: DEFINE_DIALOGUE_BOX_UPPER.y,
		width: DEFINE_DIALOGUE_BOX_UPPER.width,
		height: DEFINE_DIALOGUE_BOX_UPPER.height,
		pauses: false,
		blocks: true,
		title: "Grace",
		script: [
			{command:"buffer", text:"Huh?  There's supposed to be a hole down here!  Right under where that big shiny thing is!\n"},			//0
			{command:"wait"},
			{command:"buffer", text:"Um...\n"},
			{command:"wait"},
			{command:"buffer", text:"Actually... I think there also isn't usually a big shiny thing here...  What is it?\n"},
			{command:"wait"},
			{command:"buffer", text:"Looks kinda like a hole or something...  Wanna go inside?\n"},
			{command:"wait"},
			{command:"return", retval:0},
		] // an array of options/commands which will be evaluated in sequence
	};

DATA_SDS_DIALOGUE["Grace_c2_roadblock"]=
	{ 
		x: DEFINE_DIALOGUE_BOX_UPPER.x,
		y: DEFINE_DIALOGUE_BOX_UPPER.y,
		width: DEFINE_DIALOGUE_BOX_UPPER.width,
		height: DEFINE_DIALOGUE_BOX_UPPER.height,
		pauses: false,
		blocks: true,
		title: "Grace",
		script: [
			{command:"buffer", text:"Um... um... um... lady?\n"},			//0
			{command:"wait"},
			{command:"clear"},
			{command:"buffer", text:"I... um...  I think I'm lost...\n"},
			{command:"wait"},
			{command:"buffer", text:"There isn't S'POSED to be a big wall here!  I can only show you where to go when the room's what it's s'posed to be!\n"},
			{command:"wait"},
			{command:"buffer", text:"Maybe there's another way around?\n"},
			{command:"wait"},
			{command:"return", retval:0},
		] // an array of options/commands which will be evaluated in sequence
	};

DATA_SDS_DIALOGUE["Grace_c2_meetpaola_0"]=
	{ 
		x: DEFINE_DIALOGUE_BOX_LOWER.x,
		y: DEFINE_DIALOGUE_BOX_LOWER.y,
		width: DEFINE_DIALOGUE_BOX_LOWER.width,
		height: DEFINE_DIALOGUE_BOX_LOWER.height,
		pauses: false,
		blocks: true,
		title: "Grace",
		script: [
			{command:"buffer", text:"But... P'olly!  Mom says I can't come here any more 'cuz of the smoke an' the dark!\n"},			//0
			{command:"wait"},
			{command:"return", retval:0},
		] // an array of options/commands which will be evaluated in sequence
	};

DATA_SDS_DIALOGUE["Grace_c2_meetpaola_1"]=
	{ 
		x: DEFINE_DIALOGUE_BOX_LOWER.x,
		y: DEFINE_DIALOGUE_BOX_LOWER.y,
		width: DEFINE_DIALOGUE_BOX_LOWER.width,
		height: DEFINE_DIALOGUE_BOX_LOWER.height,
		pauses: false,
		blocks: true,
		title: "Grace",
		script: [
			{command:"buffer", text:"P'ollyyyy!  I like you bestest!  You're my favorite dead person ever!\n"},			//0
			{command:"wait"},
			{command:"return", retval:0},
		] // an array of options/commands which will be evaluated in sequence
	};

DATA_SDS_DIALOGUE["Grace_c2_meetpaola_2"]=
	{ 
		x: DEFINE_DIALOGUE_BOX_LOWER.x,
		y: DEFINE_DIALOGUE_BOX_LOWER.y,
		width: DEFINE_DIALOGUE_BOX_LOWER.width,
		height: DEFINE_DIALOGUE_BOX_LOWER.height,
		pauses: false,
		blocks: true,
		title: "Grace",
		script: [
			{command:"buffer", text:"She's not my friend!\n"},			//0
			{command:"wait"},
			{command:"clear"},
			{command:"buffer", text:"I mean... she's kinda like my friend, I guess... but I don't play with her like you!  She's just looking for the Necklace and I'm helpin' her!\n"},
			{command:"wait"},
			{command:"return", retval:0},
		] // an array of options/commands which will be evaluated in sequence
	};

DATA_SDS_DIALOGUE["Grace_c2_meetpaola_3"]=
	{ 
		x: DEFINE_DIALOGUE_BOX_LOWER.x,
		y: DEFINE_DIALOGUE_BOX_LOWER.y,
		width: DEFINE_DIALOGUE_BOX_LOWER.width,
		height: DEFINE_DIALOGUE_BOX_LOWER.height,
		pauses: false,
		blocks: true,
		title: "Grace",
		script: [
			{command:"buffer", text:"But P'ollyyyyyyyyy!!!\n"},			//0
			{command:"wait"},
			{command:"return", retval:0},
		] // an array of options/commands which will be evaluated in sequence
	};

DATA_SDS_DIALOGUE["Grace_c2_hp_5"]=
	{ 
		x: DEFINE_DIALOGUE_BOX_GRACE.x,
		y: DEFINE_DIALOGUE_BOX_GRACE.y,
		width: DEFINE_DIALOGUE_BOX_GRACE.width,
		height: DEFINE_DIALOGUE_BOX_GRACE.height,
		pauses: false,
		blocks: false,
		title: null,
		script: [
			{command:"buffer", text:"Gracie's energized! [*****]"},			//0
			{command:"pause", frames:90},
			{command:"return", retval:0},
		] // an array of options/commands which will be evaluated in sequence
	};
DATA_SDS_DIALOGUE["Grace_c2_hp_4"]=
	{ 
		x: DEFINE_DIALOGUE_BOX_GRACE.x,
		y: DEFINE_DIALOGUE_BOX_GRACE.y,
		width: DEFINE_DIALOGUE_BOX_GRACE.width,
		height: DEFINE_DIALOGUE_BOX_GRACE.height,
		pauses: false,
		blocks: false,
		title: null,
		script: [
			{command:"buffer", text:"Gracie's startled! [**** ]"},			//0
			{command:"pause", frames:90},
			{command:"return", retval:0},
		] // an array of options/commands which will be evaluated in sequence
	};
DATA_SDS_DIALOGUE["Grace_c2_hp_3"]=
	{ 
		x: DEFINE_DIALOGUE_BOX_GRACE.x,
		y: DEFINE_DIALOGUE_BOX_GRACE.y,
		width: DEFINE_DIALOGUE_BOX_GRACE.width,
		height: DEFINE_DIALOGUE_BOX_GRACE.height,
		pauses: false,
		blocks: false,
		title: null,
		script: [
			{command:"buffer", text:"Gracie's spooked! [***  ]"},			//0
			{command:"pause", frames:90},
			{command:"return", retval:0},
		] // an array of options/commands which will be evaluated in sequence
	};
DATA_SDS_DIALOGUE["Grace_c2_hp_2"]=
	{ 
		x: DEFINE_DIALOGUE_BOX_GRACE.x,
		y: DEFINE_DIALOGUE_BOX_GRACE.y,
		width: DEFINE_DIALOGUE_BOX_GRACE.width,
		height: DEFINE_DIALOGUE_BOX_GRACE.height,
		pauses: false,
		blocks: false,
		title: null,
		script: [
			{command:"buffer", text:"Gracie's terrified! [**   ]"},			//0
			{command:"pause", frames:90},
			{command:"return", retval:0},
		] // an array of options/commands which will be evaluated in sequence
	};
DATA_SDS_DIALOGUE["Grace_c2_hp_1"]=
	{ 
		x: DEFINE_DIALOGUE_BOX_GRACE.x,
		y: DEFINE_DIALOGUE_BOX_GRACE.y,
		width: DEFINE_DIALOGUE_BOX_GRACE.width,
		height: DEFINE_DIALOGUE_BOX_GRACE.height,
		pauses: false,
		blocks: false,
		title: null,
		script: [
			{command:"buffer", text:"Gracie's traumatized! [*    ]"},			//0
			{command:"pause", frames:90},
			{command:"return", retval:0},
		] // an array of options/commands which will be evaluated in sequence
	};
DATA_SDS_DIALOGUE["Grace_c2_hp_0"]=
	{ 
		x: DEFINE_DIALOGUE_BOX_GRACE.x,
		y: DEFINE_DIALOGUE_BOX_GRACE.y,
		width: DEFINE_DIALOGUE_BOX_GRACE.width,
		height: DEFINE_DIALOGUE_BOX_GRACE.height,
		pauses: false,
		blocks: false,
		title: null,
		script: [
			{command:"buffer", text:"Gracie died of shock... [     ]"},			//0
			{command:"pause", frames:90},
			{command:"return", retval:0},
		] // an array of options/commands which will be evaluated in sequence
	};

DATA_SDS_DIALOGUE["Grace_c2_jobdone"]=
	{ 
		x: DEFINE_DIALOGUE_BOX_UPPER.x,
		y: DEFINE_DIALOGUE_BOX_UPPER.y,
		width: DEFINE_DIALOGUE_BOX_UPPER.width,
		height: DEFINE_DIALOGUE_BOX_UPPER.height,
		pauses: false,
		blocks: true,
		title: "Grace",
		script: [
			{command:"buffer", text:"Yay!  Thanks P'olly, wherev'ya are!\n"},			//0
			{command:"wait"},
			{command:"buffer", text:"I'm'a go home now, Mom's prolly worried about me and everything but thanks for lettin' me come along an' playin' with P'olly an' you should come by some time b'cause we're like bestest friends now right?  Come on!\n"},
			{command:"wait"},
			{command:"return", retval:0},
		] // an array of options/commands which will be evaluated in sequence
	};

DATA_SDS_DIALOGUE["Grace_c2_bossgood_0"]=
	{ 
		x: DEFINE_DIALOGUE_BOX_UPPER.x,
		y: DEFINE_DIALOGUE_BOX_UPPER.y,
		width: DEFINE_DIALOGUE_BOX_UPPER.width,
		height: DEFINE_DIALOGUE_BOX_UPPER.height,
		pauses: false,
		blocks: true,
		title: "Grace",
		script: [
			{command:"buffer", text:"Hello lady!  Thanks for bein' so fun!  I never get to do that stuff with mom anymore!\n"},			//0
			{command:"wait"},
			{command:"return", retval:0},
		] // an array of options/commands which will be evaluated in sequence
	};

DATA_SDS_DIALOGUE["Grace_c2_bossgood_1"]=
	{ 
		x: DEFINE_DIALOGUE_BOX_UPPER.x,
		y: DEFINE_DIALOGUE_BOX_UPPER.y,
		width: DEFINE_DIALOGUE_BOX_UPPER.width,
		height: DEFINE_DIALOGUE_BOX_UPPER.height,
		pauses: false,
		blocks: true,
		title: "Grace",
		script: [
			{command:"buffer", text:"When you're up on land, see if you can find any sailors whinin' inta bottles!  Mom keeps lookin' at me and sayin' she wants some, but I don't know what she expects me to do about it!\n"},			//0
			{command:"wait"},
			{command:"return", retval:0},
		] // an array of options/commands which will be evaluated in sequence
	};

DATA_SDS_DIALOGUE["Grace_c2_bossgood_2"]=
	{ 
		x: DEFINE_DIALOGUE_BOX_UPPER.x,
		y: DEFINE_DIALOGUE_BOX_UPPER.y,
		width: DEFINE_DIALOGUE_BOX_UPPER.width,
		height: DEFINE_DIALOGUE_BOX_UPPER.height,
		pauses: false,
		blocks: true,
		title: "Grace",
		script: [
			{command:"buffer", text:"She's bein' really really confusing sometimes...\n"},			//0
			{command:"wait"},
			{command:"return", retval:0},
		] // an array of options/commands which will be evaluated in sequence
	};

DATA_SDS_DIALOGUE["Grace_c5_advice_0"]=
	{ 
		x: DEFINE_DIALOGUE_BOX_UPPER.x,
		y: DEFINE_DIALOGUE_BOX_UPPER.y,
		width: DEFINE_DIALOGUE_BOX_UPPER.width,
		height: DEFINE_DIALOGUE_BOX_UPPER.height,
		pauses: false,
		blocks: true,
		title: "Meli",
		script: [
			{command:"buffer", text:"(I risked her life- her LIFE!  And I was never in any danger.  I'm a terrible influence on her.  I shouldn't be here.)\n"},			//0
			{command:"wait"},
			{command:"return", retval:0},
		] // an array of options/commands which will be evaluated in sequence
	};

DATA_SDS_DIALOGUE["Grace_c5_boss_0"]=
	{ 
		x: DEFINE_DIALOGUE_BOX_UPPER.x,
		y: DEFINE_DIALOGUE_BOX_UPPER.y,
		width: DEFINE_DIALOGUE_BOX_UPPER.width,
		height: DEFINE_DIALOGUE_BOX_UPPER.height,
		pauses: false,
		blocks: true,
		title: "Grace",
		script: [
			{command:"buffer", text:"Ooooo- you're all glowy!\n"},			//0
			{command:"wait"},
			{command:"return", retval:0},
		] // an array of options/commands which will be evaluated in sequence
	};
DATA_SDS_DIALOGUE["Grace_c5_boss_1"]=
	{ 
		x: DEFINE_DIALOGUE_BOX_UPPER.x,
		y: DEFINE_DIALOGUE_BOX_UPPER.y,
		width: DEFINE_DIALOGUE_BOX_UPPER.width,
		height: DEFINE_DIALOGUE_BOX_UPPER.height,
		pauses: false,
		blocks: true,
		title: "Grace",
		script: [
			{command:"buffer", text:"Your eyes are glowy an' your forehead is glowy an' your neck is glowy an' your hands are glowy an' an' an' your tummy is glowy... you're ALLLLLL glowy!\n"},			//0
			{command:"wait"},
			{command:"return", retval:0},
		] // an array of options/commands which will be evaluated in sequence
	};
DATA_SDS_DIALOGUE["Grace_c5_boss_2"]=
	{ 
		x: DEFINE_DIALOGUE_BOX_UPPER.x,
		y: DEFINE_DIALOGUE_BOX_UPPER.y,
		width: DEFINE_DIALOGUE_BOX_UPPER.width,
		height: DEFINE_DIALOGUE_BOX_UPPER.height,
		pauses: false,
		blocks: true,
		title: "Grace",
		script: [
			{command:"buffer", text:"How d'you get glowy?  Can I be glowy too?  I wanna be glowy too!\n"},			//0
			{command:"wait"},
			{command:"return", retval:0},
		] // an array of options/commands which will be evaluated in sequence
	};

Dialogue_getCurrentEvent["Grace"] = function(){
		var retval = null;
		var line = 0;
		if (GLOBAL_SCRATCHPAD.check("Dlg_Grace_Line")){
			line = GLOBAL_SCRATCHPAD.check("Dlg_Grace_Line");
		}

		if (GLOBAL_DIARY.check(5,"BOSS",true)){
			retval = "GD_Grace_c5_boss_"+line;
			line = Math.min(line+1,2);
		}
		else if (GLOBAL_DIARY.check(5,"AWAKE")){
			retval = "GD_Grace_c5_advice_"+line;
			line = Math.min(line+1,0);
		}
		else if (GLOBAL_DIARY.check(2,"TREASURE")){
			retval = "GD_Grace_c2_bossgood_"+line;
			line = Math.min(line+1,2);
		}
		else if (GLOBAL_DIARY.check(2,"HELP_MELODY")){
			retval = "GD_Grace_c2_melody_"+line;
			line = Math.min(line+1,0);
		}
		else if (GLOBAL_DIARY.check(2,"HELP_GRACIE")){
			retval = "GD_Grace_c2_gracie_"+line;
			line = Math.min(line+1,0);
		}
		else if (GLOBAL_DIARY.check(2,"LEAVING_HOME")){
			retval = "Grace_get_help";
			//line = Math.min(line+1,3);
		}
		GLOBAL_SCRATCHPAD.note("Dlg_Grace_Line",line);
		return retval;
	};
