#
#	Image specifier:
#
#			"name"										-> single unanimated bitmap
#			{num, stride, "name", "name", ...}			-> regular animated bitmap
#			{num, "name", delay, "name", delay, ...}	-> irregular animated bitmap

# tile information - {ASCII map identifier, collidable flag, deadly flag,
# in-front flag, cloud flag, <image specifier>}
{
	{"-", 1, 0, 0, 0,	"log.bmp"}
	{"f", 0, 1, 0, 0,	{4, 2, "flame1.bmp", "flame2.bmp", "flame3.bmp", "flame4.bmp"}}
	{"w", 0, 1, 1, 0,	{4, 5, "water1.bmp", "water2.bmp", "water3.bmp", "water2.bmp"}}
	{"W", 0, 1, 1, 0,	"staticwater.bmp"}
	{"c", 0, 0, 1, 0,	"cloudtile.png"}
	{"C", 0, 0, 1, 1,	"cloudtile.png"}
}

# map - {ID, name, clear r, g, b, foreground map, background map,
# background scrolling multiple, background fixed update x, y,
# ID of screen to the left, ID of screen to the right, ID of screen to the top,
# ID of screen to the bottom }
{
	{1, "Into Magicland",
				0, 0, 0.2,
				"intomagicland.txt", "outdoorback.txt", 0.2, 0, 0,
				0, 0, 0, 0}

	{2, "The Prince's House",
				0.3, 0.3, 0.3,
				"indoor.txt", "indoorback.txt", 0.8, 0, 0,
				4, 3, 0, 0}

	{3, "The Prince's Back Garden",
				0, 0, 0.2,
				"backyard.txt", "outdoorback.txt", 0.2, 0, 0,
				2, 0, 0, 0}

	{4, "The Prince's Front Garden",
				0, 0, 0.2,
				"frontyard.txt", "outdoorback.txt", 0.2, 0, 0,
				0, 2, 0, 0}
}

# information on how links should be handled - {screen 1, screen 2, offset x, offset y}
{
	{2, 3, 0, 80}
	{2, 4, 0, 0}
}

# Object palette  - {	palette ID, join to start point flag,
#						collision mode, object name, tilemap name, 
#						<image specifier>}
#
#	Collision modes are:
#
#		0 - no collisions at all
#		1 - damage causing collision (no movement of Dizzy)
#		2 - catapulting collision
#		3 - tilemap collision
#		4 - this is a pickup item
#
#		NB: palette ID 0 is reserved for the empty image
#
{
	{1,	0,		0, "",							"",	"danny.png"} # airborne Danny
	{2,	0,		0, "",							"",	"floordanny.png"} # ground dwelling Danny

	# long and short ropes
	{3, 0,		4, "A long piece of rope",		"", "longrope.png"}
	{4, 0,		4, "A short piece of rope",		"", "shortrope.png"}

	# handle and sky boots
	{5, 0,		0, "Sky boots",					"", "skyboots.png"}
	{6, 0,		4, "A starting handle",			"", "handle.png"}

	# various states of machine
	{7, 0,		0, "Grand Dizzy's Machine",		"", "machine.png"}		# no rope
	{8, 0,		0, "Grand Dizzy's Machine",		"", "ropemachine.png"}	# rope attached
	
		# in motion
		{9, 0,		0, "Grand Dizzy's Machine",		"", {4, 3, "machineanim0.png", "machineanim1.png", "machineanim2.png", "machineanim3.png"}}
		
	# shark
	{10, 0,		3, "A friendly looking shark",	"sharkmap.txt", "sharkfin.png"}
	
	# prince
	{11, 0,		0, "The Prince",				"", "prince.png"}
	
	# bucket
	{12, 0,		4, "A Bucket of water",			"", "bucket.bmp"}
	
	# 'snail'
	{13, 0,		1, "A Nasty looking snail",		"", "smallsnail.png"}
}

# Object instance information - {Object ID, screen ID,
#			{ movement list }
#			behind flag, <palette ID | 0> }
#
#		movement list node = {start position x, y, flip mode for this journey, time for this journey}
#
#		a 0 palette ID causes no graphic and a bounding box taken from the first two path nodes
#
{
	# Dannys
	{1, 1,		{ {328, 106, 0, 10} {330, 106, 1, 10} },		1, 1}	# elevated
	{2, 0,		{ {329, 222, 0, -1} },							1, 2}	# ground standing
	
	# long and short ropes
	{3, 1,		{ {16, 152, 0, -1} },							1, 3}	# long
	{4, 1,		{ {540, 200, 0, -1} },							1, 4}	# short

	# handle and sky boots
	{5, 0,		{ {300, 224, 0, -1} },							1, 5}	# boots
	{6, 1,		{ {136, 56, 0, -1} },							1, 6}	# handle

	# all the machines
	{7, 1,		{ {620, 253, 0, -1} },							1, 7}	# static (state 1)
	{13, 0,		{ {620, 253, 0, -1} },							1, 7}	# static (state 2)
	{8, 0,		{ {620, 253, 0, -1} },							1, 8}	# roped (state 1)
	{14, 0,		{ {620, 253, 0, -1} },							1, 8}	# roped (state 2)
	{15, 0,		{ {620, 253, 0, -1} },							1, 8}	# roped (state 3)
	{9, 0,		{ {620, 253, 0, -1} },							1, 9}	# moving

	# Danny talk spot
	{10, 1,		{ {288, 92, 0, 0} {328, 106, 0, 0} },			1, 0}

	# Danny/rope spots
	{11, 1,		{ {288, 216, 0, 0} {368, 224, 0, 0} },			1, 0}
	{12, 0,		{ {288, 216, 0, 0} {368, 224, 0, 0} },			1, 0}

	# the teleport spot
	{16, 0,		{ {620, 253, 0, -1} },							1, 9}	# moving

	# the shark
	{17, 4,		{ {92, 172, 0, 264} {356, 172, 1, 264} },		1, 10}

	# the prince - happy and unhappy
	{18, 2,		{ {272, 208, 0, -1} },							1, 11}	# unhappy
	{20, 0,		{ {272, 208, 0, -1} },							1, 11}	# happy

	# the bucket of water
	{19, 3,		{ {906, 296, 0, -1} },							1, 12}

	# the burning fire hot spot
	{21, 2,		{ {8, 112, 0, 0} {24, 120, 0, 0 } },			1, 0} # recoil
	{22, 2,		{ {8, 112, 0, 0} {40, 136, 0, 0 } },			1, 0} # extinguish

	# the snail
	{0, 3,		{ {272, 288, 0, 800} {364, 288, 1, 800} },		0, 13}
}

# events
#
#		{	object 1, object 2, action flag, object use flag, one time flag,
#			map patch id, object patch id, dizzy patch id,
#			dialogue name}
#
{
	# conversation with Danny
	{0, 10,	0, 0, 1,	0, 0, 0, "dannyfloat.txt"}

	# use of the rope
	{11, 3,	1, 0, 0,	0, 1, 0, "userope.txt"}
	{12, 0, 0, 0, 1,	0, 0, 0, "dannyfloor.txt"}

	# collection of the boots
	{0, 5, 1, 0, 1,		1, 2, 0, "wearboots.txt"}

	# use of the ropes with machine state 0
	{7, 3, 1, 1, 1,		0, 3, 0, "longropef.txt"}
	{7, 4, 1, 1, 1,		0, 3, 0, "shortropef.txt"}

	# use of the ropes with machine state 1
	{13, 3, 1, 1, 1,	0, 4, 0, "longropes.txt"}
	{13, 4, 1, 1, 1,	0, 4, 0, "shortropes.txt"}

	# use of handle with roped states
	{8, 6, 1, 0, 1,		0, 5, 0, "handlehint.txt"}
	{14, 6, 1, 0, 1,	0, 6, 0, "handlehint.txt"}
	{15, 6, 1, 1, 1,	0, 7, 0, "complete.txt"}

	# Dizzy teleport
	{0, 16, 0, 0, 0,	0, 0, 1, ""}
	
	# Prince dialogues
	{0, 18, 1, 0, 1,	0, 0, 0, "princeunhappy.txt"}
	{0, 20, 1, 0, 1,	0, 0, 0, "princehappy.txt"}
	
	# fire recoil
	{0, 21, 0, 0, 0,	0, 0, 2, "dizzyburn.txt"}
	
	# fire extinguish
	{19, 22, 1, 1, 1,	2, 8, 0, "fireout.txt"}
}

# map patch information - {ID, map ID, offset x, offset y, new data }
{
	{1, 1, 49, 23, "intomagiclandpatch.txt"}
	{2, 2, 1, 14, "indoorpatch.txt"}
}

# Dizzy patch information - {patch ID, new screen ID, x, y,
#				jumping flag, direction flag}
#
#	NB:	if new screen ID is non-zero, Dizzy moves screen and
#		gets a new x, y. Otherwise all three pieces of information
#		are ignored
#
#	Direction:	+1 = right, -1 = left
#
{
	{1, 2, 149, 102, 0, 0}
	{2, 0, 0, 0, 1, 1}
}

# Object patch information - {ID, Object ID, screen ID, substitution ID}
{
	# after throwing the rope
	{1, 10, 0, 0}	# conversation point out - just in case
	{1, 1, 0, 0}	# sky Danny out
	{1, 2, 1, 0}	# floor Danny in
	{1, 5, 1, 0}	# sky boots in
	{1, 11, 0, 0}	# use rope action object out
	{1, 12, 1, 0}	# talk about shoes walkover object in

	# upon collecting the boots
	{2, 5, 0, 0}	# sky boots out

	# use of first rope
	{3, 7, 0, 0}	# state 1 out
	{3, 13, 1, 0}	# state 2 in

	# use of second rope
	{4, 13, 0, 0}	# state 2 out
	{4, 8, 1, 0}	# roped in

	# use of handle (1)
	{5, 8, 0, 0}	# roped (1) out
	{5, 14, 1, 0}	# roped (2) in

	# use of handle (2)
	{6, 14, 0, 0}	# roped (2) out
	{6, 15, 1, 0}	# roped (3) in

	# use of handle (3)
	{7, 15, 0, 0}	# roped (3) out
	{7, 9, 1, 0}	# moving in
	{7, 16, 1, 0}	# teleport hot spot in
	
	# use of bucket to put out fire
	{8, 18, 0, 0}	# unhappy prince out
	{8, 20, 2, 0}	# happy prince in
	{8, 21, 0, 0}	# recoil reaction out
}

# start information for Dizzy - {screen ID, x, y}
{1, 48, 246}
