

script_enemy_main
{
    let cx = GetCenterX();
    let cy = GetCenterY();
    let d = 0;
    let move = 0;
    let count = 0;
    let count2 = 0;
    let img=GetCurrentScriptDirectory~"img\dot_flandre.png";
    @Initialize()
    {
        SetLife(90000);
        SetGraphicRect(0,0,128,128);
        CollectItems;
    }

    @MainLoop()
    {
        count2++;
        SetCommonDataEx("Spell","omake01",1);
        if (OnEvent()==true) {
            break;
        }
        if (count >= 255&&d<255)
        {
            d+=5;
        }
        if (count == 370&&GetPlayerLife<=3&&GetCommonDataDefault("miss",0)!=2)
        {
            CreateEventFromScript("A");
        }
        if (count == 371&&GetPlayerLife<=3&&GetCommonDataDefault("miss",0)!=2)
        {
            CreateItem(ITEM_1UP,GetX(),GetY());
            CreateEventFromScript("B");
        }
        if (count == 380)
        {
            VanishEnemy;
        }
        count++;
    }

    @DrawLoop
    {
        SetTexture(GetCurrentScriptDirectory~"\img\dot_remilia.png");
        SetGraphicAngle(0,0,0);
        if (count < 255)
        {
            SetAlpha(count);
            SetColor(d,d,d);
        }
        if (count >= 255)
        {
            SetAlpha(255);
            SetColor(d,d,d);
        }
        SetRenderState(ALPHA);
        SetGraphicScale(1,1);
        SetGraphicRect(128,128,256,256);
        if (count >= 255)
        {
            if (count2/12%4>=0) {
                SetGraphicRect(0,0,128,128);
            }
            if (count2/12%4>=1) {
                SetGraphicRect(0,128,128,256);
            }
            if (count2/12%4>=2) {
                SetGraphicRect(0,256,128,384);
            }
            if (count2/12%4>=3) {
                SetGraphicRect(0,384,128,512);
            }
        }
        DrawGraphic(GetX(),GetY());

    }

    @Finalize() {
        ForbidShot(false);
        ForbidBomb(false);
    }
}



script_event A
{
    let count = 0;
    @Initialize
    {
    }

    @MainLoop
    {
        TextOutB(160,"\c[RED]そんな残機で大丈夫？");
        End();
    }

    @Finalize
    {

    }
}

script_event B
{
    let count = 0;
    @Initialize
    {
    }

    @MainLoop
    {
        TextOutB(160,"\c[RED]・・・受け取りなさい");
        End();
    }

    @Finalize
    {

    }
}

script_event C
{
    let count = 0;
    @Initialize
    {
    }

    @MainLoop
    {
        if (Select("\c[BLUE]裏に行く","\c[BLUE]裏に必要性が感じられない")==1)
        {
            SetCommonData("miss",2);
        }
        else
        {
            SetCommonData("miss",1);
        }
        End();
    }

    @Finalize
    {

    }
}


