script_enemy_main
{
	let frame=-100;
	#include_function ".\keinebanim.txt";
	#include_function ".\spellcard.txt";
task Familiars
{
	ascent(i in 0..20)
	{
	CreateEnemyFromScript("Familiar", GetX+100*cos(i*18)+50*cos(45-i*18), GetY+100*sin(i*18)+50*sin(45-i*18), 0, 0, 1);
	CreateEnemyFromScript("Familiar", GetX+100*cos(i*18)+50*cos(315-i*18), GetY+100*sin(i*18)+50*sin(315-i*18), 0, 0, -1);
	}
}
task wave
{
	loop(100){yield;}
	PlaySE(GetCurrentScriptDirectory~"sound\Shot1.wav");
	ascent(i in 0..20)
	{
	CreateShot01(GetX, GetY, 3, GetAngleToPlayer+i*18, 52, 20);
	}
	ascent(i in 0..6)
	{
	ascent(j in 1..7)
	{
	CreateShot01(GetX, GetY, j, GetAngleToPlayer+i*60+30, 52, 20);
	}
	}
	loop(20){yield;}
	ascent(i in 1..4)
	{
	PlaySE(GetCurrentScriptDirectory~"sound\Shot1.wav");
	ascent(j in -1..2)
	{
	CreateShot01(GetX, GetY, i, GetAngleToPlayer+j*5, 52, 20);
	}
	loop(10){yield;}
	}
	loop(50){yield;}
	wave;
	SetMovePosition02(rand(GetPlayerX-50, GetPlayerX+50), rand(50, 120), 60);
}

	@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)
	{
		Familiars;
		wave;
	}
}
	
	@Finalize
	{
	}
	
	@DrawLoop
	{
	anim2;
	}
}

script_enemy Familiar {
	#include_function ".\famanim.txt";
	let frame=-60;
	let angle=0;
	@Initialize
	{
	SetLife(200);
	SetDamageRateEx(70, 30, 30, 0);
}
	@MainLoop
	{
	yield;
	angle+=GetArgument;
	frame++;
	if(frame%25==0 && frame>0)
	{
	PlaySE(GetCurrentScriptDirectory~"sound\Shot1.wav");
	CreateShot01(GetX, GetY, 1.5, atan2(GetEnemyY-GetY, GetEnemyX-GetX)+angle, 37, 20);
	}
	if(GetKeyState(VK_SLOWMOVE)==KEY_PULL || GetKeyState(VK_SLOWMOVE)==KEY_FREE)
	{
	SetCollisionA(GetX(),GetY(),24);
	SetCollisionB(GetX(),GetY(),24);
	}
}
	@DrawLoop
	{
	anim2;
}

}