#e
#Title[ΕuAOjXt[v]
#Text[]
#Image[.]
#BackGround[User]
#ScriptVersion[2]
script_enemy_main {
    let name    = "ΕuAOjXt[v";
let csd = GetCurrentScriptDirectory;
    let imgBoss =csd ~ "lib/patchouli_dot.png"; 
    let imgFam  = csd ~ "img\familiar.png";
SetRateScoreSystemEnable(false);
    // ʒu
    let xIni    = GetCenterX;
    let yIni    = GetClipMinY + 128;
    @Initialize {

        SetLife(1600);
        SetDamageRate(5, 5);
        LoadGraphic(imgBoss);
        LoadGraphic(imgFam);
        SetTexture(imgBoss);
	InitializeAction();
        TMain;
    }

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

    @DrawLoop {
        DrawGraphic(GetX, GetY);
	DrawBoss( imgBoss );
    }

    @Finalize {
        DeleteGraphic(imgBoss);
    }

    // C^XN
task TMain 
{
	yield;
	standBy;
	spell;
	Trate;
	shot;
	SubShot;
}

task Trate
{
	wait(120);
        SetDamageRate(50, 50);
}




sub standBy//ʒu
{
	SetAction(ACT_MOVE, 60);
	let wIni = 60;
	SetMovePosition02(xIni, yIni, wIni);
	SetInvincibility(wIni);
	wait(wIni);
}

sub spell//[V
{
        CutIn(YOUMU, name, "", 0, 0, 0, 0);
        SetTimer(50);
        SetScore(22000000/3);
	SetAction(ACT_SPELL,90);
	wait(90);
}


task SubShot
{
let angle=0;
	wait(30);
	loop
	{
		ascent(let i in 0..10)
		{
		CreateShotA(1,GetX,GetY,30);
		SetShotDataA(1,0,3,angle+i*36,2,0,0,RED01);
		SetShotDataA(1,180,3,NULL,0,0,0,ORANGE01);
		FireShot(1);
		CreateShotA(2,GetX,GetY,30);
		SetShotDataA(2,0,3,-angle+i*36,-2,0,0,RED01);
		SetShotDataA(2,180,3,NULL,0,0,0,ORANGE01);
		FireShot(2);
		}
		wait(10);
		angle+=5;
	}
}

task shot
{
wait(240);
loop
{
	ascent(let i in 0..5)
	{
	CreateShot01(GetX,GetY,1+0.5*i,GetAngleToPlayer,RED03,0);
	}
wait(120);
}
}


#include_function ".\data.txt"
#include_function ".\lib/lib_anime_Patchouli.txt"
}
