

script_enemy_main
{
    let count=0;
    let count2=0;
    let count3=0;
    let count4=0;
    let ten=0;
    let life=0;
    let get;
    let try;

    let move=0;

    let pass=GetCurrentScriptDirectory~"Spell.dat";

    let cx=GetCenterX();
    let img=GetCurrentScriptDirectory~"img\dot_remilia.png";
    let mm=0;
    let shot=0;
    let tame=0;
    let tame2=0;
    let d=70;
    let ang=0;

    @Initialize()
    {
        MagicCircle(false);
        SetLife(5000);
        AddLife(-4999);
        SetDamageRate(0,0);
        SetInvincibility(0);
        LoadGraphic(img);
        SetShotAutoDeleteClip(32,32,32,32);
        SetMovePositionRandom01(0,200,3,cx,88,cx,88);
        LoadUserShotData(GetCurrentScriptDirectory~".\shot_All.txt");

    }

    @MainLoop()
    {
        if (count4==0) {
            SetSpeed(0);
            SetMovePositionRandom01(45,0,12,GetCenterX(),100,GetCenterX(),100);
            DeleteEnemyShotToItemInCircle(CHILD,GetX(),GetY(),500);
            PlaySE(GetCurrentScriptDirectory~"\se\Baaaaaaaan.wav");
            CreateEnemyFromFile(GetCurrentScriptDirectory~"Servant10.txt",GetX,GetY,0,0,3);
        }
        if (count4<=240&&count%5==0&&rand(0,10)<=4) {
            PlaySE(GetCurrentScriptDirectory~"\se\Baaaan2.wav");
            CreateEnemyFromFile(GetCurrentScriptDirectory~"Servant10.txt",GetX+rand(-33,33),GetY+rand(-23,63),0,0,0);
        }
        if (count4>=210) {
            VanishEnemy;
        }
        if (count4==120) {
            SetSpeed(0);
            SetMovePositionRandom01(45,0,12,GetX(),GetY(),GetX(),GetY());
        }
        if (count4>=120) {
            count3++;
            SetAngle(90);
            SetSpeed(count3*0.1);
        }
        if (count4==209) {
            PlaySE(GetCurrentScriptDirectory~"\se\bom13.wav");
            SetCommonData("flash2",255);
            SetCommonData("Go",1);
        }
        count++;
        count2++;
        count4++;
        yield;
    }

    @Finalize()
    {}

    @DrawLoop()
    {
        SetTexture(img);
        SetAlpha(255);
        SetGraphicAngle(0,0,count3*2);
        SetColor(255-count3*2,255-count3*2,255-count3*2);
        SetRenderState(ALPHA);
        SetGraphicScale(1,1);
        SetGraphicRect(256,0,384,128);
        if (count4>=45) {
            SetGraphicRect(0,0,128,128);
        }
        if (count4>=60) {
            SetGraphicRect(128,0,256,128);
        }
        DrawGraphic(GetX(),GetY());

    }


}

