script_enemy_main
{
    let count=0;//Az
    let MT=0;
    let mm=0;
    let N15=0;
    let N16=0;
    let N17=0;

    @Initialize
{
	SetLife(50);
	SetScore(500000);
	LoadUserShotData(GetCurrentScriptDirectory~".\shot_All.txt");
	SetAngle(90);
}


@MainLoop
{
	if (GetArgument==0) {
		if (count>500) {
			VanishEnemy;
		}
		SetSpeed(2.2-count*0.01);
		if (count>70&&count<=90) {
			SetAngle(GetAngleToPlayer());
		}
		if (count>120&&count<=380&&count%25==0) {
			PlaySE(GetCurrentScriptDirectory~"\se\Shot01.wav");
			ascent( let t in 0..4 ) {
				CreateShot02(GetX(),GetY(),1.6,GetAngleToPlayer()+t*90,0.1,5,BLUE04,10)
			}
		}
		if (count==60) {
			PlaySE(GetCurrentScriptDirectory~"\se\Shot00.wav");
			if (GetArgument==0) {
				ascent(let t in 0..24) {
					CreateShot02(GetX(),GetY()-8,2,GetAngleToPlayer()+t*15,-0.1,-5.0,49,49);
				}ascent(let t in 0..24) {
					CreateShot02(GetX(),GetY()-8,3,GetAngleToPlayer()+t*15,-0.1,-4.54,43,35);
				}
			}
			if (GetArgument==1) {
				ascent(let t in 0..24) {
					CreateShot02(GetX(),GetY()-8,2,GetAngleToPlayer()+t*15,-0.08,-4.0,43,35);
					CreateShot02(GetX(),GetY()-8,2,GetAngleToPlayer()+7.5+t*15,-0.08,-4.0,49,35);
				}
			}
		}
		if (count>=108) {
			SetCollisionA(GetX(),GetY(),15);
			SetCollisionB(GetX(),GetY(),5);
		}
		if (count==95) {
			PlaySE(GetCurrentScriptDirectory~"\se\Shot01.wav");
		}
	}

	if (GetArgument==1) {
		if (count>256) {
			SetAngle(-90);
			SetSpeed((count-200)*0.1);
		}if (count>380) {
			VanishEnemy;
		}
		if (count==62) {
			PlaySE(GetCurrentScriptDirectory~"\se\Laser.wav");
			mm=0;
		}//mm+=GetAngleToPlayer();}
		if (count==63) {
			CreateLaserA(N15,GetX()+12,GetY()+12,512,22,190,20);
			SetLaserDataA(N15,0,280+mm,2.5,0,0,0);
			SetLaserDataA(N15,60,NULL,0,0,0,0);
			SetShotKillTime(N15,180);
			FireShot(N15);
			CreateLaserA(N15,GetX()-12,GetY()+12,512,22,190,20);
			SetLaserDataA(N15,0,260+mm,-2.5,0,0,0);
			SetLaserDataA(N15,60,NULL,0,0,0,0);
			SetShotKillTime(N15,180);
			FireShot(N15);
		}
		if (count>=64) {
			SetCollisionA(GetX(),GetY(),15);
			SetCollisionB(GetX(),GetY(),5);
			SetDamageRate(0,0);
		}
		if (count>=70&&count<190&&count%8==0) {
			PlaySE(GetCurrentScriptDirectory~"\se\Shot00.wav");
			mm+=rand(12,20);
			ascent( let t in 0..20 ) {
				CreateShot01(GetX(),GetY(),2.4,mm+t*12,RED01,15)
			}
		}
		if (count>=132) {
			SetDamageRate(45,45);
		}
	}

	if (GetArgument==2) {
		if (count==0) {
			SetLife(100);
		}
		if (count>450) {
			VanishEnemy;
		}
		if (count>0&&count<=160) {
			SetSpeed(1.9-count*0.01);
			SetAngle(90);
		}
		if (count>160&&count<=300) {
			SetSpeed(0);
			SetAngle(-90);
		}
		if (count>300&&count<=450) {
			SetSpeed((count-300)*0.1);
			SetAngle(-90);
		}
		if (count>=120&&count<=260&&count%5==0) {
			PlaySE(GetCurrentScriptDirectory~"\se\Laser.wav");
			ascent(let t in 0..2) {
				CreateLaser01(GetX()-38*sin(GetX()*8+count*3+t*180),GetY()-5+38*cos(GetX()*8+count*3+t*180),3.5,GetX()*8+count*3+t*180,170,7,41,12);
			}
		}
		if (count>=120) {
			SetCollisionA(GetX(),GetY(),18);
			SetCollisionB(GetX(),GetY(),9);
		}
	}

	if (GetArgument==3) {
		if (count==0) {
			DeleteEnemyShot(ALL);
			SetLife(1150);
			SetScore(5000000);
			PlaySE(GetCurrentScriptDirectory~"\se\push02.wav");
			SetColor(255,128,255);
			Concentration01(122);
		}
		if (count>1850) {
			SetAngle(-90);
			SetSpeed(7);
		}if (count>1950) {
			VanishEnemy;
		}
		if (count>=94&&count<1810) {
			SetCollisionA(GetX(),GetY(),15);
			SetCollisionB(GetX(),GetY(),10);
			SetDamageRate(0,0);
		}
		if (count>=98&&count<1810) {
			PlaySE(GetCurrentScriptDirectory~"\se\Shot00.wav");
			ascent( let t in 0..6 ) {
				CreateShot01(GetX()-17*sin(500*sin(count)+count*5+t*60+12),GetY()+17*cos(500*sin(count)+count*5+t*60+12),2.2+count*0.001,17+500*sin(count)+count*5+t*60+12,23,30);
			}
		}
		if (count>=132) {
			SetDamageRate(100,25);
		}
	}

	if (GetArgument==4) {
		if (count>500) {
			VanishEnemy;
		}
		SetSpeed(2.2-count*0.01);
		if (count>70&&count<=90) {
			SetAngle(GetAngleToPlayer());
		}
		if (count>120&&count<=380&&count%18==0) {
			PlaySE(GetCurrentScriptDirectory~"\se\Shot01.wav");
			ascent( let t in 0..4 ) {
				CreateShot02(GetX(),GetY(),1.6,GetAngleToPlayer()+t*90,0.1,5,BLUE04,10)
			}
		}
		if (count>120&&count<=380&&count%18==0) {
			ascent( let t in 0..2 ) {
				CreateShot02(GetX(),GetY(),1.6,GetAngleToPlayer()-30+t*60,0.1,5,BLUE04,10);
			}
		}
		if (count>=108) {
			SetCollisionA(GetX(),GetY(),15);
			SetCollisionB(GetX(),GetY(),5);
		}
	}

	if (GetArgument==5) {
		if (count>500) {
			VanishEnemy;
		}
		SetSpeed(2.2-count*0.01);
		if (count>70&&count<=90) {
			SetAngle(90);
		}
		if (count>120&&count<=350&&count%18==0) {
			PlaySE(GetCurrentScriptDirectory~"\se\Shot00.wav");
		}
		if (count>120&&count<=350&&count%18==0) {
			ascent( let t in 0..8 ) {
				CreateShot02(GetX(),GetY(),3.5,count+t*45,-0.1,2,55,10);
			}
		}
		if (count>=108) {
			SetCollisionA(GetX(),GetY(),15);
			SetCollisionB(GetX(),GetY(),5);
		}
	}

	if (GetArgument==6) {
		if (count>140) {
			if (GetX<=-20 || GetX>=480 || GetY<=-100 || GetY>=750) {
				VanishEnemy;
			}
		}
		SetSpeed(5.5);
		if (count>120&&count<=170) {
			SetAngle(-90);
		}
		if (count==120) {
			PlaySE(GetCurrentScriptDirectory~"\se\Shot01.wav");
		}
		if (count==120||count==135||count==150) {
			ascent( let t in 0..18 ) {
				CreateShot02(GetX(),GetY(),5.5,count+t*20,-0.5,1,170,10);
				CreateShot02(GetX(),GetY(),5.5,count+t*20,-0.5,0.7,170,10);
				CreateShot02(GetX(),GetY(),5.5,count+t*20,-0.5,0.4,170,10);
			}
		}
		if (count>=70) {
			SetCollisionA(GetX(),GetY(),15);
			SetCollisionB(GetX(),GetY(),5);
		}
	}

	if (GetArgument==7) {
		if (count>500) {
			VanishEnemy;
		}
		SetSpeed(2.2-count*0.01);
		if (count>70&&count<=90) {
			SetAngle(90);
		}
		if (count>120&&count<=350&&count%26==0) {
			PlaySE(GetCurrentScriptDirectory~"\se\Shot00.wav");
		}
		if (count>120&&count<=350&&count%26==0) {
			ascent( let t in 0..6 ) {
				CreateShot02(GetX(),GetY(),3.5,count+t*60,-0.1,3,53,10);
			}
		}
		if (count>=108) {
			SetCollisionA(GetX(),GetY(),15);
			SetCollisionB(GetX(),GetY(),5);
		}
	}

	count++;

}

@Finalize
{
	if (MT==0&&OnBomb==false&&BeVanished==false) {
		CollectItems;
		MT++;
	}
	if (BeVanished==false) {
		loop(3) {
			CreateItem(ITEM_SCORE,GetX()+rand(-18,18),GetY()+rand(38,64));
		}
	}
	if (GetArgument==1) {
		DeleteEnemyShotInCircle(ALL,GetX(),GetY(),35);
	}
	if (GetArgument==3) {
		DeleteEnemyShotInCircle(ALL,GetX(),GetY(),512);
		loop(30) {
			CreateItem(ITEM_SCORE,GetX()+rand(-50,50),GetY()+rand(20,100));
		}CreateItem(ITEM_1UP,GetX(),GetY()+60);
	}
}

@DrawLoop
{
	SetTexture(GetCurrentScriptDirectory~"img\dot-kaze-ti.png");
    if (count<=50) {
        SetAlpha(0);
    }
    if (count>=50&&count<=112) {
        SetAlpha((count-50)*4);
    }
    if (count>=112) {
        SetAlpha(255);
    }
    SetGraphicRect(64,0,128,64);
    SetRenderState(ALPHA);
    SetColor(225+count%4*30,225+count%4*30,225+count%4*30);
    SetGraphicScale(1.12,1.12);
    SetGraphicAngle(0,0,-count*5);
    DrawGraphic(GetX(),GetY());
    SetGraphicScale(0.8,0.8);
    SetGraphicAngle(0,0,count*5);
    DrawGraphic(GetX(),GetY());

    SetGraphicRect(0,0,64,64);
    SetColor(255,255,255);
    SetGraphicScale(0.65,0.65);
    SetGraphicAngle(0,0,90);
    DrawGraphic(GetX(),GetY());

}
}
