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


script_enemy_main {

     #include_function "lib\SHOT_REPLACE\shot_replace.dnh"

     let frame = 0;
     let frame2 = 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, " Hallucination "\""Starburst"\", "script\img\Reisen.png", 0, 0, 200, 500);
        SetScore(123456);
        SetTimer(50);
        SetDurableSpellCard;
        MagicCircle(true);
        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==55){

	loop(14){
		CreateShot01(GetX, GetY, 3, angle, WHITEI59, 0);
		angle += 360/14;
	}

	loop(14){
		CreateShot01(GetX, GetY, 2.75, angle, BLUE58, 0);
		angle += 360/14;
	}

	loop(14){
		CreateShot01(GetX, GetY, 2.5, angle, RED58, 0);
		angle += 360/14;
	}

	loop(14){
		CreateShot01(GetX, GetY, 2.25, angle, WHITE58, 0);
		angle += 360/14;
	}

	loop(14){
		CreateShot01(GetX, GetY, 2, angle, GREEN58, 0);
		angle += 360/14;
	}

	loop(14){
		CreateShot01(GetX, GetY, 1.75, angle, ORANGE58, 0);
		angle += 360/14;
	}

	loop(14){
		CreateShot01(GetX, GetY, 1.5, angle, AQUA58, 0);
		angle += 360/14;
	}

	loop(14){
		CreateShot01(GetX, GetY, 1.25, angle, PURPLE58, 0);
		angle += 360/14;
	}
	
                		angle += 45;
				angle2 += rand(8, 10);

		frame = 0;
        }
       
         frame++;

	if(frame2==120){

		loop(30){
			CreateShot01(GetX + 60*cos(angle2), GetY + 60*sin(angle2), 2, angle2+GetAngleToPlayer, WHITE59, 0);
			angle2 += 12;
		}
		frame2 = 0;
	}

	frame2++;
 }
     
     

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

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