script_enemy_main
{

	#include_function".\stage1_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\02-s1bt.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\Rosa_f1.png";
       	let chara22 = GetCurrentScriptDirectory~"..\img\boss\Rosa_f2.png";
       	let chara23 = GetCurrentScriptDirectory~"..\img\boss\Rosa_f3.png";
       	let chara24 = GetCurrentScriptDirectory~"..\img\boss\Rosa_f4.png";
       	let chara25 = GetCurrentScriptDirectory~"..\img\boss\Rosa_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]Ah... crossroad.");
		TextOutA("\c[RED]Hmm, which way I should go \nnext?");
		MoveChar(LEFT, BACK);

		SetStep(1);
		SetChar(RIGHT, chara21);
		SetGraphicRect(RIGHT, 1, 1, 200, 320);
		MoveChar(RIGHT, FRONT);
		TextOutA("\c[AQUA]Miss, do you want to join \nour festival?");
		SetStep(2);
		SetNameFromText(RIGHT, TEXT_AQUA, "Rosa Selina", "The Operator");
		TextOutA("\c[AQUA]I'm Rosa Selina. As the operator, \nI welcome you.");
		MoveChar(RIGHT, BACK);

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

		SetChar(RIGHT, chara23);
		MoveChar(RIGHT, FRONT);
		TextOutA("\c[AQUA]Eh?");
		TextOutA("\c[AQUA]Ah..");
		SetChar(RIGHT, chara25);
		TextOutA("\c[AQUA]I'm sorry for that.");
		MoveChar(RIGHT, BACK);

		MoveChar(LEFT, FRONT);
		TextOutA("\c[RED]Fine, that's normal for me.");
		TextOutA("\c[RED]Do you know why this place \npop up here?");
		MoveChar(LEFT, BACK);

		SetChar(RIGHT, chara21);
		MoveChar(RIGHT, FRONT);
		TextOutA("\c[AQUA]I'm sorry, we are still \ninvestigating in that.");
		MoveChar(RIGHT, BACK);

		MoveChar(LEFT, FRONT);
		TextOutA("\c[RED]And you just provide the festival?");
		MoveChar(LEFT, BACK);

		MoveChar(RIGHT, FRONT);
		TextOutA("\c[AQUA]Yes.");
		MoveChar(RIGHT, BACK);

		MoveChar(LEFT, FRONT);
		TextOutA("\c[RED]Shooting festival...");
		TextOutA("\c[RED]Sounds like danmaku.");
		MoveChar(LEFT, BACK);

		MoveChar(RIGHT, FRONT);
		TextOutA("\c[AQUA]It differed a bit for more \nchallenge, Miss.");
		TextOutA("\c[AQUA]That you'll get score count for \nbeating each people who's in.");
		MoveChar(RIGHT, BACK);

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

		SetStep(3);
		MoveChar(RIGHT, FRONT);
		TextOutA("\c[AQUA]For the prize, Miss.");
		TextOutA("\c[AQUA]I've heard that you're an expert \ntoo, don't you?");
		MoveChar(RIGHT, BACK);

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








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

		MoveChar(LEFT, FRONT);
		TextOutA("\c[RED]Looks like I've to guess \nthe way?");
		TextOutA("\c[RED]Fine, Show me the way!");
		MoveChar(LEFT, BACK);

		SetStep(1);
		SetChar(RIGHT, chara21);
		SetGraphicRect(RIGHT, 1, 1, 200, 320);
		MoveChar(RIGHT, FRONT);
		TextOutA("\c[AQUA]Welcome, guest.");
		TextOutA("\c[AQUA]Do you want to join our festival?");
		MoveChar(RIGHT, BACK);

		MoveChar(LEFT, FRONT);
		TextOutA("\c[RED]Can this count as work?");
		MoveChar(LEFT, BACK);

		SetChar(RIGHT, chara23);
		MoveChar(RIGHT, FRONT);
		TextOutA("\c[AQUA]Work?");
		MoveChar(RIGHT, BACK);

		MoveChar(LEFT, FRONT);
		TextOutA("\c[RED]Nevermind. What festival you're \ntalking about?");
		MoveChar(LEFT, BACK);

		SetChar(RIGHT, chara21);
		MoveChar(RIGHT, FRONT);
		TextOutA("\c[AQUA]Shooting festival, similar to your \ndanmaku playing.");
		TextOutA("\c[AQUA]If you beat lots of people \nyou'll get some goods.");
		MoveChar(RIGHT, BACK);

		MoveChar(LEFT, FRONT);
		TextOutA("\c[RED]Sound interesting.");
		TextOutA("\c[RED]Ok! You're my first score!");
		MoveChar(LEFT, BACK);

		SetChar(RIGHT, chara22);
		MoveChar(RIGHT, FRONT);
		TextOutA("\c[AQUA]Wha! That's so sudden!");
		MoveChar(RIGHT, BACK);

		MoveChar(LEFT, FRONT);
		TextOutA("\c[RED]You're the one who attacked me \nfirst back then! Don't you?");
		MoveChar(LEFT, BACK);

		SetChar(RIGHT, chara25);
		MoveChar(RIGHT, FRONT);
		TextOutA("\c[AQUA]Oh... well, so I've no choices, \nthen.");
		SetStep(2);
		SetNameFromText(RIGHT, TEXT_AQUA, "Rosa Selina", "The Operator");
		SetChar(RIGHT, chara24);
		TextOutA("\c[AQUA]I, Rosa Selina, hereby accepted \nyour challenge!");
		MoveChar(RIGHT, BACK);

		SetStep(3);
		MoveChar(LEFT, FRONT);
		TextOutA("\c[RED]Bring it on!");
		MoveChar(LEFT, BACK);
		SetStep(4);
	}









	else
	{

		MoveChar(RIGHT, FRONT);
		TextOutA("\c[RED]Where is that girl?");
		MoveChar(RIGHT, BACK);

		SetStep(1);
		SetChar(RIGHT, chara21);
		SetGraphicRect(RIGHT, 1, 1, 200, 320);
		MoveChar(RIGHT, FRONT);
		TextOutA("\c[AQUA]Welcome, guest.");
		TextOutA("\c[AQUA]Do you want to join our festival.");
		MoveChar(RIGHT, BACK);

		MoveChar(LEFT, FRONT);
		TextOutA("\c[RED]Ah! Enemy detected!");
		MoveChar(LEFT, BACK);

		MoveChar(RIGHT, FRONT);
		TextOutA("\c[AQUA]Wha! wait miss! \nI'm not your enemy!");
		MoveChar(RIGHT, BACK);

		MoveChar(LEFT, FRONT);
		TextOutA("\c[RED]You guys shot me and ran away!");
		TextOutA("\c[RED]That's enough to justify my \ncounterattack!");
		MoveChar(LEFT, BACK);

		SetChar(RIGHT, chara25);
		MoveChar(RIGHT, FRONT);
		TextOutA("\c[AQUA]I'm sorry for that.");
		TextOutA("\c[AQUA]It's our greeting traditions for \nthis festival.");
		MoveChar(RIGHT, BACK);

		MoveChar(LEFT, FRONT);
		TextOutA("\c[RED]What festival you two talking about?");
		MoveChar(LEFT, BACK);

		SetChar(RIGHT, chara23);
		MoveChar(RIGHT, FRONT);
		TextOutA("\c[AQUA]Two?");
		MoveChar(RIGHT, BACK);

		MoveChar(LEFT, FRONT);
		TextOutA("\c[RED]The girl with blue hair I fought \nbefore.");
		MoveChar(LEFT, BACK);

		SetChar(RIGHT, chara22);
		MoveChar(RIGHT, FRONT);
		TextOutA("\c[AQUA]Oh. That must be Miss Felia.");
		MoveChar(RIGHT, BACK);

		MoveChar(LEFT, FRONT);
		TextOutA("\c[RED]Oh.. I remember her name now. \nThat girl told me about festival too.");
		MoveChar(LEFT, BACK);

		SetChar(RIGHT, chara21);
		MoveChar(RIGHT, FRONT);
		TextOutA("\c[AQUA]We are holding a shooting \nfestival for a week.");
		TextOutA("\c[AQUA]Would you like to join? \nWe open for everyone.");
		MoveChar(RIGHT, BACK);

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

		SetChar(RIGHT, chara24);
		MoveChar(RIGHT, FRONT);
		SetStep(2);
		SetNameFromText(RIGHT, TEXT_AQUA, "Rosa Selina", "The Operator");
		TextOutA("\c[AQUA]So, I'm Rosa Selina welcome \nyou to our festival.");
		TextOutA("\c[AQUA]Take your time and challenge \nany people around here as you wish.");
		MoveChar(RIGHT, BACK);

		MoveChar(LEFT, FRONT);
		TextOutA("\c[RED]Then, I challenge you first!");
		MoveChar(LEFT, BACK);

		SetStep(3);
		MoveChar(RIGHT, FRONT);
		TextOutA("\c[AQUA]Gladly!");
		MoveChar(RIGHT, BACK);

		SetStep(4);
	}

		End;


	}

	@Finalize
	{

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

	}
}
