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


script_enemy_main {

     #include_function "lib\SHOT_REPLACE\shot_replace.dnh"

     let frame = 0;
     let frame2 = 0;
     let angle = 60;
     let angle2 = 40;
     let angle3 = 64;
    @Initialize {
        SetX(GetCenterX);
        SetY(GetClipMinY + 120);
        SetLife(1000);
        SetDamageRate(25, 15);
        SetEnemyMarker(true);
        CutIn(KOUMA, " Hallucination "\""Syllable Seals"\", "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);

        if(frame==30){

	CreateShot02(GetX + 30*cos(0), GetY + 30*sin(0), 0.25, GetAngleToPlayer, 0.1, 5, SP04, 45);
	CreateShot02(GetX + 30*cos(72), GetY + 30*sin(72), 0.25, GetAngleToPlayer, 0.1, 5, SP04, 45);
	CreateShot02(GetX + 30*cos(144), GetY + 30*sin(144), 0.25, GetAngleToPlayer, 0.1, 5, SP04, 45);
	CreateShot02(GetX + 30*cos(216), GetY + 30*sin(216), 0.25, GetAngleToPlayer, 0.1, 5, SP04, 45);
	CreateShot02(GetX + 30*cos(282), GetY + 30*sin(282), 0.25, GetAngleToPlayer, 0.1, 5, SP04, 45);

	CreateShot02(GetX + 60*cos(0), GetY + 60*sin(0), 0.5, GetAngleToPlayer, 0.125, 5, SP05, 20);
	CreateShot02(GetX + 60*cos(72), GetY + 60*sin(72), 0.5, GetAngleToPlayer, 0.125, 5, SP05, 20);
	CreateShot02(GetX + 60*cos(144), GetY + 60*sin(144), 0.5, GetAngleToPlayer, 0.125, 5, SP05, 20);
	CreateShot02(GetX + 60*cos(216), GetY + 60*sin(216), 0.5, GetAngleToPlayer, 0.125, 5, SP05, 20);
	CreateShot02(GetX + 60*cos(282), GetY + 60*sin(282), 0.5, GetAngleToPlayer, 0.125, 5, SP05, 20);
	CreateShot02(GetX, GetY, 0.5, GetAngleToPlayer, 0.125, 5, SP07, 20);


	frame = 0;	

	}

	if(frame2==3){
		CreateShot01(GetX, GetY, 4, rand(0, 360), RED56, 0);
       	 	CreateShot01(GetX, GetY, 4, rand(0, 360), GREEN56, 0);
		CreateShot01(GetX, GetY, 4, rand(0, 360), BLUE56, 0);
       	 	CreateShot01(GetX, GetY, 4, rand(0, 360), YELLOW56, 0);
       	 	CreateShot01(GetX, GetY, 4, rand(0, 360), PURPLE56, 0);


		frame2 = 1;
	}

          frame++;
	  frame2++;
    }

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

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