#TouhouDanmakufu
#Title[NueS1_H]
#Text[NueS1_H]
#Player[FREE]
#ScriptVersion[2]
#BGM[.\mu\bgm.mp3]

script_enemy_main {

	#include_function ".\Nueinclude.txt";

	@Initialize{
	shotinit;
	LoadGraphic(imglifebar); 
	LoadSE(time1);
	LoadGraphic(imageFile);
	LoadSE(time2);
	LoadSE(charge);
	LoadSE(familiarspawn);
	InitializeAction;
	SetLife(1500);
	LoadSE(shot);
	DelayedStart;
	LoadSE(shot2);
	SetTimer(99);
	SetEnemyMarker(true);
	SetInvincibility(240);
	SetDamageRate(40, 25);
	SetMovePosition02(GetCenterX, GetClipMinY + 120, 60);
	SetAction(ACT_MOVE, 60);
	SetShotAutoDeleteClip(50, 50, 50, 50);
	LoadGraphic(SP);
	LoadGraphic(MC);
	LoadGraphic(CBG1);
	LoadGraphic(CBG2);
	LoadGraphic(Cut);
	LoadSE(orb);
	LoadSE(warp);
	LoadSE(caution);
	LoadSE(border);
	SetAction(ACT_MOVE, 60);
	}


task DelayedStart {
wait(60);
SetScore(50000);
PlaySE(GetCurrentScriptDirectory~"cardcall.wav");
cutin("Identified "\""Red Fish, Blue Fish"\", Cut, 0, 0, 256, 512);
SetAction(ACT_SPELL, 90);
attack1;
attack2;
SetTimer(43);
}



	task attack2 { 
	wait(280);
	let angle2 = 0;
	loop{
	PlaySE(shot3);
	loop(30){
	ascent(i in 0..4){
	CreateShot01(GetX, GetY, 1+(i/2), GetAngleToPlayer+angle2+(18*i), PURPLE23, 10);
	}
	angle2+=360/30;
	}
	wait(120);
	}
	}
	
	

	task attack1 {
	wait(120);
	let one = 1;
	let angle = 0;
	loop{
	angle = GetAngleToPlayer;
	SetAction(ACT_SHOT_B, 160);
	loop(16){
	PlaySE(shot);
	ascent(i in -9..9){
	CreateShotA(1, GetX, GetY, 10);
	SetShotDataA(1, 0, 2, angle+(i*20), 0, -0.02, 0, BLUE04);
	SetShotDataA(1, 20, 2.25, angle+(i*20)+45, 0, 0, 2, BLUE04);
	SetShotDataA(1, 40, 2.25, angle+(i*20)-45, 0, 0, 2, BLUE04);
	SetShotDataA(1, 60, 2.25, angle+(i*20)+45, 0, -0.02, 0, BLUE04);
	SetShotDataA(1, 120, 0, NULL, 0.45, 0.05, 2, BLUE04);
	FireShot(1);
	CreateShotA(2, GetX, GetY, 10);
	SetShotDataA(2, 0, 2, angle+(i*20), 0, -0.02, 0, PURPLE04);
	SetShotDataA(2, 20, 2.25, angle+(i*20)-45, 0, 0, 2, RED04);
	SetShotDataA(2, 40, 2.25, angle+(i*20)+45, 0, 0, 2, RED04);
	SetShotDataA(2, 60, 2.25, angle+(i*20)-45, 0, -0.02, 0, RED04);
	SetShotDataA(2, 120, 0, NULL, -0.45, 0.05, 2, RED04);
	FireShot(2);
	}
	wait(10);
	}
	one=one*-1;
	angle=10*one;
	ExMove;
	wait(120);
	}
}



@BackGround{
SetTexture(CBG1);
SetRenderState(ALPHA);
SetGraphicAngle(0, 0, anim2);
SetGraphicScale(1, 1);
SetGraphicRect(0, 0, 512, 512);
SetAlpha(200);
DrawGraphic(GetCenterX, GetCenterY);
SetTexture(CBG2);
SetRenderState(ALPHA);
SetGraphicAngle(0, 0, 0);
SetGraphicScale(1, 1);
SetGraphicRect(0, 0, 512, 512);
SetAlpha(100);
DrawGraphic(GetCenterX, GetCenterY);


anim2 += 1;
acc1 = 6;


}




	
}