script_enemy_main
{
	let frame=-200;
	let drawtype=0;
	#include_function ".\aliceanim.txt";
	#include_function ".\spellcard.txt";
task attack(type)
{
	let angle=0;
	if(type==1)
	{
	drawtype=1;
	ascent(i in 0..15)
	{
	PlaySE(GetCurrentScriptDirectory~"sound\Shot1.wav");
	ascent(j in 0..12)
	{
	ascent(k in 0..2)
	{
	CreateShotA(1, GetX+75*cos(150-i*8), GetY+75*sin(150-i*8), 20);
	SetShotDataA(1, 0, k+1, 150-i*8+j*30+k*15, 0, -0.1*k, 0.5*k, 2);
	SetShotDataA(1, 60, 3-k, NULL, 0, 0, 0, 2);
	FireShot(1);
	}
	}
	PlaySEWait(60);
	loop(3){yield;}
	}
	drawtype=0;
	loop(30){yield;}
	attack(2);
	}
	if(type==2)
	{
	drawtype=1;
	ascent(i in 0..15)
	{
	PlaySE(GetCurrentScriptDirectory~"sound\Shot1.wav");
	ascent(j in 0..12)
	{
	ascent(k in 0..2)
	{
	CreateShotA(1, GetX+75*cos(30+i*8), GetY+75*sin(30+i*8), 20);
	SetShotDataA(1, 0, k+1, 30+i*8+j*30+k*15, 0, -0.1*k, 0.5*k, 7);
	SetShotDataA(1, 60, 3-k, NULL, 0, 0, 0, 7);
	FireShot(1);
	}
	}
	PlaySEWait(60);
	loop(3){yield;}
	}
	drawtype=0;
	SetMovePosition02(GetPlayerX+rand(-50, 50), GetClipMinY+rand(50, 120), rand_int(30, 50));
	loop(60){yield;}
	attack(3);
	}
	if(type==3)
	{
	drawtype=1;
	ascent(i in 0..45)
	{
	PlaySE(GetCurrentScriptDirectory~"sound\Shot1.wav");
	ascent(j in 0..20)
	{
	CreateShotA(1, GetX+75*cos(150-i*8), GetY+75*sin(150-i*8), 20);
	SetShotDataA(1, 0, 1, 150-i*8+j*24, 0, 0, 0, 14);
	SetShotDataA(1, 60, 2.5, NULL, 0, 0, 0, 14);
	FireShot(1);
	}
	PlaySEWait(60);
	loop(2){yield;}
	}
	drawtype=0;
	loop(30){yield;}
	attack(4);
	}
	if(type==4)
	{
	drawtype=1;
	ascent(i in 0..45)
	{
	PlaySE(GetCurrentScriptDirectory~"sound\Shot1.wav");
	ascent(j in 0..15)
	{
	CreateShotA(1, GetX+75*cos(30+i*8), GetY+75*sin(30+i*8), 20);
	SetShotDataA(1, 0, 1, 30+i*8+j*24, 0, 0, 0, 12);
	SetShotDataA(1, 60, 2.5, NULL, 0, 0, 0, 12);
	FireShot(1);
	}
	PlaySEWait(60);
	loop(2){yield;}
	}
	drawtype=0;
	SetMovePosition02(GetPlayerX+rand(-50, 50), GetClipMinY+rand(50, 120), rand_int(30, 50));
	loop(60){yield;}
	attack(1);
	}
}
task PlaySEWait(frames)
{
	loop(frames){yield;}
	PlaySE(GetCurrentScriptDirectory~"sound\BulletWave.wav");
}
	@Initialize
	{
		SetInvincibility(100);
		SetLife(2000);
		SetDamageRate(70,70);
		SetMovePosition02(GetCenterX,120,20);
		LoadUserShotData(GetCurrentScriptDirectory~"supershot.txt");

		timer;
		SetCommonData("timercount", 1800);
	}
	
	@MainLoop
	{
		SetCollisionA(GetX(),GetY(),24);
		SetCollisionB(GetX(),GetY(),24);
		frame++;
		yield;
	if(frame==0)
	{
		attack(1);
	}
}
	
	@Finalize
	{
	}
	
	@DrawLoop
	{
	if(drawtype==0){anim2;}else{animation;}
	}
}