task Area1Stage1{
	bgmovX=0;
	bgmovY=0;
	StageInit;
	PlayMusic(ar1bgm1);
	loop(100){yield;}
		CreateEnemyFromFile(GCSD~"A_1/talk01.txt", GetClipMinX-1500, GetClipMinY-1500, 0, 0, 0);
		while(GetEnemyNum!=0){yield;}
	loop(100){yield;}
	CreateTimer(3040, GetCenterX-40, GetClipMinY);
	ascent(i in 2..8){
		CreateEnemyFromFile(GCSD~"A_1/Enemy1.txt", GetClipMinX-5, GetClipMinY+i*20, 0, 0, 0);
		loop(10){yield;}
	}
	loop(60){yield;}
	ascent(i in 2..8){
		CreateEnemyFromFile(GCSD~"A_1/Enemy1.txt", GetClipMaxX+5, GetClipMinY+i*20, 0, 0, 0);
		loop(10){yield;}
	}
	loop(60){yield;}
	ascent(i in 2..8){
		CreateEnemyFromFile(GCSD~"A_1/Enemy2.txt", GetClipMinX+i*30, GetClipMinY-5, 0, 0, 0);
		CreateEnemyFromFile(GCSD~"A_1/Enemy2.txt", GetClipMaxX-i*30, GetClipMinY-5, 0, 0, 0);
		loop(20){yield;}
	}
	loop(250){yield;}
	CreateEnemyFromFile(GCSD~"A_1/Enemy3.txt", GetCenterX, GetClipMinY-10, 0, 0, 0);
	ascent(i in 2..8){
		CreateEnemyFromFile(GCSD~"A_1/Enemy1.txt", GetClipMinX-5, GetClipMinY+i*20, 0, 0, 0);
		CreateEnemyFromFile(GCSD~"A_1/Enemy1.txt", GetClipMaxX+5, GetClipMinY+i*20, 0, 0, 0);
		loop(10){yield;}
	}
	ascent(i in 2..8){
		CreateEnemyFromFile(GCSD~"A_1/Enemy2.txt", GetClipMinX+i*30, GetClipMinY-5, 0, 0, 0);
		CreateEnemyFromFile(GCSD~"A_1/Enemy2.txt", GetClipMaxX-i*30, GetClipMinY-5, 0, 0, 0);
		loop(5){yield;}
	}
	loop(400){yield;}
	CreateEnemyFromFile(GCSD~"A_1/Enemy3.txt", GetCenterX-110, GetClipMinY-10, 0, 0, 0);
	CreateEnemyFromFile(GCSD~"A_1/Enemy3.txt", GetCenterX+110, GetClipMinY-10, 0, 0, 0);
	loop(350){yield;}
	CreateEnemyFromFile(GCSD~"A_1/Enemy4.txt", GetCenterX, GetClipMinY-10, 0, 0, 0);
	loop(100){yield;}
	descent(i in 5..13){
		CreateEnemyFromFile(GCSD~"A_1/Enemy1.txt", GetClipMinX-5, GetClipMinY+i*20, 0, 0, 0);
		CreateEnemyFromFile(GCSD~"A_1/Enemy1.txt", GetClipMaxX+5, GetClipMinY+i*20, 0, 0, 0);
		loop(10){yield;}
	}
	loop(50){yield;}
	ascent(i in 2..8){
		CreateEnemyFromFile(GCSD~"A_1/Enemy2.txt", GetClipMinX+i*30, GetClipMinY-5, 0, 0, 0);
		CreateEnemyFromFile(GCSD~"A_1/Enemy2.txt", GetClipMaxX-i*30, GetClipMinY-5, 0, 0, 0);
		loop(5){yield;}
	}
	loop(300){yield;}
	CreateEnemyFromFile(GCSD~"A_1/Enemy3.txt", GetCenterX, GetClipMinY-10, 0, 0, 0);
	CreateEnemyFromFile(GCSD~"A_1/Enemy4.txt", GetClipMinX+30, GetClipMinY-19, 0, 0, 0);
	CreateEnemyFromFile(GCSD~"A_1/Enemy4.txt", GetClipMaxX-30, GetClipMinY-19, 0, 0, 0);
	loop(200){yield;}
	ascent(i in 2..8){
		CreateEnemyFromFile(GCSD~"A_1/Enemy2.txt", GetClipMinX+i*30, GetClipMinY-5, 0, 0, 0);
		CreateEnemyFromFile(GCSD~"A_1/Enemy2.txt", GetClipMaxX-i*30, GetClipMinY-5, 0, 0, 0);
		loop(5){yield;}
	}
	rain;
	loop(300){yield;}
	CreateEnemyFromFile(GCSD~"A_1/Enemy4.txt", GetCenterX, GetClipMinY-10, 0, 0, 0);
	CreateEnemyFromFile(GCSD~"A_1/Enemy3.txt", GetClipMinX+30, GetClipMinY-19, 0, 0, 0);
	CreateEnemyFromFile(GCSD~"A_1/Enemy3.txt", GetClipMaxX-30, GetClipMinY-19, 0, 0, 0);
	loop(500){yield;}
	CreateEnemyFromFile(GCSD~"A_1/talk02.txt", GetClipMinX-1500, GetClipMinY-1500, 0, 0, 0);
	while(GetEnemyNum!=0){yield;}
	loop(100){yield;}
	StageClear;
}
task rain{
	loop(50){
		CreateShot01(rand(GetClipMinX, GetClipMaxX), GetClipMinY-5, rand(1, 2), rand(85, 95), rand_int(135, 148), 0);
		if(GetCommonData("DIFFICULTY")=="NORMAL"){
			loop(2){
				CreateShot01(rand(GetClipMinX, GetClipMaxX), GetClipMinY-5, rand(1, 2), rand(85, 95), rand_int(135, 148), 0);
			}
		}
		if(GetCommonData("DIFFICULTY")=="HARD"){
			loop(3){
				CreateShot01(rand(GetClipMinX, GetClipMaxX), GetClipMinY-5, rand(1, 2), rand(85, 95), rand_int(135, 148), 0);
			}
		}
		if(GetCommonData("DIFFICULTY")=="LUNATIC"){
			loop(4){
				CreateShot01(rand(GetClipMinX, GetClipMaxX), GetClipMinY-5, rand(1, 2), rand(85, 95), rand_int(135, 148), 0);
			}
		}
		loop(12){yield;}
	}
}

sub Area1Stage1BG{

	sub Draw{
		bgmovX-=4;
		SetTexture(ar1bg1);
		SetGraphicRect(bgmovX, 0, 768+bgmovX, 768);
		SetGraphicScale(1, 1);
		SetGraphicAngle(90, 0, 0);
		SetAlpha(198);
		DrawGraphic3D(-200, -100, 0);
	}
	
	BackdropColor = [0, 0, 0];
	FogColor = [255, 255, 255];
	FogMin = 0;
	FogMax = 10000;
	CamX = 0;
	CamY = 0;
	CamZ = 0;
	CamDist = 400;
	CamRot = 0;
	CamLift = 50;
	Draw;
}