task Stage6
{
	StageProgress=6;
	CreateEnemyFromFile(csd~"stage6/LoadEnemy.txt",0,0,0,0,0);
	DeleteMusic(BGM[10]);
	PlayMusic(BGM[11]);
	wait(180);
	Stage6Unit1;
	wait(240);
	Stage6Unit2;
	wait(240);
	Stage6Unit3;
	wait(900);
	CreateEnemyFromFile(csd~"stage6/Stage6Enemy01.txt",GetCenterX,GetClipMinY,1,90,1);
	WaitForZeroEnemy();
	wait(600);
	DeleteMusic(BGM[11]);
	PlayMusic(BGM[12]);
	CreateEnemyFromFile(csd~"stage6/DeleteEnemy.txt",0,0,0,0,0);
	if(SelectedCharacter==DefinedPlayer1 || SelectedCharacter==DefinedPlayer2)
	{
			alternative(SelectedDifficult)
			case("Easy")
			{
				CreateEnemyBossFromFile(csd~"stage6/Stage6BossEasyReimu.txt",GetCenterX,GetClipMinY,2,0,0);
			}
			case("Normal")
			{
				CreateEnemyBossFromFile(csd~"stage6/Stage6BossNormalReimu.txt",GetCenterX,GetClipMinY,2,0,0);
			}
			case("Hard")
			{
				CreateEnemyBossFromFile(csd~"stage6/Stage6BossHardReimu.txt",GetCenterX,GetClipMinY,2,0,0);
			}
			case("Lunatic")
			{
				CreateEnemyBossFromFile(csd~"stage6/Stage6BossLunaticReimu.txt",GetCenterX,GetClipMinY,2,0,0);
			}
			case("Extra")
			{
				CreateEnemyBossFromFile(csd~"stage6/Stage6BossExtraReimu.txt",GetCenterX,GetClipMinY,2,0,0);
			}
	}
	else
	{
			alternative(SelectedDifficult)
			case("Easy")
			{
				CreateEnemyBossFromFile(csd~"stage6/Stage6BossEasyMarisa.txt",GetCenterX,GetClipMinY,2,0,0);
			}
			case("Normal")
			{
				CreateEnemyBossFromFile(csd~"stage6/Stage6BossNormalMarisa.txt",GetCenterX,GetClipMinY,2,0,0);
			}
			case("Hard")
			{
				CreateEnemyBossFromFile(csd~"stage6/Stage6BossHardMarisa.txt",GetCenterX,GetClipMinY,2,0,0);
			}
			case("Lunatic")
			{
				CreateEnemyBossFromFile(csd~"stage6/Stage6BossLunaticMarisa.txt",GetCenterX,GetClipMinY,2,0,0);
			}
			case("Extra")
			{
				CreateEnemyBossFromFile(csd~"stage6/Stage6BossExtraMarisa.txt",GetCenterX,GetClipMinY,2,0,0);
			}
	}
			WaitForZeroEnemy();
			wait(300);
	StageProgress=7;
}


task Stage6Unit1
{
loop(5)
{
	CreateEnemyFromFile(csd~"stage6/Stage6Enemy02.txt",GetClipMinX,GetCenterY-120,2,0,1);
wait(20);
}
}

task Stage6Unit2
{
loop(5)
{
	CreateEnemyFromFile(csd~"stage6/Stage6Enemy02.txt",GetClipMaxX,GetCenterY-120,2,180,1);
wait(20);
}
}

task Stage6Unit3
{
loop(50)
{
	CreateEnemyFromFile(csd~"stage6/Stage6Enemy02.txt",GetClipMaxX,GetCenterY-rand(80,160),2,180,1);
	wait(5);
	CreateEnemyFromFile(csd~"stage6/Stage6Enemy02.txt",GetClipMinX,GetCenterY-rand(80,160),2,0,1);
	wait(5);
}
}