#TouhouDanmakufu
#Title[SatoriNonSpell H]
#Text[Nonspell]
#BackGround[User(.\img\stage.png,0,-0.5)]
#PlayLevel[Extra]
#Player[FREE]
#BGM[.\Heartfelt Fancy.mp3]
#ScriptVersion[2]

script_enemy_main
{
#include_function ".\Library.dnh"

let SatoriSprite = csd~"img/Satori/SatoriSprite.png";

@Initialize
	{
	LoadUserShotData(csd~"Shot.txt");
	LoadGraphic(SatoriSprite);
	SetLife(2000);
	SetEnemyMarker(true);
	SetDamageRate(5,5);
	SetTimer(71);
	//let a=0;
	SetEffectForZeroLife(60,0,0);	
	SetDurableSpellCard;
	

MainTask;
Vulnerable;
Timer;
IdleSatori;
//MoveAbout;
SetMovePosition03(GetCenterX, GetCenterY - 130, 30,10);
}

task Vulnerable
{
Wait(1200);
SetDamageRate(50,50);
}


task MainTask
{
Wait(120);
let a=0;
let b=0;
let c=0;
let d=0;
loop
	{a=a+1.2;
b=b+0.1;
c=c+180*sin(d);
d=d+0.4;
	yield;
	CreateShot01(GetX+30*cos(c),GetY+30*sin(c),4,90+90*sin(2*a),30,5);
	CreateShot01(GetX+30*sin(c),GetY+30*cos(c),4,90+90*cos(2*a),25,5);
	}
}

task MoveAbout
{
SetMovePosition02(GetCenterX,GetCenterY-120,60);
MoveSatori;
loop
	{
	Wait(250);
	SetMovePositionRandom01(64,64,1,GetClipMinX+64,GetClipMinY+64,GetClipMaxX-64,GetClipMinY+128);
	MoveSatori;
	Wait(150);
	}
}

@MainLoop
	{
	SetCollisionA(GetX,GetY,16);
	SetCollisionB(GetX,GetY,20);
	yield;
	}



@DrawLoop
	{
	SetAlpha(255);
	if (bossflip==0){SetGraphicScale(1,1);}
	if (bossflip==1){SetGraphicScale(-1,1);}
	SetColor(255,255,255);
	SetGraphicAngle(0,0,0);
	SetTexture(SatoriSprite);
	SetGraphicRect(BR[0],BR[1],BR[2],BR[3]);
	DrawGraphic(GetX,GetY);
	}

@Finalize
	{
	DeleteGraphic(SatoriSprite);
	}

}