script_enemy_main
{
    let count=0;//Ђ܂
    let MT=0;
    let mm=0;
    let N15=0;

    @Initialize
{
	SetLife(1250);
	SetScore(1000000);
	SetGraphicRect(256,0,320,64);
	SetDamageRate(20,35);
	LoadUserShotData(GetCurrentScriptDirectory~".\shot_All.txt");
}

@MainLoop
{
	if (GetArgument==0) {
		mm+=5+2*sin(count*2);
		if (count==0) {
			SetLife(350);
		}
		if (count>0&&count<=90) {
			SetSpeed(3.5-count*0.03);
			SetAngle(90);
		}
		if (count>90&&count<=1200) {
			SetSpeed(0);
		}
		if (count>1200) {
			SetAngle(-90);
			SetSpeed(2);
		}if (count>1400) {
			VanishEnemy;
		}
		if (count>100&&count<=1170) {
			if (count%3==0) {
				PlaySE(GetCurrentScriptDirectory~"\se\Shot00.wav");
				ascent( let t in 0..4 ) {
					CreateShot02(GetX()-38*sin(mm+t*90),GetY()-5+38*cos(mm+t*90),0,mm+t*90,0.02,3,YELLOW04,20);
					CreateShot02(GetX()+66*sin(mm+t*90),GetY()-5-66*cos(mm+t*90),-1,mm+t*90,0.02,3,YELLOW04,20);
				}
			}
		}
		if (count>=18) {
			SetCollisionA(GetX(),GetY(),17);
			SetCollisionB(GetX(),GetY(),12);
		}if (count>=180) {
			SetDamageRate(100,25);
		}
	}

	if (GetArgument==1) {
		mm+=5+2*sin(count*2);
		if (count==0) {
			SetLife(80);
		}
		if (count>0&&count<=90) {
			SetSpeed(4.5-count*0.038);
			SetAngle(90);
		}
		if (count>90&&count<=400) {
			SetSpeed(0);
		}
		if (count>400) {
			SetAngle(-90);
			SetSpeed(2);
		}if (count>550) {
			VanishEnemy;
		}
		if (count>=18) {
			SetCollisionA(GetX(),GetY(),17);
			SetCollisionB(GetX(),GetY(),12);
		}if (count>=60) {
			SetDamageRate(100,25);
		}
	}

	if (GetArgument==2) {
		mm+=5+2*sin(count*2);
		if (count==0) {
			SetLife(80);
		}
		if (count>0&&count<=90) {
			SetSpeed(4.5-count*0.038);
			SetAngle(90);
		}
		if (count>90&&count<=400) {
			SetSpeed(0);
		}
		if (count>400) {
			SetAngle(-90);
			SetSpeed(2);
		}if (count>550) {
			VanishEnemy;
		}
		if (count>100&&count<=370) {
			if (count%13==0) {
				PlaySE(GetCurrentScriptDirectory~"\se\Shot00.wav");
				ascent( let t in 0..12 ) {
					CreateShot02(GetX()+55*sin(mm+t*30),GetY()-5-38*cos(mm+t*30),0,mm+t*30,0.02,5,176,20);
				}
			}
		}
		if (count>=18) {
			SetCollisionA(GetX(),GetY(),17);
			SetCollisionB(GetX(),GetY(),12);
		}if (count>=180) {
			SetDamageRate(100,25);
		}
	}

	if (GetArgument==3) {
		if (count>0&&count<=90) {
			SetSpeed(3.5-count*0.03);
			SetAngle(90);
		}
		if (count>90&&count<=1850) {
			SetSpeed(0);
		}
		if (count==30) {
			SetShotAutoDeleteClip(8,8,8,8);
			DeleteEnemyShot(ALL);
			SetColor(255,0,0);
			Concentration01(125);
			PlaySE(GetCurrentScriptDirectory~"\se\push02.wav");
		}
		if (count>1850) {
			SetAngle(-90);
			SetSpeed(7);
		}if (count>1990) {
			VanishEnemy;
		}
		if (count>=0&&count<1810) {
			SetCollisionA(GetX(),GetY(),15);
			SetCollisionB(GetX(),GetY(),5);
			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,17,30);
			}
		}
		if (count>=132) {
			SetDamageRate(100,25);
		}
	}

	if (GetArgument==4) {
		mm+=7+2*sin(count*2);
		if (count==0) {
			SetLife(130);
			SetDamageRate(40,15);
		}
		if (count>0) {
			SetSpeed(2.5);
		}if (count>300) {
			VanishEnemy;
		}
		if (count>10&&count%3==0) {
			PlaySE(GetCurrentScriptDirectory~"\se\Shot00.wav");
			ascent( let t in 0..2 ) {
				CreateShotA(N15,GetX()-44*sin(mm+t*180),GetY()-5+44*cos(mm+t*180),30);
				SetShotDirectionType(ABSOLUTE);
				SetShotDataA(N15,0,5,mm+t*90,0,-0.15,1,196);
				SetShotDirectionType(PLAYER);
				SetShotDataA(N15,60,7,-17,0,0.2,7,170);
				SetShotDirectionType(ABSOLUTE);
				FireShot(N15);
			}
			ascent( let t in 0..2 ) {
				CreateShotA(N15,GetX()-44*sin(90+mm+t*180),GetY()-5+44*cos(90+mm+t*180),30);
				SetShotDirectionType(ABSOLUTE);
				SetShotDataA(N15,0,5,mm+t*90,0,-0.15,1,196);
				SetShotDirectionType(PLAYER);
				SetShotDataA(N15,60,7,17,0,0.2,7,170);
				SetShotDirectionType(ABSOLUTE);
				FireShot(N15);
			}
			ascent( let t in 0..4 ) {
				if (count%18==0) {
					CreateShot02(GetX()-28*sin(mm+t*90),GetY()-5+28*cos(mm+t*90),2+rand(-1,2),270+rand(-65,65),-0.05,-4,54,10);
				}
			}
		}
		if (count>=18) {
			SetCollisionA(GetX(),GetY(),17);
			SetCollisionB(GetX(),GetY(),13);
		}if (count>=60) {
			SetDamageRate(100,25);
		}
	}

	if (GetArgument==5) {
		mm+=3+1*sin(count*2);
		if (count==0) {
			SetLife(1500);
		}
		if (count==30) {
			DeleteEnemyShot(ALL);
			SetColor(255,0,0);
			Concentration01(205);
			PlaySE(GetCurrentScriptDirectory~"\se\push02.wav");
		}
		if (count>0&&count<=90) {
			SetSpeed(4.5-count*0.038);
			SetAngle(90);
		}
		if (count>90&&count<=1800) {
			SetSpeed(0);
		}
		if (count>1800) {
			VanishEnemy;
		}
		if (count>100&&count<=670) {
			if (count%2==0) {
				PlaySE(GetCurrentScriptDirectory~"\se\Shot00.wav");
				ascent( let t in 0..4 ) {
					CreateShot02(GetX()-88*sin(mm+t*90),GetY()-5+18*cos(mm+t*90),2,mm+t*90,-0.03,-2.4,196,20);
					CreateShot02(GetX()-128*sin(mm+t*90),GetY()-5+128*cos(mm+t*90),3,mm+t*90-65,-0.03,-2.5,195,20);
				}
			}
		}
		if (count>=18) {
			SetCollisionA(GetX(),GetY(),17);
			SetCollisionB(GetX(),GetY(),12);
		}if (count>=180) {
			SetDamageRate(100,25);
		}
	}

	if (GetArgument==6) {
		mm+=5+2*sin(count*2);
		if (count==0) {
			SetLife(800);
		}
		if (count>=18) {
			SetCollisionA(GetX(),GetY()-5,25);
			SetCollisionB(GetX(),GetY(),12);
			SetDamageRate(100,25);
		}
		if (count<=600) {
			SetSpeed(0);
		}
		if (count>600) {
			SetAngle(-90);
			SetSpeed(2);
			SetDamageRate(0,0);
		}if (count>750) {
			VanishEnemy;
		}
		if (count>100&&count<=470) {
			if (count%2==0) {
				PlaySE(GetCurrentScriptDirectory~"\se\Shot00.wav");
				ascent( let t in 0..12 ) {
					CreateShot02(GetX()+55*sin(mm+t*30),GetY()-5-38*cos(mm+t*30),0,mm+t*30,-0.02,-4,195,20);
				}
			}
		}
	}

	count++;

}

@Finalize
{
	if (MT==0&&OnBomb==false&&BeVanished==false) {
		CollectItems;
		MT++;
	}
	if (BeVanished==false&&GetArgument!=5) {
		loop(10) {
			CreateItem(ITEM_SCORE,GetX()+rand(-40,40),GetY()+rand(-5,55));
		}
	}
	if (GetArgument==0) {
		loop(30) {
			CreateItem(ITEM_SCORE,GetX()+rand(-55,55),GetY()+rand(20,100));
		}CreateItem(ITEM_BOMB,GetX(),GetY()+60);
	}
	if (GetArgument==3) {
		SetShotAutoDeleteClip(32,32,32,32);
		loop(30) {
			CreateItem(ITEM_SCORE,GetX()+rand(-55,55),GetY()+rand(20,100));
		}DeleteEnemyShotInCircle(ALL,GetX(),GetY(),512);
		CreateItem(ITEM_1UP,GetX(),GetY()+60);
	}
	if (GetArgument==5) {
		ascent(let t in 0..24) {
			CreateShot02(GetX(),GetY()-8,2,t*15,-0.1,-1.3,55,49);
		}ascent(let t in 0..24) {
			CreateShot02(GetX(),GetY()-8,3,t*15,-0.1,-1.12,46,35);
		}
		CreateEnemyFromFile(GetCurrentScriptDirectory~"Enemy04.txt",GetX(),GetY(),0,0,6);
	}
	if (GetArgument==6) {
		loop(30) {
			CreateItem(ITEM_SCORE,GetX()+rand(-55,55),GetY()+rand(20,100));
		}CreateItem(ITEM_1UP,GetX(),GetY()+60);
	}
}

@DrawLoop
{
	SetTexture(GetCurrentScriptDirectory~"img\dot-kaze-ti.png");
	SetColor(255,255,255);
	SetGraphicScale(1.1,1.1);

	if (count/8%4==0) {
		SetGraphicRect(256,0,320,64);
	}
	if (count/8%4==1) {
		SetGraphicRect(320,0,384,64);
	}
	if (count/8%4==2) {
		SetGraphicRect(384,0,448,64);
	}
	if (count/8%4==3) {
		SetGraphicRect(320,0,384,64);
	}

	if (GetArgument==3||GetArgument==5||GetArgument==6) {
		if (count/8%4==0) {
			SetGraphicRect(256,128,320,192);
		}
		if (count/8%4==1) {
			SetGraphicRect(320,128,384,192);
		}
		if (count/8%4==2) {
			SetGraphicRect(384,128,448,192);
		}
		if (count/8%4==3) {
			SetGraphicRect(320,128,384,192);
		}
	}

	DrawGraphic(GetX(),GetY());
}
}
