script_enemy_main
{

	#include_function".\stage2_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\04-s2bt.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\Rood_f1.png";
       	let chara22 = GetCurrentScriptDirectory~"..\img\boss\Rood_f2.png";
       	let chara23 = GetCurrentScriptDirectory~"..\img\boss\Rood_f3.png";
       	let chara24 = GetCurrentScriptDirectory~"..\img\boss\Rood_f4.png";
       	let chara25 = GetCurrentScriptDirectory~"..\img\boss\Rood_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]This building look strange.");
		TextOutA("\c[RED]People here too...");
		MoveChar(LEFT, BACK);

		SetStep(1);
		SetChar(RIGHT, chara22);
		SetGraphicRect(RIGHT, 1, 1, 200, 320);
		MoveChar(RIGHT, FRONT);
		TextOutA("\c[GREEN]That not cool ma'am.");
		TextOutA("\c[GREEN]Each people have their own \ninterest and style.");
		MoveChar(RIGHT, BACK);

		MoveChar(LEFT, FRONT);
		TextOutA("\c[RED]I know.");
		TextOutA("\c[RED]You are Nurture?");
		MoveChar(LEFT, BACK);

		SetChar(RIGHT, chara21);
		MoveChar(RIGHT, FRONT);
		TextOutA("\c[GREEN]Noo....");
		SetStep(2);
		SetNameFromText(RIGHT, TEXT_GREEN, "Rood Walker", "The Chief Engineer");
		TextOutA("\c[GREEN]I'm Rood Walker, The Chief Engineer.");
		TextOutA("\c[GREEN]Are you looking for him?");
		MoveChar(RIGHT, BACK);

		MoveChar(LEFT, FRONT);
		TextOutA("\c[RED]Yes. I have to solve this problem \nas fast as I can.");
		MoveChar(LEFT, BACK);

		SetStep(3);
		MoveChar(RIGHT, FRONT);
		TextOutA("\c[GREEN]Ummmmm.");
		TextOutA("\c[GREEN]Did you interest in fighting me?");
		SetChar(RIGHT, chara24);
		TextOutA("\c[GREEN]If you win, I'll tell what you want \nto know.");
		MoveChar(RIGHT, BACK);

		MoveChar(LEFT, FRONT);
		TextOutA("\c[RED]Why they've to be like this...");
		MoveChar(LEFT, BACK);

		SetChar(RIGHT, chara21);
		MoveChar(RIGHT, FRONT);
		TextOutA("\c[GREEN]They?");
		MoveChar(RIGHT, BACK);

		MoveChar(LEFT, FRONT);
		TextOutA("\c[RED]Nevermind...");
		TextOutA("\c[RED]Time to teach some danmaku lesson!");
		MoveChar(LEFT, BACK);

		SetChar(RIGHT, chara24);
		MoveChar(RIGHT, FRONT);
		TextOutA("\c[GREEN]That's Cool!");
		MoveChar(RIGHT, BACK);
		SetStep(4);
	}








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

		MoveChar(LEFT, FRONT);
		TextOutA("\c[RED]Fuuu those strange thing stop \nchasing me.");
		TextOutA("\c[RED]What are they? \nI can't feel any magic from them.");
		MoveChar(LEFT, BACK);

		SetStep(1);
		SetChar(RIGHT, chara22);
		SetGraphicRect(RIGHT, 1, 1, 200, 320);
		MoveChar(RIGHT, FRONT);
		TextOutA("\c[GREEN]They are robot ma'am.");
		TextOutA("\c[GREEN]Just like another kind of magic...");
		TextOutA("\c[GREEN]Wooo it hard to explain.");
		MoveChar(RIGHT, BACK);

		MoveChar(LEFT, FRONT);
		TextOutA("\c[RED]Hmm? who are you?");
		MoveChar(LEFT, BACK);

		SetChar(RIGHT, chara21);
		MoveChar(RIGHT, FRONT);
		SetStep(2);
		SetNameFromText(RIGHT, TEXT_GREEN, "Rood Walker", "The Chief Engineer");
		TextOutA("\c[GREEN]I'm Rood Walker, The Chief Engineer.");
		TextOutA("\c[GREEN]I'm the one who develop those thing.");
		MoveChar(RIGHT, BACK);

		MoveChar(LEFT, FRONT);
		TextOutA("\c[RED]Can I borrow some?");
		MoveChar(LEFT, BACK);

		MoveChar(RIGHT, FRONT);
		TextOutA("\c[GREEN]Ummmmm.");
		TextOutA("\c[GREEN]They have better robot as a prize \nof this festival too if you interest.");
		TextOutA("\c[GREEN]And I want that robot too.");
		MoveChar(RIGHT, BACK);

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

		SetChar(RIGHT, chara24);
		MoveChar(RIGHT, FRONT);
		SetStep(3);
		TextOutA("\c[GREEN]Look like we thinking the same thing, \nright?");
		MoveChar(RIGHT, BACK);

		MoveChar(LEFT, FRONT);
		TextOutA("\c[RED]I love an easy choice like this.");
		MoveChar(LEFT, BACK);

		SetChar(RIGHT, chara21);
		MoveChar(RIGHT, FRONT);
		TextOutA("\c[GREEN]Me too.");
		TextOutA("\c[GREEN]If I win you can get my guarding \nbot as solace.");
		TextOutA("\c[GREEN]If I lose you get more chance for \nthe big one!");
		MoveChar(RIGHT, BACK);

		MoveChar(LEFT, FRONT);
		TextOutA("\c[RED]Bigger always better!!");
		MoveChar(LEFT, BACK);
		SetStep(4);
	}









	else
	{

		MoveChar(LEFT, FRONT);
		TextOutA("\c[RED]So huge...");
		TextOutA("\c[RED]That creepy thing stop following me.");
		MoveChar(LEFT, BACK);

		SetStep(1);
		SetChar(RIGHT, chara25);
		SetGraphicRect(RIGHT, 1, 1, 200, 320);
		MoveChar(RIGHT, FRONT);
		TextOutA("\c[GREEN]Look like guarding bot don't get \nso much love.");
		MoveChar(RIGHT, BACK);

		MoveChar(LEFT, FRONT);
		TextOutA("\c[RED]Who can love a thing that attack them?");
		TextOutA("\c[RED]You are the owner of those doll?");
		MoveChar(LEFT, BACK);

		MoveChar(RIGHT, FRONT);
		TextOutA("\c[GREEN]Not exactly. \nHowever, I'll some responsibility in it too.");
		MoveChar(RIGHT, BACK);

		MoveChar(LEFT, FRONT);
		TextOutA("\c[RED]So, who are you?");
		MoveChar(LEFT, BACK);

		SetChar(RIGHT, chara21);
		MoveChar(RIGHT, FRONT);
		SetStep(2);
		SetNameFromText(RIGHT, TEXT_GREEN, "Rood Walker", "The Chief Engineer");
		TextOutA("\c[GREEN]I'm Rood Walker, The Chief Engineer.");
		TextOutA("\c[GREEN]Why are you wondering here?");
		MoveChar(RIGHT, BACK);

		MoveChar(LEFT, FRONT);
		TextOutA("\c[RED]Well, looking for some score, I guess.");
		MoveChar(LEFT, BACK);

		SetStep(3);
		SetChar(RIGHT, chara22);
		MoveChar(RIGHT, FRONT);
		TextOutA("\c[GREEN]Ohhhhhhh.");
		TextOutA("\c[GREEN]So who will give a score to \nwhom?, I guess.");
		MoveChar(RIGHT, BACK);

		MoveChar(LEFT, FRONT);
		TextOutA("\c[RED]You're competitor too?");
		MoveChar(LEFT, BACK);

		SetChar(RIGHT, chara24);
		MoveChar(RIGHT, FRONT);
		TextOutA("\c[GREEN]Absolute.");
		MoveChar(RIGHT, BACK);

		MoveChar(LEFT, FRONT);
		TextOutA("\c[RED]Time for mome score!");
		MoveChar(LEFT, BACK);

		SetChar(RIGHT, chara21);
		MoveChar(RIGHT, FRONT);
		TextOutA("\c[GREEN]Of course!");
		MoveChar(RIGHT, BACK);
		SetStep(4);
	}

		End;


	}

	@Finalize
	{

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

	}
}
