#TouhouDanmakufu
#Title [Spell 2]
#ScriptVersion[2]


script_enemy_main {

     #include_function "lib\SHOT_REPLACE\shot_replace.dnh"

     let frame = 0;
     let angle = 60;
     let angle2 = 62;
     let angle3 = 64;
    @Initialize {
        SetX(GetCenterX);
        SetY(GetClipMinY + 120);
        SetLife(1000);
        SetDamageRate(25, 15);
        SetEnemyMarker(true);
        CutIn(KOUMA, " Curve ", "script\img\Reisen.png", 0, 0, 200, 500);
        SetScore(123456);
        SetTimer(50);
        SetDurableSpellCard;
        MagicCircle(false);
        shotinit;

        LoadGraphic("script\img\Reisen.png");
        SetTexture("script\img\Reisen.png");
        SetGraphicRect(0, 0, 400, 533);
    }

    @MainLoop {
        SetCollisionA(GetX, GetY, 24);
        SetCollisionB(GetX, GetY, 24);
        let a = 0;

        if(frame==5){


		loop(24){
			CreateShot01(GetX, GetY, 3, angle2, WHITEI11, 0);
			angle2 += 360/24;
		}

        	CreateShotA(1, GetX, GetY, 10);
        	SetShotDataA(1, 10, 4, angle, 0.45, 0, 4, BLUE53);
		FireShot(1);

        	CreateShotA(2, GetX, GetY, 10);
        	SetShotDataA(2, 10, 4, angle-10, 0.45, 0, 4, AQUA53);
		FireShot(2);

        	CreateShotA(3, GetX, GetY, 10);
        	SetShotDataA(3, 10, 4, angle-20, 0.45, 0, 4, RED53);
		FireShot(3);

        	CreateShotA(4, GetX, GetY, 10);
        	SetShotDataA(4, 10, 4, angle-30, 0.45, 0, 4, GREEN53);
		FireShot(4);

        	CreateShotA(5, GetX, GetY, 10);
        	SetShotDataA(5, 10, 4, angle+10, 0.45, 0, 4, ORANGE53);
		FireShot(5);

        	CreateShotA(6, GetX, GetY, 10);
        	SetShotDataA(6, 10, 4, angle-40, 0.45, 0, 4, PURPLE53);
		FireShot(6);

        	CreateShotA(7, GetX, GetY, 10);
        	SetShotDataA(7, 10, 4, angle+20, 0.45, 0, 4, YELLOW53);
		FireShot(7);

        	CreateShotA(8, GetX, GetY, 10);
        	SetShotDataA(8, 10, 4, angle-50, 0.45, 0, 4, WHITE53);
		FireShot(8);

		frame = 0;
                		angle -= rand(8, 10);
				angle2 += rand(15, 30);


        }
       
         frame++;
 }
     
     

    @DrawLoop {
        DrawGraphic(GetX, GetY);
	SetGraphicScale(0.25, 0.25);
    }

    @Finalize{
        DeleteGraphic("script\img\ExRumia.png");
     }
}