// town script for town 47: Ruined village (intro cutscene town 3)

begintownscript;

variables;

int y;

body;

beginstate INIT_STATE;
break;

beginstate EXIT_STATE;
break;

beginstate START_STATE;
if (get_flag(47,0) == 0) {

	set_total_visibility(1);

// Set party correctly, in case it's necessary

	force_view_center(24,40);
	relocate_character(0,24,40);
	relocate_character(1,24,41);
	relocate_character(2,24,42);
	relocate_character(3,24,43);
	set_character_facing(0,0);
	set_character_facing(1,0);
	set_character_facing(2,0);
	set_character_facing(3,0);
	
	set_character_pose(21,2); 
	
// People lying dead

	set_character_pose(22,14);
	set_character_pose(23,14);
	set_character_pose(24,14);
	set_character_pose(25,14);
	set_character_pose(26,14);
	set_character_pose(27,14);
	set_character_pose(28,14);
	set_character_pose(29,14);
	set_character_pose(30,14);
	
	force_instant_terrain_redraw();

// Explain

	message_dialog("Curious, you walk on. First slowly, then faster, until you reach the village.","It is a mess. Many people lie dead on the floor, and the few surviving ones are hunted down by...");
	
	message_dialog("You have actually no idea what they are. They look like Nephilim, but they are not. They are bigger, for one. They also seem stronger, and more brutal.","You look around, and see the creatures destroy everything...");
	
// Look around

	force_view_center(27,32);
	force_instant_terrain_redraw();
	pause(20);
	
	force_view_center(42,40);
	force_instant_terrain_redraw();
	pause(20);
	
	force_view_center(41,15);
	force_instant_terrain_redraw();
	pause(20);
	
	force_view_center(14,10);
	force_instant_terrain_redraw();
	pause(20);
	
	force_view_center(13,23);
	force_instant_terrain_redraw();
	pause(20);

	force_view_center(11,30);
	force_instant_terrain_redraw();
	pause(10);
	
	text_bubble_on_char(21,"Graaagh!"); // man attacked by leader
	force_instant_terrain_redraw();
	pause(5);
	
	relocate_character(21,12,31);
	force_instant_terrain_redraw();
	pause(5);
	
	set_character_pose(21,1);
	play_sound(69);
	force_instant_terrain_redraw();
	pause(5);
	
	set_character_pose(16,11);
	force_instant_terrain_redraw();
	pause(2);
	set_character_pose(16,12);
	text_bubble_on_char(21,"");
	force_instant_terrain_redraw();
	pause(2);
	set_character_pose(16,13);
	force_instant_terrain_redraw();
	pause(2);
	set_character_pose(16,14);
	force_instant_terrain_redraw();
	pause(20);

// Explain

	message_dialog("After having a good look at the creatures and the dead people, you spot a family, being threatened by the creatures.","");
	
// Show family

	force_view_center(21,19);
	pause(15);
	
	text_bubble_on_char(18,"Oh Harold");
	force_instant_terrain_redraw();
	pause(15);
	
	text_bubble_on_char(18,"");
	text_bubble_on_char(18,"I'm afraid!");
	force_instant_terrain_redraw();
	pause(15);
	
	text_bubble_on_char(18,"");
	force_instant_terrain_redraw();
	pause(15);
	
	text_bubble_on_char(17,"You don't have to");
	force_instant_terrain_redraw();
	pause(15);
	
	text_bubble_on_char(17,"");
	text_bubble_on_char(17,"my dear");
	force_instant_terrain_redraw();
	pause(15);
	
	text_bubble_on_char(17,"I'm here");
	force_instant_terrain_redraw();
	pause(15);
	
	text_bubble_on_char(17,"");
	relocate_character(6,20,21);
	relocate_character(7,23,24);
	relocate_character(8,24,21);
	relocate_character(9,22,19);
	force_instant_terrain_redraw();
	pause(15);
	
	text_bubble_on_char(17,"No!");
	force_instant_terrain_redraw();
	pause(15);
	
	text_bubble_on_char(17,"");
	text_bubble_on_char(17,"Please!");
	force_instant_terrain_redraw();
	pause(15);
	
	text_bubble_on_char(17,"");
	text_bubble_on_char(17,"Let them go!");
	force_instant_terrain_redraw();
	pause(15);
	
	text_bubble_on_char(17,"");
	text_bubble_on_char(17,"Take me!");
	text_bubble_on_char(18,"No!");
	force_instant_terrain_redraw();
	pause(15);
	
	text_bubble_on_char(17,"");
	text_bubble_on_char(18,"Harold!");
	text_bubble_on_char(20,"Father!");
	force_instant_terrain_redraw();
	pause(15);
	
	text_bubble_on_char(18,"");
	text_bubble_on_char(20,"");
	force_instant_terrain_redraw();
	pause(15);

// Back to player

	force_view_center(24,40);
	force_instant_terrain_redraw();
	pause(10);
	
	message_dialog("That family Is bound to get killed if you don't do anything. And you, brave adventurers, won't just let those big creatures kill that nice, small family, now would you?","You charge the creatures.");

// Party attacks

	pause(5);
	
	set_character_pose(0,2);
	set_character_pose(1,2);
	set_character_pose(2,2);
	set_character_pose(3,2);
	play_sound(18);
	force_instant_terrain_redraw();
	pause(15);
	
	text_bubble_on_char(0,"Aaaah!");
	text_bubble_on_char(1,"Aaaah!");
	text_bubble_on_char(2,"Aaaah!");
	text_bubble_on_char(3,"Aaaah!");
	force_instant_terrain_redraw();
	pause(15);
	
	march_party(24,39);
	play_sound(49);
	force_instant_terrain_redraw();
	pause(3);
	
	march_party(24,38);
	play_sound(50);
	force_instant_terrain_redraw();
	pause(3);
	
	march_party(24,37);
	play_sound(49);
	force_instant_terrain_redraw();
	pause(3);
	
	march_party(24,36);
	play_sound(50);
	force_instant_terrain_redraw();
	pause(3);
	
	march_party(24,35);
	play_sound(49);
	force_instant_terrain_redraw();
	pause(3);
	
	force_view_center(24,26);
	march_party(24,32);
	play_sound(50);
	force_instant_terrain_redraw();
	
	set_character_facing(6,4); // Senarti turn around
	set_character_facing(7,4);
	set_character_facing(8,4);
	set_character_facing(9,4);
	force_instant_terrain_redraw();
	
	pause(3);
	
	march_party(24,31);
	play_sound(49);
	force_instant_terrain_redraw();
	pause(3);
	
	march_party(24,30);
	play_sound(50);
	force_instant_terrain_redraw();
	pause(3);
	
	march_party(24,29);
	play_sound(49);
	force_instant_terrain_redraw();
	pause(3);
	
	relocate_character(0,24,29);
	relocate_character(1,23,30);
	relocate_character(2,24,31);
	relocate_character(3,23,32);
	play_sound(50);
	force_instant_terrain_redraw();
	pause(3);
	
	relocate_character(0,24,28);
	relocate_character(1,23,29);
	relocate_character(2,24,30);
	relocate_character(3,23,31);
	play_sound(49);
	force_instant_terrain_redraw();
	pause(3);
	
	set_total_visibility(0);
	force_view_center(10,2);
	force_instant_terrain_redraw();
	pause(3);
	
	
	play_sound(13);
	pause(17);
	
// Explain

	message_dialog("You fight them for a while, but eventually you are defeated. Severely wounded, you lie on the road and watch the family being butchered.","You pass out");
	
	message_dialog("You awake in your beds. You see soldiers standing around you. When you look at your hands and feet, you see they are tied with aseptic gauze. You begin to remember the fight. You fall asleep again.","When you wake up, everyone is gone. You stand up, still dazed from sleep. It looks as if you're in some fort. You remember the enemy. Who were they?");

// *** End of cutscene *** get party back to Fort Filbert

	set_character_pose(0,0);
	set_character_pose(1,0);
	set_character_pose(2,0);
	set_character_pose(3,0);
	set_character_pose(22,0);
	set_character_pose(23,0);
	set_character_pose(24,0);
	set_character_pose(25,0);
	set_character_pose(26,0);
	set_character_pose(27,0);
	set_character_pose(28,0);
	set_character_pose(29,0);
	set_character_pose(30,0);

	text_bubble_on_char(0,"");
	text_bubble_on_char(1,"");
	text_bubble_on_char(2,"");
	text_bubble_on_char(3,"");
	force_instant_terrain_redraw();

	set_flag(47,0,1);

// Explain

	message_dialog("This is the end of the cutscene. Please take a step in whatever direction to complete the cutscene","");
	}

break;

beginstate 10;
	move_to_new_town(12,17,29);
break;