
#Title[紫（ゆか）巫女！]
#Text[１面道中]
//#BackGround[]
#PlayLevel[Nomal]
#ScriptVersion[2]

script_enemy_main {
    	let imgBoss     = "script\img\ExRumia.png";
	let frame = 0;
	let cnt = 0;
	let Angle = GetAngleToPlayer();
	let dan = WHITE01;
	let speed = rand(1,5);
	let shotlate = 30;
	let bomblate = 30;
	let six	 = 10;
	let flag = 1/2;
	let flagA = 1;
	let flagB = 0;
	let flagC = 1;
	let type = ABSOLUTE;
	let bgm = ".\bgm\bgm03.wav";

	LoadMusic(bgm);
	PlayMusic(bgm);
	
    	@Initialize {
		CutIn(YOUMU,"","",0,0,0,0);
		SetX(GetCenterX);
		SetY(GetClipMinY + 120);
		SetLife(4923);

        	LoadGraphic(imgBoss);
	        SetTexture(imgBoss);
        	SetGraphicRect(0, 0, 63, 63);
		SetTimer(100);
		SetDamageRate(30,0);
		Expert();
		SetAllowedContinueCount(0);
    	}

    	@MainLoop {
		SetCollisionA(GetX, GetY, 24);
        	SetCollisionB(GetX, GetY, 24);
		//SetDurableSpellCard;
		//ForbidShot(true);
		ForbidBomb(true);
		
		//SetShotDirectionType(PLAYER);
		frame++;
		
		if(frame == 1)
		{
			loop(flagA){
			loop(6){
			SetShotDirectionType(PLAYER);
			CreateShot01(GetX,GetY,2,six,YELLOW31,0);
			six+=10;
			}
			}
			loop(flag){
			loop(3){
			CreateShot01(rand(GetClipMinX(),GetClipMaxX()),rand(GetCenterY(),GetClipMinY()),speed,rand(-180,180),dan,0);
			}
			}

			loop(flagB){
				loop(6){
				SetShotDirectionType(PLAYER);
				CreateShot01((GetCenterX()-GetClipMinX()),GetY,2,six,RED31,0);
				six+=10;
				}

				loop(6){
				SetShotDirectionType(PLAYER);
				CreateShot01(GetClipMaxX()-(GetCenterX()),GetY,2,six,PURPLE31,0);
				six+=10;
				}
			}

		}
		else if(frame == 8)
		{	
			if(flagC == 2)
			{type = SEQUENCE;}
			SetShotDirectionType(type);
			loop(flagC){
			CreateShot01(rand(GetClipMinX(),GetClipMaxX()),rand(GetCenterY(),GetClipMinY()),rand(1,2),Angle,RED01,0);
			}
			frame=0;
		}


			
		if(GetTimer() == 79)
		{dan = BLUE03;speed = 1;}
		if(GetTimer() == 77)
		{dan = GREEN05;speed = 2;}
		if(GetTimer() == 40)
		{dan = PURPLE21;speed = rand(3,4);}
		if(GetTimer() == 25)
		{DeleteEnemyShot(ALL);flag = 0;flagA =0;flagB =6;flagC = 2;}
		if(GetTimer() == 30)
		{shotlate = 200;}
		if(GetTimer() == 10)
		{shotlate = 400;}
		}
	}
	@DrawLoop {
		//DrawGraphic(GetX, GetY);
	}

    	@Finalize {
		DeleteEnemyShot(ALL);
        	DeleteGraphic(imgBoss);
	}

}