#TouhouDanmakufu
#Title [Non 3]
#ScriptVersion[2]


script_enemy_main {

     #include_function "lib\SHOT_REPLACE\shot_replace.dnh"

     let frame = 0;
     let angle = 60;
     let angle2 = 60;
     let angle3 = 0;
    @Initialize {
        SetX(GetCenterX);
        SetY(GetClipMinY + 120);
        SetLife(5000);
        SetEnemyMarker(true);
        SetTimer(50);
        SetDurableSpellCard;
        MagicCircle(false);
        shotinit;
	CreateItem(ITEM_1UP, GetX, GetY);

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

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

        if(frame==15){

        CreateShotA(1, GetX, GetY, 10);
        SetShotDataA(1, 10, 4, angle, 0.1, 0, 4, BLUEI02);
        ascent(i in 15..40){
    		CreateShotA(5, 0, 0, 0);
		SetShotDataA(5, 0, 3, rand(0, 360), 0.1, 0, 3, REDI52);
                AddShot(i*2, 1, 5, 0);
        }
       
	FireShot(1);

        CreateShotA(2, GetX, GetY, 10);
        SetShotDataA(2, 10, 4, angle-90, 0.1, 0, 4, REDI02);
        ascent(j in 15..40){
    		CreateShotA(6, 0, 0, 0);
		SetShotDataA(6, 0, 3, rand(0, 360), 0.1, 0, 3, BLUEI52);
                AddShot(j*2, 2, 6, 0);
        }
    
	FireShot(2);

        CreateShotA(3, GetX, GetY, 10);
        SetShotDataA(3, 10, 4, angle-180, 0.1, 0, 4, BLUEI02);
        ascent(p in 15..40){
    		CreateShotA(7, 0, 0, 0);
		SetShotDataA(7, 0, 3, rand(0, 360), 0.1, 0, 3, REDI52);
                AddShot(p*2, 3, 7, 0);
	}

	FireShot(3);

        CreateShotA(4, GetX, GetY, 10);
        SetShotDataA(4, 10, 4, angle-270, 0.1, 0, 4, REDI02);
        ascent(p in 15..40){
    		CreateShotA(8, 0, 0, 0);
		SetShotDataA(8, 0, 3, rand(0, 360), 0.1, 0, 3, BLUEI52);
                AddShot(p*2, 4, 8, 0);
	}

	FireShot(4);

        CreateShotA(5, GetX, GetY, 10);
        SetShotDataA(5, 10, 4, angle, 0.1, 0, 4, REDI02);
        ascent(p in 15..40){
    		CreateShotA(9, 0, 0, 0);
		SetShotDataA(9, 0, 3, rand(0, 360), 0.1, 0, 3, BLUEI52);
                AddShot(p*2, 5, 9, 0);
	}

	FireShot(5);

        CreateShotA(6, GetX, GetY, 10);
        SetShotDataA(6, 10, 4, angle-90, 0.1, 0, 4, REDI02);
        ascent(p in 15..40){
    		CreateShotA(10, 0, 0, 0);
		SetShotDataA(10, 0, 3, rand(0, 360), 0.1, 0, 3, BLUEI52);
                AddShot(p*2, 6, 10, 0);
	}

	FireShot(6);

        CreateShotA(7, GetX, GetY, 10);
        SetShotDataA(7, 10, 4, angle-180, 0.1, 0, 4, REDI02);
        ascent(p in 15..40){
    		CreateShotA(11, 0, 0, 0);
		SetShotDataA(11, 0, 3, rand(0, 360), 0.1, 0, 3, BLUEI52);
                AddShot(p*2, 7, 11, 0);
	}

	FireShot(7);

        CreateShotA(8, GetX, GetY, 10);
        SetShotDataA(8, 10, 4, angle-270, 0.1, 0, 4, REDI02);
        ascent(p in 15..40){
    		CreateShotA(12, 0, 0, 0);
		SetShotDataA(12, 0, 3, rand(0, 360), 0.1, 0, 3, BLUEI52);
                AddShot(p*2, 8, 12, 0);
	}

	FireShot(8);

 		angle += 30;
   


        frame = 0;
        }

       
         frame++;
         angle3++;
	 a += 10;
 }
     
     

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

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