#TouhouDanmakufu
#Title[Nonspell 3 Hard]
#Text[Nonspell 3 Hard]
#Player[FREE]
#ScriptVersion[2]
#BackGround[User(.\moon.png, 0, 0)]
script_enemy_main {
    let ImgBoss = "script\img\ExRumia.png";
	let shot = GetCurrentScriptDirectory~"shot.wav";
    let frame = -200;
	#include_function ".\lib\SHOT_REPLACE\shot_replace.dnh"
    @Initialize {
        SetLife(3500);
        SetTimer(50);
        LoadSE(shot);
	shotinit;
	CreateItem(ITEM_SCORE, rand(50, -50)+GetX, rand(10, -10)+GetY);
	CreateItem(ITEM_SCORE, rand(70, -70)+GetX, rand(40, -10)+GetY);
	CreateItem(ITEM_SCORE, rand(70, -70)+GetX, rand(40, -10)+GetY);
	CreateItem(ITEM_BOMB, rand(70, -70)+GetX, rand(40, -10)+GetY);
	CreateItem(ITEM_SCORE, rand(70, -70)+GetX, rand(40, -10)+GetY);
	CreateItem(ITEM_SCORE, rand(70, -70)+GetX, rand(40, -10)+GetY);
	CreateItem(ITEM_SCORE, rand(70, -70)+GetX, rand(40, -10)+GetY);
	CreateItem(ITEM_SCORE, rand(70, -70)+GetX, rand(40, -40)+GetY);
	CreateItem(ITEM_SCORE, rand(70, -70)+GetX, rand(40, -10)+GetY);
	CreateItem(ITEM_SCORE, rand(70, -70)+GetX, rand(40, -10)+GetY);
	CreateItem(ITEM_SCORE, rand(70, -70)+GetX, rand(40, -10)+GetY);
	CreateItem(ITEM_SCORE, rand(70, -70)+GetX, rand(40, -10)+GetY);
	CreateItem(ITEM_SCORE, rand(70, -70)+GetX, rand(40, -10)+GetY);
	CreateItem(ITEM_SCORE, rand(70, -70)+GetX, rand(40, -10)+GetY);
	CreateItem(ITEM_SCORE, rand(70, -70)+GetX, rand(40, -10)+GetY);
	CreateItem(ITEM_SCORE, rand(70, -70)+GetX, rand(40, -10)+GetY);
	SetEnemyMarker(true);
	SetInvincibility(250);
        SetMovePosition02(GetCenterX, GetClipMinY + 120, 120);
        
	SetDamageRate(90, 100);
        LoadGraphic(ImgBoss);
        SetTexture(ImgBoss);
        SetGraphicRect(0, 0, 64, 64);
    }

    @MainLoop {
        SetCollisionA(GetX, GetY, 32);
        SetCollisionB(GetX, GetY, 16);

if(frame == 0){

	let a   = 3;
        let num = 20; //Change this number here to specify the number of bullets in the ring.
        
        loop(num)
        {
            CreateShot01(GetX, GetY, 5, a+GetAngleToPlayer, RED32, 0);
            a += 360/num;
		PlaySE(shot);

}
}

if(frame == 10){

	let a   = 3;
        let num = 20; //Change this number here to specify the number of bullets in the ring.
        
        loop(num)
        {
            CreateShot01(GetX, GetY, 5, a+GetAngleToPlayer, RED32, 0);
            a += 360/num;
		PlaySE(shot);

}
}

if(frame == 20){

	let a   = 3;
        let num = 20; //Change this number here to specify the number of bullets in the ring.
        
        loop(num)
        {
            CreateShot01(GetX, GetY, 5, a+GetAngleToPlayer, RED32, 0);
            a += 360/num;
		PlaySE(shot);

}
}

if(frame == 30){

	let a   = 3;
        let num = 20; //Change this number here to specify the number of bullets in the ring.
        
        loop(num)
        {
            CreateShot01(GetX, GetY, 5, a+GetAngleToPlayer, RED32, 0);
            a += 360/num;
		PlaySE(shot);

}
}
if(frame == 40){

	let a   = 3;
        let num = 20; //Change this number here to specify the number of bullets in the ring.
        
        loop(num)
        {
            CreateShot01(GetX, GetY, 5, a+GetAngleToPlayer, RED32, 0);
            a += 360/num;
PlaySE(shot);
if(frame == 50){

	let a   = 3;
        let num = 20; //Change this number here to specify the number of bullets in the ring.
        
        loop(num)
        {
            CreateShot01(GetX, GetY, 5, a+GetAngleToPlayer, RED32, 0);
            a += 360/num;
		PlaySE(shot);

}
}
		

}
}
if(frame == 60){

	let a   = 3;
        let num = 20; //Change this number here to specify the number of bullets in the ring.
        
        loop(num)
        {
            CreateShot01(GetX, GetY, 5, a+GetAngleToPlayer, RED32, 0);
            a += 360/num;
		PlaySE(shot);

}
}

if(frame == 70){

	let a   = 3;
        let num = 20; //Change this number here to specify the number of bullets in the ring.
        
        loop(num)
        {
            CreateShot01(GetX, GetY, 5, a+GetAngleToPlayer, RED32, 0);
            a += 360/num;
		PlaySE(shot);

}
}
if(frame == 80){

	let a   = 3;
        let num = 20; //Change this number here to specify the number of bullets in the ring.
        
        loop(num)
        {
            CreateShot01(GetX, GetY, 5, a+GetAngleToPlayer, RED32, 0);
            a += 360/num;
		PlaySE(shot);

}
}

if(frame == 90){

	let a   = 3;
        let num = 20; //Change this number here to specify the number of bullets in the ring.
        
        loop(num)
        {
            CreateShot01(GetX, GetY, 5, a+GetAngleToPlayer, RED32, 0);
            a += 360/num;
		PlaySE(shot);

}
}
if(frame == 100){

	let a   = 3;
        let num = 20; //Change this number here to specify the number of bullets in the ring.
        
        loop(num)
        {
            CreateShot01(GetX, GetY, 5, a+GetAngleToPlayer, RED32, 0);
            a += 360/num;
		PlaySE(shot);

}
}

if(frame == 110){

	let a   = 3;
        let num = 20; //Change this number here to specify the number of bullets in the ring.
        
        loop(num)
        {
            CreateShot01(GetX, GetY, 5, a+GetAngleToPlayer, RED32, 0);
            a += 360/num;
		PlaySE(shot);

}
}
if(frame == 120){

	let a   = 3;
        let num = 20; //Change this number here to specify the number of bullets in the ring.
        
        loop(num)
        {
            CreateShot01(GetX, GetY, 5, a+GetAngleToPlayer, RED32, 0);
            a += 360/num;
		PlaySE(shot);

}
}
        if(frame == 20) {
            CreateShot01(GetX, GetY, 6, GetAngleToPlayer, BLUE32, 0);
PlaySE(shot);
        }
if(frame == 40) {
            CreateShot01(GetX, GetY, 6, GetAngleToPlayer, BLUE32, 0);
PlaySE(shot);
        }
if(frame == 60) {
            CreateShot01(GetX, GetY, 6, GetAngleToPlayer, BLUE32, 0);
PlaySE(shot);
        }
if(frame == 80) {
            CreateShot01(GetX, GetY, 6, GetAngleToPlayer, BLUE32, 0);
PlaySE(shot);
        }
if(frame == 100) {
            CreateShot01(GetX, GetY, 6, GetAngleToPlayer, BLUE32, 0);
PlaySE(shot);
        }
if(frame == 121) {
            CreateShot01(GetX, GetY, 6, GetAngleToPlayer, BLUE32, 0);
	frame=-10
        }

if(frame == 120) {

SetMovePosition03(rand(-50, -15)+GetX, rand(10, 20)+GetY, 3, 1); 

}

if(frame == 60) {

SetMovePosition03(rand(50, 15)+GetX, rand(-10, -20)+GetY, 3, 1); 

}


        frame++;
    }

    @DrawLoop {
        SetTexture(ImgBoss);
               SetTexture(ImgBoss);
                SetRenderState(ALPHA);
                SetAlpha(255);  
                SetGraphicScale(1,1);
                SetGraphicAngle(0,0,0);

                if(GetSpeedX==0){
                         SetGraphicRect(0,0,64,64); }
                        
 
                if(GetSpeedX>0){
                        SetGraphicRect(190, 126, 256, 64);
			}
 
                if(GetSpeedX<0){
                        
                        SetGraphicRect(128,128,186,64); }
                      
 
                DrawGraphic(GetX,GetY);
    }

    @Finalize {
        DeleteGraphic(ImgBoss);
    }
}

