#include "hostAPI.txt"

#include "global.txt"

var count;
var deflect;
var i;
var j;
var type;
var tt;
var bx;
var by;
var px;
var py;
var fulllife;
var bosslife;
var rx;
var ry;
var deg;
var degg;
var movex;
var movey;
var ran;







func update() {
++count;
if(count < 0)
	return;

bosslife=htGetBossLife();
	bx = htGetBossX();
	by = htGetBossY();
	
	px = htGetPlayerX();
	py = htGetPlayerY();
deg=GetDegreeBetweenTwoPoints(bx, by,px,py);

if (count % 30==0)
{
ran=randomfloat(0,360);
for (i=0;i<=6;++i)
for (j=0;j<=2;++j)

htInsertBulletVec(5,15,bx,by,1+0.5*j,360/6*i+ran);




}

if (count==180)
{
for (i=0;i<=60;++i)
{

htInsertBulletVec(5,5,bx,by,2.5+randomfloat(0,1.5),deg+randomfloat(-3,3));


}
for (i=0;i<=20;++i)
{


htInsertBulletVec(5,2,bx,by,0.5+randomfloat(0,5),deg+randomfloat(-30,30));

}


}

if (count==180) 
{


htMoveBossTo(px,randomfloat(30,200),90);
count=0;
}

}

func init() {


htMoveBossTo(400, 100, 30);
htSetBulletScreenRect(100, -50, 750, 700);


htEnableBossMagicCircle("green_bg_cover1.png", 1);
	htSetBossMagicCircleColor(1, 1, 1, 1);
	
	count = -30;
	deflect = 0;
	i = 0;
	type = 0;
	
	bx = 0;
	by = 0;
}