"use strict";

var DEFINE_DIALOGUE_BOX_LOWER = {
	x: 8,
	y: 192,
	width:46,
	height:5
}
var DEFINE_DIALOGUE_BOX_UPPER = {
	x: 8,
	y: 8,
	width:46,
	height:5
}
var DEFINE_DIALOGUE_BOX_MIDDLE = {
	x: 8,
	y: 100,
	width:46,
	height:5
}

var DEFINE_DIALOGUE_BOX_TITLE = {
	x: 88,
	y: 152,
	width:26,
	height:9
}

var DEFINE_DIALOGUE_BOX_INTERSTITIAL = {
	x: 48,
	y: 56,
	width:36,
	height:16
}

var DEFINE_DIALOGUE_BOX_NOTIFICATION = {
	x: 48,
	y: 112,
	width:36,
	height:1
}

var DEFINE_DIALOGUE_BOX_NOTIFICATION_3 = {
	x: 48,
	y: 104,
	width:36,
	height:3
}

var DEFINE_DIALOGUE_BOX_NOTIFICATION_HIGH_3 = {
	x: 48,
	y: 32,
	width:36,
	height:3
}

var DEFINE_DIALOGUE_BOX_NOTIFICATION_LOW_3 = {
	x: 48,
	y: 176,
	width:36,
	height:3
}

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

var DEFINE_DIALOGUE_BOX_NOTIFICATION_LOW = {
	x: 48,
	y: 224,
	width:32,
	height:1
}

var DEFINE_DIALOGUE_BOX_NOTIFICATION_MINI = {
	x: 144,
	y: 112,
	width:12,
	height:1
}

var DEFINE_DIALOGUE_BOX_NOTIFICATION_HIGH_MINI = {
	x: 144,
	y: 40,
	width:12,
	height:1
}

/* --== DIALOGUE DATA ==-- */
var DATA_SDS_DIALOGUE = {
	"narrator_testing" :
	{ 
		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,
		script: [
			{command:"buffer", text:"From somewhere, a transmission:\n"},		//0
			{command:"buffer", text:"Testing 1... "},							//1
			{command:"pause", frames:15},										//2
			{command:"buffer", text:"2... "},									//3
			{command:"pause", frames:15},										//4
			{command:"buffer", text:"3...\n"},									//5
			{command:"pause", frames:15},										//6
			{command:"buffer", text:"Do you read?\n"},							//7
			{command:"chooseH", choices:{"Yes!":9, "No?":1}},					//8
			{command:"buffer", text:"Excellent!  But vertically?\n"},			//9
			{command:"chooseV", choices:{"Yes!":11, "No?":7}},					//10
			{command:"buffer", text:"Wow... I am surprised everything is actually working as intended O.O"},	//11
			{command:"wait"},
			{command:"clear"},
			{command:"buffer", text:"*AHEM* I mean, \"Awesome?  Of course I'm awesome!\" ^_^"},
			{command:"wait"},
			{command:"return", retval:0}
		] // an array of options/commands which will be evaluated in sequence
	},
	"Save" :
	{ 
		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,
		script: [
			{command:"buffer", text:"Life and Chi restored.\nWrite in the diary?\n"},			//0
			{command:"chooseH", choices:{"Yes":2, "No":3}},					//1
			{command:"return", retval:1},
			{command:"return", retval:0}
		] // an array of options/commands which will be evaluated in sequence
	},
	"Save_good" :
	{ 
		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,
		script: [
			{command:"buffer", text:"She recorded her adventures.\n"},			//0
			{command:"wait"},
			{command:"return", retval:0}
		] // an array of options/commands which will be evaluated in sequence
	},
	"Save_null" :
	{ 
		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,
		script: [
			{command:"buffer", text:"The diary appears to be up to date.\n"},			//0
			{command:"wait"},
			{command:"return", retval:0}
		] // an array of options/commands which will be evaluated in sequence
	},
	"Save_speedrun" :
	{ 
		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,
		script: [
			{command:"buffer", text:"Boop.\n"},			//0
			{command:"wait"},
			{command:"return", retval:0}
		] // an array of options/commands which will be evaluated in sequence
	},
	"Diary_empty" :
	{ 
		x: DEFINE_DIALOGUE_BOX_TITLE.x,
		y: DEFINE_DIALOGUE_BOX_TITLE.y,
		width: DEFINE_DIALOGUE_BOX_TITLE.width,
		height: DEFINE_DIALOGUE_BOX_TITLE.height,
		pauses: false,
		blocks: true,
		script: [
			{command:"buffer", text:"The diary was empty; her past, an uncomfortable mystery..."},			//0
			{command:"wait"},
			{command:"return", retval:0}
		] // an array of options/commands which will be evaluated in sequence
	},
	"Diary_read" :
	{ 
		x: DEFINE_DIALOGUE_BOX_TITLE.x,
		y: DEFINE_DIALOGUE_BOX_TITLE.y,
		width: DEFINE_DIALOGUE_BOX_TITLE.width,
		height: DEFINE_DIALOGUE_BOX_TITLE.height,
		pauses: false,
		blocks: true,
		script: [
			{command:"buffer", text:"She read the diary..."},			//0
			{command:"wait"},
			{command:"return", retval:0}
		] // an array of options/commands which will be evaluated in sequence
	},
	"Diary_fail" :
	{ 
		x: DEFINE_DIALOGUE_BOX_TITLE.x,
		y: DEFINE_DIALOGUE_BOX_TITLE.y,
		width: DEFINE_DIALOGUE_BOX_TITLE.width,
		height: DEFINE_DIALOGUE_BOX_TITLE.height,
		pauses: false,
		blocks: true,
		script: [
			{command:"buffer", text:"It didn't make complete sense.  Was it a dream?  Who was she really?"},			//0
			{command:"wait"},
			{command:"return", retval:0}
		] // an array of options/commands which will be evaluated in sequence
	},
	"Diary_success" :
	{ 
		x: DEFINE_DIALOGUE_BOX_TITLE.x,
		y: DEFINE_DIALOGUE_BOX_TITLE.y,
		width: DEFINE_DIALOGUE_BOX_TITLE.width,
		height: DEFINE_DIALOGUE_BOX_TITLE.height,
		pauses: false,
		blocks: true,
		script: [
			{command:"buffer", text:"It all came back!"},			//0
			{command:"wait"},
			{command:"return", retval:0}
		] // an array of options/commands which will be evaluated in sequence
	},

	"Get_Soul" :
	{ 
		x: DEFINE_DIALOGUE_BOX_NOTIFICATION.x,
		y: DEFINE_DIALOGUE_BOX_NOTIFICATION.y,
		width: DEFINE_DIALOGUE_BOX_NOTIFICATION.width,
		height: DEFINE_DIALOGUE_BOX_NOTIFICATION.height,
		pauses: true,
		blocks: true,
		script: [
			{command:"buffer", text:"You feel suddenly stronger..."},			//0
			{command:"wait"},
			{command:"clear"},
			{command:"buffer", text:"but strangely different."},			//0
			{command:"wait"},
			{command:"return", retval:0}
		] // an array of options/commands which will be evaluated in sequence
	},
	"Get_Tear" :
	{ 
		x: DEFINE_DIALOGUE_BOX_NOTIFICATION.x,
		y: DEFINE_DIALOGUE_BOX_NOTIFICATION.y,
		width: DEFINE_DIALOGUE_BOX_NOTIFICATION.width,
		height: DEFINE_DIALOGUE_BOX_NOTIFICATION.height,
		pauses: true,
		blocks: true,
		script: [
			{command:"buffer", text:"A Goddess Tear!  You feel blessed!"},			//0
			{command:"wait"},
			{command:"return", retval:0}
		] // an array of options/commands which will be evaluated in sequence
	},

	"Crushed" :
	{ 
		x: DEFINE_DIALOGUE_BOX_NOTIFICATION_MINI.x,
		y: DEFINE_DIALOGUE_BOX_NOTIFICATION_MINI.y,
		width: DEFINE_DIALOGUE_BOX_NOTIFICATION_MINI.width,
		height: DEFINE_DIALOGUE_BOX_NOTIFICATION_MINI.height,
		pauses: false,
		blocks: false,
		script: [
			{command:"buffer", text:"  Smashed!"},			//0
			{command:"pause", frames: 30},
			{command:"return", retval:0},
		] // an array of options/commands which will be evaluated in sequence
	}
	
	
};


/* --== DIALOGUE HELPERS ==-- */
// an array of functions which implicitly use Diary and scratchpad data
// to return the name of the appropriate event; usually a GD dialogue, but some exceptions exist
var Dialogue_getCurrentEvent = {
	// Actual implementations have been refactored into each character's Dlg_ file
};

