
#Title[ʏe2]
#Text[ʁEʁEʂɂ΂܂B
ˁAʏeB]
#Image[.\img\Norm2.png]
#BackGround[Defoult]
#BGM[bgm\bgm.wav]
#PlayLevel[]
#Player[FREE]
#ScriptVersion[2]

script_enemy_main
{
    @Initialize
    {
        SetLife(6000);			//̗
        SetTimer(60);			//
        SetDamageRate(300, 300);

        LoadGraphic(imgBoss);
        SetTexture(imgBoss);
        SetGraphic0;

        TMain;
    }


    @MainLoop
    {
        SetCollisionA(GetX, GetY, 32);	//eւ̓蔻
        SetCollisionB(GetX, GetY, 16);	//@ւ̓蔻

        yield;
    }


    @DrawLoop
    {
        DrawGraphic(GetX, GetY);	//G@̕`
    }


    @Finalize
    {
        DeleteGraphic(imgBoss);		//ȂƏdȂB

        loop(2*(Level + 1))		//o}L͑؁B
        {
            CreateItem(ITEM_SCORE, GetX + rand(-32, 32), GetY + rand(-32, 32));
        }

    }

    task TMain
    {
        if( !debug ) {Expert;}		//ReBj[EfobOL[
        yield;

        First;				//ʒuւ̈ړ

        wait(10);

        TShot;			//΂܂e
    }


    sub First			//ʒuւ̈ړ
    {
        let time = 120;
        let X = [GetCenterX, GetClipMinY + 128];

        SetMovePosition02(X[0], X[1], time);
        SetGraphicM;
        wait(time);
        SetGraphic0;
    }

    task TShot			//΂܂e
    {
        let n = [1, 1, 1, 1, 3][Level];		//1t[̒eB
        let v = [5, 4, 5, 7, 8][Level];		//e
        let L = 50;			//[U[̒E
        let D = 10;
        let ImgListS = [AQUA23, PURPLE23, YELLOW23];	//Vbg̃OtBbN
        let ImgListL = [AQUA02, PURPLE02, YELLOW02];	//[U[̃OtBbN

        loop
        {
            loop(n)
            {
                let ImgL = RandSelect(ImgListL);
                CreateLaser01(GetX, GetY, v, rand(0, 360), L, D, ImgL, 0);

                if(Level == 0) {break;}

                let ImgS = RandSelect(ImgListS);
                CreateShot01(GetX, GetY, v, rand(0, 360), ImgS, 0);
            }
        yield;				//[vh~B
        }
    }


    #include_function".\01.common.txt"
}

