
	#Title[1面3符,ﾙﾅ◎]
	#Text[SampleA04：分裂する弾]
	#Image[]
        #Player[FREE]
        #BackGround[User(script\img\1.png, 2, 2)]//384×448 
	#ScriptVersion[2]
	
	script_enemy_main
	{
                let name        = "1-3「aaa」";
	        let imgExRumia   = GetCurrentScriptDirectory~"img\ExRumia.png";
	        let imgEnemy=GetCurrentScriptDirectory~"使い魔\img\kiri2.png";//Enemy.pngへのパス
    
               // 赤緑青黄桃水橙紫深白10～●鱗②米粒礫 中座ポ札菌星光
                let csd        = GetCurrentScriptDirectory;
                let shotData   = csd ~ "kshotData.txt";
                let tam         =csd~"se\counte.wav";
                let tama         =csd~"se\syan.wav";
                let taman         =csd~"se\shot2.wav";

		let countantsan;
		let countantsa;
		let countants;
		let countant;
		let countan;
		let counta;
		let count;
		let coun;
                let cont;
                let con;
                let co;
		let cx;

		@Initialize
		{    
		        LoadGraphic(imgEnemy);
                        CutIn(YOUMU, name, "", 0, 0, 0, 0);   
                        SetTimer(45);
                        SetScore(4000000);

			count=100;  
			coun=49;                            //弾を出す間隔を制御するための変数;
                        cont=100;
                        con=100;
                        co=0;
                        counta=350;
			countan=0;
			countant=0;
			countants=0;
			countantsa=0;
			countantsan=0;
			cx=GetCenterX();                       //変数cxに真ん中の座標を代入;
			SetLife(1000);                         //敵のライフを1000に
			SetGraphicRect(64,1,127,64);
		        LoadGraphic(imgExRumia); 
		        SetTexture(imgExRumia);           //script\img\ExRumia.jpgをテクスチャに読みこみ
			SetMovePosition02(cx,120,60);          //座標(cx,120)に60フレームで移動
		        LoadUserShotData(shotData);
                        SetEnemyMarker(true);
                        SetInvincibility(100);
                        SetDamageRate(16, 20);
                }
			
		@MainLoop
		{

		if(countantsa==2100)
			{
                                PlaySE(tam);	
				countantsa=2040;
			}

		if(coun==50)
			{
					
				SetShotDirectionType(ABSOLUTE);
				let i=0;
				while(i<=360)
				{
					let shot1=1;
					CreateShotA(shot1,rand(GetX-10,GetX+10),rand(GetY-10,GetY+10),1);
					SetShotDataA(shot1,0,rand(2,5),rand(0,360),0,0,0,163);
					SetShotDataA(shot1,10,1,NULL+90,1,0,0,163);
                                        SetShotKillTime(shot1,50);
                                        FireShot(shot1);

					i+=5;
				}
				coun=47;

			}
		if(count==150)
			{
				let i=0;
				while(i<=2)
				{
					let shot1=1;
					CreateShotA(shot1,rand(GetCenterX-250,GetCenterX+250),rand(GetCenterY-50,GetCenterY-250),0);
				        SetShotDirectionType(ABSOLUTE);
					SetShotDataA(shot1,0,rand(0.1,1),rand(200,160),0,0,0,50);
					SetShotDataA(shot1,800,1,rand(60,120),0,0,0,50);
                                        FireShot(shot1);


					i+=1;
				}
				count=140;
			}

                        if(cont==155)
                            {
				let i=0;
				while(i<=2)
				{
					let shot1=1;
					CreateShotA(shot1,rand(GetCenterX-250,GetCenterX+250),rand(GetCenterY-50,GetCenterY-250),0);
				        SetShotDirectionType(ABSOLUTE);
					SetShotDataA(shot1,0,rand(0.1,1),rand(-20,20),0,0,0,50);
					SetShotDataA(shot1,900,1,rand(60,120),0,0,0,50);
                                        FireShot(shot1);

					i+=1;
				}
				cont=145;
                            }
                        if(con==200)
                            {
				let i=0;
				while(i<=360)
				{
                                PlaySE(taman);
					let shot1=1;
					CreateShotA(shot1,GetX,GetY,0);
				        SetShotDirectionType(ABSOLUTE);
					SetShotDataA(shot1,0,0,rand(i-10,i+10),0,+0.005,3,140);
					SetShotDataA(shot1,10,0,NULL,0,+0.005,3,6);
                                        FireShot(shot1);

					i+=5;
				}
				con=150;
                            }
                        if(counta==700)
                            {
				let i=0;
				while(i<=360)
				{
                                PlaySE(taman);	
		                CreateEnemyFromFile(GetCurrentScriptDirectory~"使い魔\Enemy1-3h.txt",GetX,GetY,10,i,0);
				  i+=9;
				}
				counta=500;
                            }
                        if(countan==300)
                            {	
				let i=360;
				while(i<=360)
				{
                                PlaySE(tama);
					let shot1=1;
				        SetShotDirectionType(PLAYER);
					CreateShotA(shot1,GetX,GetY,10);
					SetShotDataA(shot1,0,0,0,0,0.02,4,191);
                                        FireShot(shot1);
					i+=15;
				}
				countan=100;
                            }
                        if(countant==1000)
                            {	
				let i=360;
				while(i<=360)
				{
                                PlaySE(tama);
					let shot1=1;
				        SetShotDirectionType(PLAYER);
					CreateShotA(shot1,GetX,GetY,10);
					SetShotDataA(shot1,0,0,0,0,0.02,4,191);
                                        FireShot(shot1);
					i+=15;
				}
				countant=800;
                            }
                        if(countants==1750)
                            {	
				let i=360;
				while(i<=360)
				{
                                PlaySE(tama);
					let shot1=1;
				        SetShotDirectionType(PLAYER);
					CreateShotA(shot1,GetX,GetY,10);
					SetShotDataA(shot1,0,0,0,0,0.02,4,191);
                                        FireShot(shot1);
					i+=15;
				}
				countants=1650;
                            }
                        if(countantsan==2375)
                            {	
				let i=360;
				while(i<=360)
				{
                                PlaySE(tama);
					let shot1=1;
				        SetShotDirectionType(PLAYER);
					CreateShotA(shot1,GetX,GetY,10);
					SetShotDataA(shot1,0,0,0,0,0.02,4,191);
                                        FireShot(shot1);
					i+=15;
				}
				countantsan=2325;
                            }
			SetCollisionA(GetX(),GetY(),32);
			SetCollisionB(GetX(),GetY(),24);
                        count++;
                        cont++;
                        con++;
                        co++;
                        counta++;
                        countan++;
                        countant++;
                        countants++;
                        countantsa++;
                        countantsan++;
                        coun++;

		}
		
		@DrawLoop
		{
		SetTexture(imgExRumia);
		if(int(GetSpeedX())==0){SetGraphicRect(64,1,127,64);}
		else if(GetSpeedX()>0){SetGraphicRect(192,1,255,64);}
		else if(GetSpeedX()<0){SetGraphicRect(128,1,191,64);}
		DrawGraphic(GetX, GetY);
		}
		
		@Finalize
		{
			DeleteGraphic(imgExRumia);
		loop(20)
		{
			CreateItem(ITEM_SCORE,rand(GetX-50,GetX+50),rand(GetY-50,GetY+50));
		}
		}

	}
