#TouhouDanmakufu
#Title[Bonus nonspell]
#Text[SECANTCOSINE!]
#Player[FREE]
#ScriptVersion[2]
#BackGround[User(.\moon.png, 0, 0)]
script_enemy_main {
    let ImgBoss = GetCurrentScriptDirectory~"sprite.png";
	let shot = GetCurrentScriptDirectory~"shot.wav";
	let shot2 = GetCurrentScriptDirectory~"shot2.wav";
    let frame = -120;
#include_function ".\lib\SHOT_REPLACE\shot_replace.dnh"
    @Initialize {
        SetLife(3000);
        SetTimer(40);
        LoadSE(shot);
	LoadSE(shot2);
	SetDurableSpellCard;
	SetShotAutoDeleteClip(100, 200, 100, 100);
	shotinit;
	SetEnemyMarker(true);
	SetInvincibility(120);
	SetDamageRate(100, 100);
        SetMovePosition02(GetCenterX, GetClipMinY + 120, 120);
        
        LoadGraphic(ImgBoss);
        SetTexture(ImgBoss);
        SetGraphicRect(1, 1, 128, 128);
    }

    @MainLoop {
        SetCollisionA(GetX, GetY, 32);
        SetCollisionB(GetX, GetY, 16);
	
if(frame==53 || frame==59 || frame == 65 || frame == 71 || frame == 77 || frame == 80 || frame == 86 || frame == 92 || frame == 98 || frame == 104){
	let a   = 0;
        let num = 4; //Change this number here to specify the number of bullets in the ring.
	SetMovePosition02(GetPlayerX, GetPlayerY, 180);
	PlaySE(shot2);
	loop(num)
            {	
		CreateShotA(1, GetX, GetY, 0);
		SetShotDataA(1, 60, -7, a+90+v, 0.01, 0.35, 1.5, GREEN56);
		a +=360/num;
FireShot(1);
}
        }

if(frame == -1 || frame==5 || frame==11 || frame == 17 || frame == 23 || frame == 29 || frame == 35 || frame == 41 || frame == 47){
	let a   = 8;
	PlaySE(shot2);
	SetMovePosition02(GetPlayerX, GetPlayerY, 180);
        let num = 4; //Change this number here to specify the number of bullets in the ring.
	loop(num)
            {	
		CreateShotA(1, GetX, GetY, 0);
		SetShotDataA(1, 60, -7, a+90+v, 0.01, 0.35, 1.5, GREEN56);
		a +=360/num;
FireShot(1);
}
        }



if(frame == 110){

	let a   = 8;
	
        let num = 30; //Change this number here to specify the number of bullets in the ring.
        
        loop(num)
        {
		PlaySE(shot);
            CreateShot01(GetX, GetY, 2, a+90, ORANGE01, 0);
            a += 360/num;
	PlaySE(shot);
		frame=0;

}

}








if(frame>49){
       v+=1.1;
	}
if(frame<50){
	v+=1.1;
	}
        frame++;
    }

    @DrawLoop {

                DrawGraphic(GetX,GetY);
    }
let v = 0;
    @Finalize {
        DeleteGraphic(ImgBoss);
    }
}
