
#Title[EirinS1_H]
#Text[For library corridors there's an awful lot of WALLS.]
#Player[FREE]
#ScriptVersion[2]
#BGM[.\mu\bgm.mp3]

script_enemy_main {
let c = 0;
let life = 0;
let angle3 = 0;
let angle2 = 0;
	#include_function ".\Eirininclude.txt";

	@Initialize{
	DeleteSE("se\seEnemyExplode01.wav");
	shotinit;
	LoadGraphic(imglifebar); 
	LoadSE(time1);
	LoadGraphic(imageFile);
	LoadSE(time2);
	LoadSE(charge);
	LoadSE(laser2);
	LoadSE(familiarspawn);
	InitializeAction;
	LoadSE(capture);
	SetLife(1500);
	LoadSE(shot);
	DelayedStart;
	LoadSE(shot2);
	SetTimer(99);
	SetEnemyMarker(true);
	SetInvincibility(180);
	SetDamageRate(35, 25);
	SetMovePosition02(GetCenterX, GetClipMinY + 120, 60);
	SetAction(ACT_MOVE, 60);
	SetShotAutoDeleteClip(50, 100, 50, 50);
	LoadGraphic(SP);
	LoadGraphic(MC);
	MagicCircle(false);
	LoadGraphic(CBG1);
	LoadGraphic(CBG2);
	LoadGraphic(CBG3);
	LoadGraphic(CBG4);
	LoadGraphic(CBG5);
	LoadGraphic(Cut);
	LoadSE(orb);
	LoadSE(warp);
	LoadSE(caution);
	LoadSE(border);
	SetAction(ACT_MOVE, 60);
	}


task DelayedStart {
wait(60);
SetScore(5000000);
PlaySE(GetCurrentScriptDirectory~"cardcall.wav");
cutin("Mind of God "\""Corridors of Benzaiten's Library"\", Cut, 0, 0, 256, 512);
SetAction(ACT_SPELL, 90);
attack1;
attack2;
attack3;
SetTimer(73);
wait(120);
SetCommonData("spells", GetCommonDataDefault("spells", 0)+1);
}




		

task attack1 {
wait(210);
loop{
		PlaySE(shot);
		loop(14){
			CreateShot01(GetX, GetY, 4, angle, ORANGE54, 10);
			angle+=360/14;
			}
wait(20);


}

}

task attack2 {
wait(240);

Concentration01(120);
PlaySE(charge);
SetAction(ACT_SHOT_B, 120);
wait(120);
loop{

	PlaySE(shot3);
		loop(2){
		ascent(i in -10..10){
			CreateShot02(GetX, GetY, 5, angle3+angle+(i)*1.25+(360/14/2), -0.5, 1.25, YELLOW50, 10);
			}
	angle3+=(360/14)*7;
	}
	angle+=360/14;
	
	wait(60);
	



}

}


task attack3{
angle2 = rand(0, 360);
wait(150);
loop{
PlaySE(shot4);
ascent(i in 0..3){
		loop(2){
			CreateShot01(GetX, GetY, 0.75+(i/2.5), angle2, PURPLEI12, 10);
			angle2+=360/2;
			}
}
angle2+=11.5; 
wait(5);


}

}



@BackGround{
SetTexture(CBG1);
SetGraphicRect(0, anim2/-2, 512, 512+(anim2/-2));
DrawGraphic(GetCenterX, GetCenterY);
SetTexture(CBG2);
SetAlpha(130);
SetGraphicScale(0.5, 1);
SetGraphicRect(0, anim2*3, 512, 512 + anim2*3);
DrawGraphic(GetCenterX-130, GetCenterY);
DrawGraphic(GetCenterX+130, GetCenterY);
SetGraphicScale(1, 1);
SetAlpha(255);
SetTexture(CBG3);
SetGraphicRect( 0, 0, 512, 512 );
DrawGraphic(GetCenterX, GetCenterY);
SetTexture(CBG4);
SetRenderState(ADD);
SetGraphicRect(0, 0, 512, 512);
SetGraphicScale(0.9, 0.9);
SetColor(80, 80, 80);
DrawGraphic(GetCenterX, GetCenterY-70);
SetColor(255, 255, 255);
SetRenderState(ALPHA);
SetGraphicScale(1, 1);



anim2 += 1;
acc1 = 6;


}




}





