script_enemy_main
{

	#include_function".\stage3_Boss_Info.txt";

	let count = 0;
	let bgm = false;

	task Behavior()
	{
	yield;
	SetCommonData("ng_feverdecrease", 0);	// Fever score stop
	SetMovePosition03(GetCenterX, GetClipMinY + 96, 20, 5);
	while (GetEventStep() != 1)	{	yield;	}
//	SetMovePosition02(GetClipMinX-50, GetClipMinY -50, 20);
	while (GetEventStep() != 2)	{	yield;	}
	SetCommonData("CD_BossFight", 0);		// Boss Fight stop
	bgm = true;
	}

//---------------------------------------------------------------------------------------------
	@Initialize
	{
	SetLife(1);
	DeleteEnemyShotToItem(ALL);
	SetDamageRate(0, 0);
	LoadGraphic(BossSprite);
	SetGraphicRect(1, 1, BSR_sizex, BSR_sizey);
	CreateEventFromScript("stage0_bossclear");
	Behavior;
	}

	@MainLoop
	{
	if( !OnEvent() && bgm) {	VanishEnemy;	}
	yield;
	count++;
	}

	@DrawLoop
	{
	SetTexture(BossSprite);
	SetGraphicAngle(0, 0, 0);
	SetGraphicScale(1, 1);
	#include_function".\..\function\boss_draw.txt";
	}
}

//---------------------------------------------------------------------------------------------

script_event stage0_bossclear

	{

       	let chara21 = GetCurrentScriptDirectory~"..\img\boss\Sona_f1.png";
       	let chara22 = GetCurrentScriptDirectory~"..\img\boss\Sona_f2.png";
       	let chara23 = GetCurrentScriptDirectory~"..\img\boss\Sona_f3.png";
       	let chara24 = GetCurrentScriptDirectory~"..\img\boss\Sona_f4.png";
       	let chara25 = GetCurrentScriptDirectory~"..\img\boss\Sona_f5.png";

	@Initialize
	{
	LoadGraphic(chara21);
	LoadGraphic(chara22);
	LoadGraphic(chara23);
	LoadGraphic(chara24);
	LoadGraphic(chara25);
	}

	@MainLoop
	{

	if ((GetPlayerType == REIMU_A) || (GetPlayerType == REIMU_B))
	{



		MoveChar(LEFT, FRONT);
		TextOutA("\c[RED]He still don't come out.");
		TextOutA("\c[RED]Can I brake the door?");
		MoveChar(LEFT, BACK);

		SetChar(RIGHT, chara25);
		SetGraphicRect(RIGHT, 1, 1, 200, 320);
		SetNameFromText(RIGHT, TEXT_PURPLE, "Sona S Sonata", "Laboratory Keeper");
		MoveChar(RIGHT, FRONT);
		TextOutA("\c[PURPLE]No sis! You can't do that!");
		MoveChar(RIGHT, BACK);

		MoveChar(LEFT, FRONT);
		TextOutA("\c[RED]So what can I do?");
		MoveChar(LEFT, BACK);

		SetChar(RIGHT, chara23);
		MoveChar(RIGHT, FRONT);
		TextOutA("\c[PURPLE]I guess nothing you can do right now.");
		MoveChar(RIGHT, BACK);

		MoveChar(LEFT, FRONT);
		TextOutA("\c[RED]Why?");
		MoveChar(LEFT, BACK);

		MoveChar(RIGHT, FRONT);
		TextOutA("\c[PURPLE]Because the demo end here.");
		MoveChar(RIGHT, BACK);

		MoveChar(LEFT, FRONT);
		TextOutA("\c[RED]Oh... damm it!");
		MoveChar(LEFT, BACK);

		MoveChar(RIGHT, FRONT);
		TextOutA("\c[PURPLE]I'm sorry.");
		MoveChar(RIGHT, BACK);

		MoveChar(LEFT, FRONT);
		TextOutA("\c[RED]So how long I have to wait for him?");
		MoveChar(LEFT, BACK);

		SetStep(1);
		MoveChar(RIGHT, FRONT);
		TextOutA("\c[PURPLE]I don't know too. \nPlease be patient sis.");
		MoveChar(RIGHT, BACK);

		MoveChar(LEFT, FRONT);
		TextOutA("\c[RED]Ah...");
		MoveChar(LEFT, BACK);
		SetStep(2);
	}








	else if ((GetPlayerType == MARISA_A) || (GetPlayerType == MARISA_B))
	{

		MoveChar(LEFT, FRONT);
		TextOutA("\c[RED]Now I can get some doll too.");
		MoveChar(LEFT, BACK);

		SetChar(RIGHT, chara25);
		SetGraphicRect(RIGHT, 1, 1, 200, 320);
		SetNameFromText(RIGHT, TEXT_PURPLE, "Sona S Sonata", "Laboratory Keeper");
		MoveChar(RIGHT, FRONT);
		TextOutA("\c[PURPLE]No sis!");
		TextOutA("\c[PURPLE]I didn't promise that!");
		MoveChar(RIGHT, BACK);

		MoveChar(LEFT, FRONT);
		TextOutA("\c[RED]Tic....");
		TextOutA("\c[RED]He still don't come out.");
		MoveChar(LEFT, BACK);

		SetChar(RIGHT, chara21);
		MoveChar(RIGHT, FRONT);
		TextOutA("\c[PURPLE]Ummm.");
		SetChar(RIGHT, chara22);
		TextOutA("\c[PURPLE]May be it better to take some rest?");
		MoveChar(RIGHT, BACK);

		MoveChar(LEFT, FRONT);
		TextOutA("\c[RED]Why?");
		MoveChar(LEFT, BACK);

		SetChar(RIGHT, chara23);
		MoveChar(RIGHT, FRONT);
		TextOutA("\c[PURPLE]The demo is end here and whatever \nyou try.");
		TextOutA("\c[PURPLE]You still can't go anymore farther.");
		MoveChar(RIGHT, BACK);

		MoveChar(LEFT, FRONT);
		TextOutA("\c[RED]I hate demo.");
		MoveChar(LEFT, BACK);

		SetChar(RIGHT, chara25);
		MoveChar(RIGHT, FRONT);
		TextOutA("\c[PURPLE]That's mean sis...");
		MoveChar(RIGHT, BACK);

		MoveChar(LEFT, FRONT);
		TextOutA("\c[RED]Work hard for the full version ok?");
		MoveChar(LEFT, BACK);

		SetStep(1);
		SetChar(RIGHT, chara23);
		MoveChar(RIGHT, FRONT);
		TextOutA("\c[PURPLE]Yes...");
		MoveChar(RIGHT, BACK);
		SetStep(2);
	}









	else
	{
		MoveChar(LEFT, FRONT);
		TextOutA("\c[RED]Ouch... My eye weary.");
		MoveChar(LEFT, BACK);

		SetChar(RIGHT, chara23);
		SetGraphicRect(RIGHT, 1, 1, 200, 320);
		MoveChar(RIGHT, FRONT);
		SetNameFromText(RIGHT, TEXT_PURPLE, "Sona S Sonata", "Laboratory Keeper");
		TextOutA("\c[PURPLE]Sorry sis. Playing with fire can't \navoid the mirage from heat.");
		MoveChar(RIGHT, BACK);

		MoveChar(LEFT, FRONT);
		TextOutA("\c[RED]You're the one who playing, not me.");
		MoveChar(LEFT, BACK);

		SetChar(RIGHT, chara21);
		MoveChar(RIGHT, FRONT);
		TextOutA("\c[PURPLE]But you won sis.");
		MoveChar(RIGHT, BACK);

		MoveChar(LEFT, FRONT);
		TextOutA("\c[RED]Yeah. I feel like I need some \neyedropper than score.");
		TextOutA("\c[RED]Anyway. Did all competitor have same \nscore when I beat them?");
		MoveChar(LEFT, BACK);

		MoveChar(RIGHT, FRONT);
		TextOutA("\c[PURPLE]No, if someone beat more and more \npeople.");
		TextOutA("\c[PURPLE]They'll achieved higher rank.");
		TextOutA("\c[PURPLE]This will lead to higher score when \nsomebody beat them.");
		MoveChar(RIGHT, BACK);

		MoveChar(LEFT, FRONT);
		TextOutA("\c[RED]The more you have, the more you lose?");
		MoveChar(LEFT, BACK);

		MoveChar(RIGHT, FRONT);
		TextOutA("\c[PURPLE]If you lose, you still gain some score.");
		SetChar(RIGHT, chara24);
		TextOutA("\c[PURPLE]But you will not lose any score sis.");
		MoveChar(RIGHT, BACK);

		MoveChar(LEFT, FRONT);
		TextOutA("\c[RED]Who is the highest rank now?");
		MoveChar(LEFT, BACK);

		SetChar(RIGHT, chara21);
		MoveChar(RIGHT, FRONT);
		TextOutA("\c[PURPLE]I guess he is my leader.");
		SetChar(RIGHT, chara23);
		TextOutA("\c[PURPLE]But you can't fight with him.");
		MoveChar(RIGHT, BACK);

		MoveChar(LEFT, FRONT);
		TextOutA("\c[RED]Why?");
		MoveChar(LEFT, BACK);

		MoveChar(RIGHT, FRONT);
		TextOutA("\c[PURPLE]because the demo end here.");
		MoveChar(RIGHT, BACK);

		MoveChar(LEFT, FRONT);
		TextOutA("\c[RED]Thank for that...");
		MoveChar(LEFT, BACK);

		SetStep(1);
		MoveChar(RIGHT, FRONT);
		TextOutA("\c[PURPLE]Sorry. Take care of yourself sis.");
		MoveChar(RIGHT, BACK);
		SetStep(2);

	}






		End;

	}

	@Finalize
	{


	DeleteGraphic(chara21);
	DeleteGraphic(chara22);
	DeleteGraphic(chara23);
	DeleteGraphic(chara24);
	DeleteGraphic(chara25);

	}

}