"use strict";

DATA_SDS_DIALOGUE["Guy_c1_intro_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: "Guy",
		script: [
			{command:"buffer", text:"Good morning, sleepyhead!\n"},			//0
			{command:"buffer", text:"Did the earthquake wake you up?\n"},		//1
			{command:"chooseH", choices:{"Yes!":6, "No...":3}},					//2
			{command:"buffer", text:"I'm glad you're starting to relax some.  Perhaps your memory will come back one of these days as well."},			//3
			{command:"wait"},
			{command:"clear"},
			{command:"buffer", text:"I can only imagine how scary it was to be buried in that rockslide.  It will take you time to recover fully."},		//6
			{command:"wait"},
			{command:"buffer", text:"\nEarthquakes are increasingly common these days, though, so if you're still uneasy, why not go pray to the Sky Dragon?"},		//8
			{command:"wait"},
			{command:"clear"},
			{command:"buffer", text:"Some of the villagers may also be able to tell you a thing or two.  Sometimes three, four, or five if you keep asking!\n"},
			{command:"wait"},
			{command:"return", retval:0}
		] // an array of options/commands which will be evaluated in sequence
	};

DATA_SDS_DIALOGUE["Guy_c1_advice_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: "Guy",
		script: [
			{command:"buffer", text:"If you're worried, or aren't sure where to begin, you'd best go pray at the Sky Dragon shrine.\n"},
			{command:"wait"},
			{command:"buffer", text:"Some of the villagers may also be able to tell you a thing or two.  Sometimes three, four, or five if you keep asking!\n"},
			{command:"wait"},
			{command:"return", retval:0}
		] // an array of options/commands which will be evaluated in sequence
	};
DATA_SDS_DIALOGUE["Guy_c1_advice_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: "Guy",
		script: [
			{command:"buffer", text:"What, forgot where the shrine is?\n"},			//0
			{command:"chooseH", choices:{"Yes...?":2, "No!":5}},					//1
			{command:"buffer", text:"No worries.  Just leave the house and head east.  The shrine is at the village outskirts.  You can't miss it."},			//3
			{command:"wait"},
			{command:"return", retval:0},
			{command:"buffer", text:"Excellent.  Give my regards to Rinda the shrine matron when you see her!"},		//5
			{command:"wait"},
			{command:"return", retval:0}
		] // an array of options/commands which will be evaluated in sequence
	};
DATA_SDS_DIALOGUE["Guy_c1_advice_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: "Guy",
		script: [
			{command:"buffer", text:"Oh, and don't be a stranger!\n"},
			{command:"wait"},
			{command:"buffer", text:"If you wander off, most folks will be happy to re-hash old conversations when you get back.\n"},
			{command:"wait"},
			{command:"buffer", text:"Others are a bit more active, and may have entirely new things to talk about as events play out!\n"},
			{command:"wait"},
			{command:"return", retval:0}
		] // an array of options/commands which will be evaluated in sequence
	};
DATA_SDS_DIALOGUE["Guy_c1_smoke_0"]=
	{ 
		x: DEFINE_DIALOGUE_BOX_UPPER.x,
		y: DEFINE_DIALOGUE_BOX_UPPER.y,
		width: DEFINE_DIALOGUE_BOX_LOWER.width,
		height: DEFINE_DIALOGUE_BOX_LOWER.height,
		pauses: false,
		blocks: true,
		title: "Guy",
		script: [
			{command:"buffer", text:"You're safe!  Thank the Goddess!  I know I made light of the earthquakes earlier, but I never expected to be trapped in my own home by one.\n"},			//0
			{command:"wait"},
			{command:"buffer", text:"Not that I'm worried about that, mind you.  I'm more concerned about the weird purple smoke coming out of our floor..."},			//3
			{command:"wait"},
			{command:"clear"},
			{command:"buffer", text:"What?\nIt's outside too?\n...Monsters?\nThis is disturbing news...\n"},		//5
			{command:"wait"},
			{command:"buffer", text:"Okay.  I'll try to keep as far from the smoke as I can.  I feel bad asking, but could you go back to the shrine?\n"},
			{command:"wait"},
			{command:"buffer", text:"Rinda isn't just a figurehead- she has great knowledge about this world.  If anyone short of the Goddess knows how to stop this smoke, it would be her."},
			{command:"wait"},
			{command:"return", retval:0}
		] // an array of options/commands which will be evaluated in sequence
	};
DATA_SDS_DIALOGUE["Guy_c1_smoke_1"]=
	{ 
		x: DEFINE_DIALOGUE_BOX_UPPER.x,
		y: DEFINE_DIALOGUE_BOX_UPPER.y,
		width: DEFINE_DIALOGUE_BOX_LOWER.width,
		height: DEFINE_DIALOGUE_BOX_LOWER.height,
		pauses: false,
		blocks: true,
		title: "Guy",
		script: [
			{command:"buffer", text:"Thanks for the concern, but these boulders are too tightly wedged.  Pushing them won't do any good.\n"},			//0
			{command:"wait"},
			{command:"buffer", text:"If you really want to help, go talk to Rinda.  And hurry!  I don't want to know what too much time near this smoke will do to me..."},			//3
			{command:"wait"},
			{command:"return", retval:1}
		] // an array of options/commands which will be evaluated in sequence
	};
DATA_SDS_DIALOGUE["Guy_c1_treasure_1"]=
	{ 
		x: DEFINE_DIALOGUE_BOX_UPPER.x,
		y: DEFINE_DIALOGUE_BOX_UPPER.y,
		width: DEFINE_DIALOGUE_BOX_LOWER.width,
		height: DEFINE_DIALOGUE_BOX_LOWER.height,
		pauses: false,
		blocks: true,
		title: "Guy?",
		script: [
			{command:"buffer", text:"YOU!  How DARE you show your face around here?!\n"},			//0
			{command:"wait"},
			{command:"clear"},
			{command:"buffer", text:"I dug you out of that rockslide!  I took care of you as you recovered!  I let you stay in my house!  I gave you EVERYTHING!"},	
			{command:"wait"},
			{command:"clear"},
			{command:"buffer", text:"And you?  I get trapped and you just leave me!  You run away and hide in the shrine as if I don't mean ANYTHING!"},	
			{command:"wait"},
			{command:"clear"},
			{command:"buffer", text:"If that's how it's going to be between us, FINE!  With this new power, I can put you BACK under that pile of rock!\n"},	
			{command:"wait"},
			{command:"buffer", text:"Get crushed and die!  I HATE YOU!!"},	
			{command:"wait"},
			{command:"return", retval:1}
		] // an array of options/commands which will be evaluated in sequence
	};
DATA_SDS_DIALOGUE["Guy_c1_treasure_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: "Guy",
		script: [
			{command:"buffer", text:"What... happened?... So much... hate...?\n"},			//0
			{command:"wait"},
			{command:"buffer", text:"Why...?\n"},	
			{command:"wait"},
			{command:"buffer", text:"Was it... you...\n"},	
			{command:"wait"},
			{command:"buffer", text:"...who killed me?\n"},	
			{command:"wait"},
			{command:"return", retval:1}
		] // an array of options/commands which will be evaluated in sequence
	};

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

		if (GLOBAL_DIARY.check(1,"SHRINEQUAKE")){
			// shouldn't be able to reach him directly, but 2 indirect lines still trigger
			retval = "GD_Guy_c1_smoke_"+line;
			line = Math.min(line+1,1);
		}
		else{ // still pre SHRINEQUAKE
			retval = "GD_Guy_c1_advice_"+line;
			line = Math.min(line+1,2);
		}
		GLOBAL_SCRATCHPAD.note("Dlg_Guy_Line",line);
		return retval;
	};
	