
#Title[]
#Text[XgXyB

VbgłĂȂȂ邪AϋvXył͂ȂB
CɂAdȓՓxɂȂĂ邪CɂȂB
]
#Image[.\img\Last_Spell.png]
#BackGround[Defoult]
#BGM[bgm\bgm.wav]
#PlayLevel[]
#Player[FREE]
#ScriptVersion[2]

script_enemy_main
{
    @Initialize
    {
        let SpellName = "Cu\Ƌ -" ~ TextLevel(Level) ~ "-v";	//Xy
        CutIn(YOUMU, SpellName, NULL, 0, 0, 0, 0);	//Xy錾
        SetLife(10000);			//̗
				//Ԃ͖
        SetScore(123456789);		//_
        LastSpell;			//XgXy錾
        SetDamageRate(0, 0);		//_[WBЂ疳GB

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

        TMain;
        TTellLastSpell;			//Last Spellʒm
    }


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

        yield;
    }


    @DrawLoop
    {
        DrawGraphic(GetX, GetY);	//G@̕`
        SetFontColor(ColorText[0], ColorText[1], ColorText[2], ColorText[3], ColorText[4], ColorText[5]);
        DrawText("Last Spell", XText[0], XText[1], SizeText, AlphaText);
    }


    @Finalize
    {
        DeleteGraphic(imgBoss);

        EndMirrorWorld;		//]E
    }

 /*j
*
*T1 o( 99.Last_Spell.txt\First )
*
*T2 |[YƂ( 99.Last_Spell.txt\Secand )
*
*T3 ˋE@ǔ( Mirror.txt\Mirror\PutMirror\TLockOnPlayer )
*T3 ]E( Mirror_World.txt\MirrorWarld\all )
*T3 Oe( Outer_Shot.txt\TOuterShot )
*T3 @e~( 99.Last_Spell.txt\TMain )
*
*T4 ΂܂Jn( Scatter_Shot.txt\TScatterShot )
*loop
*{
*    T4 ˏ( 99.Last_Spell.txt\SetOrder )
*    T4 ˋ]Jn( 99.Last_Spell.txt\TMain )
*
*    T5 G@ړ( Enemy_Move.txt\EnemyMove )
*
*    T6 G@~( Enemy_Move.txt\EnemyMove )
*
*    T7 xƎ( Warning_Laser.txt\WaningLaser )
*
*    T7 C( Main_Shot.txt\MainShot )
*    T7 ˋ~( 22.Reflected_Laser.txt\TMain )
*}
*
*ꏈF]( Mirror.txt\Mirror\PutMirror\TLockOnPlayer )
*
*Փx␳
*Frobitten	FSėLBNAs\ȒeB
*Lunatic	FSėLBꒃB
*Hard	F~[[hB
*Normal	F~[[hEUeB
*Easy	F~[[hEUeBp[^́Aɂ߂ĒႢB
*All	FeZxECECˊԊuEe_[W
*/

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

        First;				//ʒuւ̈ړ

        wait(TimeToMakeMirror);

        Secand;			//|[YƂ
        Mirror;			//ˋ̐(DelayL)
        TOuterShot;			//Oe(DelayL)
        wait(TimeMirrorDelay);
        ForbidShot(true);		//e~
        if(Level >= 3) {TMirrorWorld;}	//]E
 
        if(Level >= 2) {TScatterShot;}	//΂܂˒e

        loop
        {
            SetOrder;			//ˏ̌
            LockMirror = false;		//ˋ]Jn

            wait(TimeRotateToMove);

            MoveRandam;		//G@ړ

            wait(TimeMoveStopToWaning);

            WarnigLaser;			//xp[U[

            MainShot;			//C
            LockMirror = true;		//ˋŒ

            wait(TimeRestartRotate);
        }
    }

    sub First			//ʒuւ̈ړ
    {
        let time = TimeBossApply;
        let x = GetCenterX;
        let y = GetClipMinY + 96;

        SetMovePosition02(x, y, time);
        SetGraphicM;
        wait(time);
        SetGraphic0;
    }

    sub Secand
    {
        SetColor(196, 64, 64);
        Concentration01(TimeMirrorDelay);
    }

    sub SetOrder			//ˏ
    {
        let n = length(ListMirrors);	//ˋ̐
        let order = NumberSelect(n + 1);	//ˋ̏̌
        if(order[0] == n)			//ˋ̏̕␳
        {
            order[0] = order[n];
            order[n] = n;
        }
        ReflectOrder = order;		//O[oϐ
    }

    //tH_F91.Last_SpellȂO[oϐ
    //gpO[oϐFȂ
    //o̓O[oϐFLockMirror, ReflectOrder



    //Oψ
    #include_function".\01.common.txt"

    //C֘AǗ
        //C
        #include_function".\91.Last_Spell\Main_Shot.txt"
        #include_function".\00.Common\Lock_with_Mirror\Control_Main_Shot.txt"

        //ˋ
        #include_function".\91.Last_Spell\Mirror.txt"
        #include_function".\00.Common\Lock_with_Mirror\Control_Mirror.txt"

        //xƎˌW
        #include_function".\91.Last_Spell\Warning_Laser.txt"
        #include_function".\00.Common\Lock_with_Mirror\Control_Warning_Laser.txt"

    //ʒe䕔
        //UeW
        #include_function".\91.Last_Spell\Scatter_Shot.txt"
 
       //OeW
        #include_function".\91.Last_Spell\Outer_Shot.txt"
        #include_function".\00.Common\Reflection\Create_Outer_Shot.txt"

    //
        //~[[h
        #include_function".\91.Last_Spell\Mirror_World.txt"
        #include_function".\00.Common\Mirror_World\Mirror_World.txt"
        #include_function".\00.Common\Mirror_World\Check_Player_State.txt"
        #include_function".\00.Common\Mirror_World\End_Mirror_World.txt"

        //
        #include_function".\00.Common\Lock_with_Mirror\Calculation.txt"
        #include_function".\91.Last_Spell\Global_Variable.txt"

        //G@S
        #include_function".\91.Last_Spell\Enemy_Moving.txt"

        //XgXyʒmS
        #include_function".\91.Last_Spell\Tell_Last_Spell.txt"
}

  
