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
	while (GetEventStep() != 1)	{	yield;	}
	SetMovePosition03(GetCenterX, GetClipMinY + 96, 20, 5);
	SetEnemyMarker(true);
	while (GetEventStep() != 2)	{	yield;	}
	SetCommonData("CD_BossFight", 1);		// Boss Fight
	while (GetEventStep() != 3)	{	yield;	}
	PlayMusic(GetCurrentScriptDirectory~"..\music\06-s3bt.mp3");
	while (GetEventStep() != 4)	{	yield;	}
	SetCommonData("ng_feverdecrease", 1);	// Fever score DECREASE!
	bgm = true;
	}

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

	@MainLoop
	{
	if( !OnEvent() && bgm) {	AddLife(-1);	}
	yield;
	count++;
	}

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

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

script_event stage0_bosspre
	{

       	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))
	{


		SetStep(1);
		SetChar(RIGHT, chara23);
		SetGraphicRect(RIGHT, 1, 1, 200, 320);
		MoveChar(RIGHT, FRONT);
		TextOutA("\c[PURPLE]Sorry for keep you waiting sis.");
		MoveChar(RIGHT, BACK);

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

		SetChar(RIGHT, chara21);
		MoveChar(RIGHT, FRONT);
		TextOutA("\c[PURPLE]Leader is checking data inside.");
		TextOutA("\c[PURPLE]Outsider are not allow to enter.");
		MoveChar(RIGHT, BACK);

		MoveChar(LEFT, FRONT);
		TextOutA("\c[RED]I have to ask him something.");
		MoveChar(LEFT, BACK);

		MoveChar(RIGHT, FRONT);
		TextOutA("\c[PURPLE]Can you wait for a bit sis?");
		SetChar(RIGHT, chara22);
		TextOutA("\c[PURPLE]If you are competitor, \nyou can compete with me too.");
		MoveChar(RIGHT, BACK);

		MoveChar(LEFT, FRONT);
		TextOutA("\c[RED]Better than waiting.");
		MoveChar(LEFT, BACK);

		SetStep(2);
		SetChar(RIGHT, chara24);
		SetNameFromText(RIGHT, TEXT_PURPLE, "Sona S Sonata", "Laboratory Keeper");
		MoveChar(RIGHT, FRONT);
		TextOutA("\c[PURPLE]Thank you sis. I'm Sona S Sonata. \nYou can call me Sona if you want.");
		TextOutA("\c[PURPLE]I'm the keeper of this laboratory.");
		MoveChar(RIGHT, BACK);

		MoveChar(LEFT, FRONT);
		TextOutA("\c[RED]Small youkai always have high \nresponsibility...");
		MoveChar(LEFT, BACK);

		SetChar(RIGHT, chara25);
		MoveChar(RIGHT, FRONT);
		TextOutA("\c[PURPLE]I'm not a youkai sis!");
		MoveChar(RIGHT, BACK);

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

		MoveChar(RIGHT, FRONT);
		TextOutA("\c[PURPLE]Not cursed too sis!");
		MoveChar(RIGHT, BACK);

		SetStep(3);
		MoveChar(LEFT, FRONT);
		TextOutA("\c[RED]Ok, ok. Whatever you be.");
		TextOutA("\c[RED]Now show me your danmaku.");
		MoveChar(LEFT, BACK);

		SetChar(RIGHT, chara24);
		MoveChar(RIGHT, FRONT);
		TextOutA("\c[PURPLE]Ok, sis!");
		MoveChar(RIGHT, BACK);
		SetStep(4);
	}








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

		MoveChar(LEFT, FRONT);
		TextOutA("\c[RED]Those thing keep attack me.");
		TextOutA("\c[RED]What kind of magic to control them?");
		MoveChar(LEFT, BACK);

		SetStep(1);
		SetChar(RIGHT, chara25);
		SetGraphicRect(RIGHT, 1, 1, 200, 320);
		MoveChar(RIGHT, FRONT);
		TextOutA("\c[PURPLE]It hard to explain sis, but yes.");
		TextOutA("\c[PURPLE]It like another kind ... type of magic.");
		MoveChar(RIGHT, BACK);

		MoveChar(LEFT, FRONT);
		TextOutA("\c[RED]That guy told me the same thing.");
		TextOutA("\c[RED]Can I borrow some of them for \nresearch?");
		MoveChar(LEFT, BACK);

		SetChar(RIGHT, chara23);
		MoveChar(RIGHT, FRONT);
		TextOutA("\c[PURPLE]I guess it'll be fine if leader \nallowed that sis.");
		MoveChar(RIGHT, BACK);

		MoveChar(LEFT, FRONT);
		TextOutA("\c[RED]So I need to ask your leader?");
		TextOutA("\c[RED]Why I can't borrow it from you?");
		MoveChar(LEFT, BACK);

		SetChar(RIGHT, chara25);
		MoveChar(RIGHT, FRONT);
		TextOutA("\c[PURPLE]I'm not their owner, sis.");
		MoveChar(RIGHT, BACK);

		MoveChar(LEFT, FRONT);
		TextOutA("\c[RED]Ok, ok, so where is your leader?");
		MoveChar(LEFT, BACK);

		SetChar(RIGHT, chara21);
		MoveChar(RIGHT, FRONT);
		TextOutA("\c[PURPLE]He checking the data inside sis.");
		TextOutA("\c[PURPLE]Outsider prohibited from entering.");
		MoveChar(RIGHT, BACK);

		MoveChar(LEFT, FRONT);
		TextOutA("\c[RED]If I defeat you, can I enter?");
		MoveChar(LEFT, BACK);

		SetChar(RIGHT, chara21);
		MoveChar(RIGHT, FRONT);
		TextOutA("\c[PURPLE]No sis. You need a key to enter \nthat area.");
		TextOutA("\c[PURPLE]This place contain some strange magic.");
		SetChar(RIGHT, chara23);
		TextOutA("\c[PURPLE]It will explode really violently.");
		TextOutA("\c[PURPLE]If you try to open the door without \nthe key.");
		MoveChar(RIGHT, BACK);

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

		SetChar(RIGHT, chara21);
		MoveChar(RIGHT, FRONT);
		TextOutA("\c[PURPLE]Can you compete with me instead?");
		TextOutA("\c[PURPLE]While waiting for leader to finish \nhis checking.");
		SetStep(2);
		SetNameFromText(RIGHT, TEXT_PURPLE, "Sona S Sonata", "Laboratory Keeper");
		TextOutA("\c[PURPLE]I'm Sona S Sonata. \nAs the keeper of this laboratory.");
		TextOutA("\c[PURPLE]I've responsibility to take care any \nguests here.");
		MoveChar(RIGHT, BACK);
		SetStep(3);

		MoveChar(LEFT, FRONT);
		TextOutA("\c[RED]Oh. You are competitor too, right?");
		TextOutA("\c[RED]Time to get some more score!");
		MoveChar(LEFT, BACK);

		MoveChar(LEFT, FRONT);
		TextOutA("\c[PURPLE]If you can sis!");
		MoveChar(LEFT, BACK);
		SetStep(4);

	}









	else
	{

		MoveChar(LEFT, FRONT);
		TextOutA("\c[RED]Wow. As creepy as he said.");
		TextOutA("\c[RED]What the hell of this place.");
		MoveChar(LEFT, BACK);

		SetStep(1);
		SetChar(RIGHT, chara25);
		SetGraphicRect(RIGHT, 1, 1, 200, 320);
		MoveChar(RIGHT, FRONT);
		TextOutA("\c[PURPLE]That rude sis...");
		TextOutA("\c[PURPLE]At least it have it own usage.");
		MoveChar(RIGHT, BACK);

		MoveChar(LEFT, FRONT);
		TextOutA("\c[RED]Are you another competitor?");
		MoveChar(LEFT, BACK);

		SetChar(RIGHT, chara22);
		MoveChar(RIGHT, FRONT);
		TextOutA("\c[PURPLE]In the festival?");
		TextOutA("\c[PURPLE]If that, yes, sis.");
		MoveChar(RIGHT, BACK);

		MoveChar(LEFT, FRONT);
		TextOutA("\c[RED]Now tell me your name and \nshow your proudly spell card!");
		MoveChar(LEFT, BACK);

		MoveChar(RIGHT, FRONT);
		TextOutA("\c[PURPLE]Is that line from some manga or \ngame?");
		SetChar(RIGHT, chara21);
		SetStep(2);
		SetNameFromText(RIGHT, TEXT_PURPLE, "Sona S Sonata", "Laboratory Keeper");
		TextOutA("\c[PURPLE]I'm Sona S Sonata, \nThe Laboratory Keeper.");
		TextOutA("\c[PURPLE]Will accept your courage!");
		MoveChar(RIGHT, BACK);

		MoveChar(LEFT, FRONT);
		TextOutA("\c[RED]..... so easy to instiage.");
		MoveChar(LEFT, BACK);

		SetChar(RIGHT, chara25);
		MoveChar(RIGHT, FRONT);
		TextOutA("\c[PURPLE]Do treat me like that sis...");
		MoveChar(RIGHT, BACK);

		MoveChar(LEFT, FRONT);
		TextOutA("\c[RED]Enough for a joke.");
		TextOutA("\c[RED]And now give me your score!");
		MoveChar(LEFT, BACK);

		SetStep(3);
		SetChar(RIGHT, chara24);
		MoveChar(RIGHT, FRONT);
		TextOutA("\c[PURPLE]If you can get it from me sis!");
		MoveChar(RIGHT, BACK);
		SetStep(4);

	}

		End;


	}

	@Finalize
	{

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

	}
}
