#TouhouDanmakufu
#Title[Blossoming Grimoire "Judgement Star"]
#Text[Ever since the Flower Incident, the Yama has been visiting and scolding Marisa quite often. She created this to defend herself.]
#BackGround[User(.\img\BG.png,0,0)]
#PlayLevel[Normal]
#Player[FREE]
#BGM[.\bgm.mp3]
#ScriptVersion[2]
script_enemy_main	
{
#include_function ".\function_cutin.txt"
#include_function ".\lib.txt"
let bgalpha = 0;	
let bgangle = 0;	

let bossflip = 0;
let ani = 0;

@Initialize{
	LoadStuff;
	SetLife(4000);
	SetInvincibility(180);
	SetTimer(90);
	SetScore(1000000);
	cutin("NAZRIN","Blossoming Grimoire "\""Judgement Star"\",Maricutin,0,0,256,512);
	SetEffectForZeroLife(60,0,0);
	SetMovePosition02(GetCenterX,GetCenterY-120,60);
	LoadUserShotData(GetCurrentScriptDirectory~"Shot.txt");
	MainTask;
	Timer;
	MoveAnimation;
	}
task MainTask{
	Wait(60);
	SetColor(27,184,22);
	Concentration01(120);
	SetColor(255,255,255);
	PlaySE(Charge);
	Wait(120);
	StarSpiral;
	loop{
		LaserWings;
		YamaBeam;
		Wait(300);
		}
	}
task LaserWings{
	ascent(i in 0..3){
		CreateLaserA(i,GetX,GetY,300,20,3,60);
		SetLaserDataA(i,0,GetAngleToPlayer-60-45+15*i,0,0,0,0);
		SetShotKillTime(i,180);
		FireShot(i);
		}
	ascent(i in 0..3){
		CreateLaserA(i,GetX,GetY,300,20,3,60);
		SetLaserDataA(i,0,GetAngleToPlayer+30+45+15*i,0,0,0,0);
		SetShotKillTime(i,180);
		FireShot(i);
		}
	}
task YamaBeam{
	CreateLaserA(0,GetX,GetY,600,20,7,60);
	SetLaserDataA(0,0,GetAngleToPlayer,0.01,0,0,0);
	CreateLaserA(1,GetX,GetY,600,20,7,60);
	SetLaserDataA(1,0,GetAngleToPlayer,-0.01,0,0,0);
	SetShotKillTime(0,240); SetShotKillTime(1,240);
	FireShot(0); FireShot(1);
	PlaySE(Laser);
	}
task StarSpiral{
	let angle = 90;
	loop{
		loop(12){
			CreateShotA(0,GetX,GetY,10);
			SetShotDataA(0, 3, 2.5,angle,0.5,0,0,147);
			FireShot(0);
			angle+=30;
			}
		angle+=12.4;
		Wait(5);
		}
	}
@MainLoop{
	SetCollisionA(GetX,GetY,48);
	SetCollisionB(GetX,GetY,32);
	yield;
	}
@DrawLoop{
	DrawName("Marisa Kirisame");
	SetAlpha(255);
	if (bossflip==0){SetGraphicScale(1,1);}
	if (bossflip==1){SetGraphicScale(-1,1);}
	SetColor(255,255,255);
	SetGraphicAngle(0,0,0);
	SetTexture(Marisprite);
	SetGraphicRect(BR[0],BR[1],BR[2],BR[3]);
	DrawGraphic(GetX,GetY);
	}

@BackGround{
	SpellBG;
	}
@Finalize{
	DeleteStuff;
	CaptureBonus;
	}
}