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


		SetChar(RIGHT, chara25);
		SetGraphicRect(RIGHT, 1, 1, 200, 320);
		MoveChar(RIGHT, FRONT);
		SetNameFromText(RIGHT, TEXT_GREEN, "Rood Walker", "The Chief Engineer");
		TextOutA("\c[GREEN]I lose!");
		TextOutA("\c[GREEN]All my bot are mess up! Wow!");
		MoveChar(RIGHT, BACK);

		MoveChar(LEFT, FRONT);
		TextOutA("\c[RED]Now tell me where he is.");
		MoveChar(LEFT, BACK);

		SetChar(RIGHT, chara21);
		MoveChar(RIGHT, FRONT);
		TextOutA("\c[GREEN]Ok ma,am.");
		TextOutA("\c[GREEN]Last hour I see him in the laboratory.");
		MoveChar(RIGHT, BACK);

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

		MoveChar(RIGHT, FRONT);
		TextOutA("\c[GREEN]It's a even more strange than this \nbuilding.");
		TextOutA("\c[GREEN]At the north west of this building.");
		MoveChar(RIGHT, BACK);

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

		SetChar(RIGHT, chara25);
		MoveChar(RIGHT, FRONT);
		TextOutA("\c[GREEN]It not that bad.");
		TextOutA("\c[GREEN]But I'm not sure that he's still \nthere now.");
		TextOutA("\c[GREEN]However, it better to look for him \nover there.");
		SetStep(1);
		SetChar(RIGHT, chara21);
		TextOutA("\c[GREEN]I have to back to my job. \nSee you ma'am.");
		MoveChar(RIGHT, BACK);

		MoveChar(LEFT, FRONT);
		TextOutA("\c[RED]Just like play tag...");
		MoveChar(LEFT, BACK);
		SetStep(2);
	}








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

		SetChar(RIGHT, chara25);
		SetGraphicRect(RIGHT, 1, 1, 200, 320);
		MoveChar(RIGHT, FRONT);
		SetNameFromText(RIGHT, TEXT_GREEN, "Rood Walker", "The Chief Engineer");
		TextOutA("\c[GREEN]You owned my bot!");
		MoveChar(RIGHT, BACK);

		MoveChar(LEFT, FRONT);
		TextOutA("\c[RED]Better alway better!");
		MoveChar(LEFT, BACK);

		SetChar(RIGHT, chara21);
		MoveChar(RIGHT, FRONT);
		TextOutA("\c[GREEN]Ok, ok, I surrender.");
		TextOutA("\c[GREEN]Sometime easy choice is alway \nharder than I thought.");
		MoveChar(RIGHT, BACK);

		MoveChar(LEFT, FRONT);
		TextOutA("\c[RED]Where is the next peason?");
		MoveChar(LEFT, BACK);

		SetChar(RIGHT, chara25);
		MoveChar(RIGHT, FRONT);
		TextOutA("\c[GREEN]Hmmmm? I don't know too.");
		TextOutA("\c[GREEN]Everyone wonder around. \nSo you may need to do the same thing.");
		MoveChar(RIGHT, BACK);

		MoveChar(LEFT, FRONT);
		TextOutA("\c[RED]Geez, ok, no choice right?");
		MoveChar(LEFT, BACK);

		SetChar(RIGHT, chara23);
		MoveChar(RIGHT, FRONT);
		TextOutA("\c[GREEN]Yes, I'll back to my work now.");
		SetChar(RIGHT, chara24);
		TextOutA("\c[GREEN]Be carefull! I still have more time \nto get that robot!");
		MoveChar(RIGHT, BACK);

		SetStep(1);
		MoveChar(LEFT, FRONT);
		TextOutA("\c[RED]I'll get it for sure!");
		MoveChar(LEFT, BACK);
		SetStep(2);
	}









	else
	{
		SetChar(RIGHT, chara25);
		SetGraphicRect(RIGHT, 1, 1, 200, 320);
		MoveChar(RIGHT, FRONT);
		SetNameFromText(RIGHT, TEXT_GREEN, "Rood Walker", "The Chief Engineer");
		TextOutA("\c[GREEN]I lose!");
		MoveChar(RIGHT, BACK);

		MoveChar(LEFT, FRONT);
		TextOutA("\c[RED]Score -GET!-");
		MoveChar(LEFT, BACK);

		SetChar(RIGHT, chara23);
		MoveChar(RIGHT, FRONT);
		TextOutA("\c[GREEN]I guess next time I have to \nimprove myself than upgrading my bot.");
		MoveChar(RIGHT, BACK);

		MoveChar(LEFT, FRONT);
		TextOutA("\c[RED]Owner must stronger than their doll. \nIt's a basic.");
		MoveChar(LEFT, BACK);

		SetChar(RIGHT, chara21);
		MoveChar(RIGHT, FRONT);
		TextOutA("\c[GREEN]That right. But sometime."); 
		TextOutA("\c[GREEN]Human create something stronger \nto protect themself.");
		MoveChar(RIGHT, BACK);

		MoveChar(LEFT, FRONT);
		TextOutA("\c[RED]And got beaten so easies."); 
		TextOutA("\c[RED]When they have nothing to protect \nthem.");
		MoveChar(LEFT, BACK);

		MoveChar(RIGHT, FRONT);
		TextOutA("\c[GREEN]Hahaha I'll remember that.");
		MoveChar(RIGHT, BACK);

		MoveChar(LEFT, FRONT);
		TextOutA("\c[RED]To the bottom of your heart!");
		MoveChar(LEFT, BACK);

		SetChar(RIGHT, chara25);
		MoveChar(RIGHT, FRONT);
		TextOutA("\c[GREEN]Haha I got it, I got it.");
		MoveChar(RIGHT, BACK);

		MoveChar(LEFT, FRONT);
		TextOutA("\c[RED]Where is the next place I have \nto go now...?");
		MoveChar(LEFT, BACK);

		SetChar(RIGHT, chara21);
		MoveChar(RIGHT, FRONT);
		TextOutA("\c[GREEN]Wanna looks at the laboratory at \nthe north east from here?.");
		TextOutA("\c[GREEN]But it may be more strange \nthan this one.");
		SetChar(RIGHT, chara22);
		TextOutA("\c[GREEN]Hmm? what that now?");
		SetStep(1);
		TextOutA("\c[GREEN]Sorry ma'am I have to go now.");
		MoveChar(RIGHT, BACK);

		MoveChar(LEFT, FRONT);
		TextOutA("\c[RED]Even more?");
		MoveChar(LEFT, BACK);
		SetStep(2);

	}






		End;

	}

	@Finalize
	{


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

	}

}