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

script_enemy_main {

	#include_function ".\Shinkiinclude.txt";
	let i = 0;
	let one = 0;
	let anim3 = 0;
	let color = 0;
	let x = 0;
let angle2 = 0;
let y = 0;
let one = 1;
	@Initialize{
	shotinit;
	LoadSE(time1);
	LoadGraphic(background);
	LoadGraphic(imageFile);
	LoadSE(time2);
	LoadSE(charge);
	LoadSE(familiarspawn);
	InitializeAction;
	SetLife(1500);
	LoadSE(ping);
	LoadSE(shot);
	DelayedStart;
	LoadSE(shot2);
	LoadSE(die);
	LoadGraphic(background);
	SetTimer(99);
	SetEnemyMarker(true);
	SetInvincibility(270);
	SetDamageRate(40, 30);
	SetMovePosition02(GetCenterX, GetClipMinY + 120, 60);
	SetAction(ACT_MOVE, 60);
	SetShotAutoDeleteClip(30, 50, 30, 40);
	LoadGraphic(SP);
	LoadGraphic(MC);
	LoadGraphic(CBG1);
	LoadGraphic(CBG2);
	LoadSE(shot4);
	LoadSE(dream);
	LoadSE(die);
	LoadGraphic(Cut);
	SetAction(ACT_MOVE, 60);
	SetCommonData("lastattack", false);
	
	}

task DelayedStart {
let radius = 30;

wait(90);
SetScore(275000);
PlaySE(GetCurrentScriptDirectory~"cardcall.wav");
cutin("God Art "\""Chain of Divine Creation"\", Cut, 0, 0, 256, 512);
SetAction(ACT_SPELL, 90);
GenericSpell;
//Shiny;
SetTimer(62);
}


task GenericSpell{
wait(150);
loop{
	SetAction(ACT_SHOT_A, 90);
	wait(30);
	one = one*-1;
	PlaySE(shot);
	loop(6){
		CreateShotA(1, GetX, GetY, 0);
		SetShotDataA(1, 0, 1, 90+angle, 0, -0.01, 0, BLUE03);
		SetShotDataA(1, 60, 0, 90+angle, 0.01*one, 0.02, 2, BLUE03);
	ascent(i in 0..50){
		CreateShotA(2, 0, 0, 30);
		SetShotDataA(2, 0, 0, 180+angle+(i*3), 0, 0.02, 0, RED01);
		SetShotDataA(2, 60, 0, 180+angle+(i*30), 0, 0.02, 2.5-(i/20), RED01);
		AddShot(60+(i*5), 1, 2, 0);
		CreateShotA(3, 0, 0, 30);
		SetShotDataA(3, 0, 0, angle-(i*3), 0, 0.02, 0, BLUE01);
		SetShotDataA(3, 60, 0, angle-(i*30), 0, 0.02, 2.5-(i/20), BLUE01);
		AddShot(60+(i*5), 1, 3, 0);
		}
	PlaySE(shot);
	FireShot(1);
	angle+=360/6;
		} 
wait(60);
ExMove;
wait(60);
loop(16){
PlaySE(shot);
loop(3){
CreateShot01(GetX, GetY, 2, angle+angle2, YELLOW03, 10);
angle+=360/3;
}

wait(10);
angle2+=23;
}
wait(60);
}
}





    @BackGround{
	 SetTexture(background);
   SetGraphicRect(0, 0 - y, 256, 256 - y);
   SetGraphicScale(2, 2);
   DrawGraphic(GetCenterX, GetCenterY);
   y+=1;




	
}
}

