
script_enemy_main {
	#include_function ".\lib\lib_anime_mokou.txt"
	#include_function ".\Draw.txt"
	#include_function ".\lib_Functions.txt"
	let imgBoss	=csd ~ "img\dot_mokou.png";
	let imgback	=csd~"img\back2.png";

	@Initialize {
        	SetLife(2400);
		SetTimer(90);
		SetScore(3000000);
		SetDamageRate(0, 0);
		InitializeAction();
		LoadUserShotData(shotData);
		LoadGraphic(imgBoss);
		LoadGraphic(imgback);
		Load;
        	CutIn(YOUMU,"ui̖Hl`v", NULL, 0, 0, 0, 0);
        	Main;
	}

    	@MainLoop {
        	SetCollisionA(GetX, GetY, 32);
        	SetCollisionB(GetX, GetY, 16);
		if(GetTimer==10&&counter==0){
			Timer;
			counter++;
		}
        	yield;
    	}

	@DrawLoop {
		SetColor(255,255,255);
		SetGraphicScale(1,1);
		SetAlpha(255);
		if(drawcount>1){
		DrawBoss(imgBoss);
		}
	}

	@BackGround {
		SetColor(100,100,255);
		SetAlpha(150);
		SetTexture(imgback);
		SetGraphicRect(0, 0, 384, 457);
		SetGraphicAngle(0, 0, 0);
		DrawGraphic(224, 240);
		if(drawcount==1){
			DrawHououZ(200, 200, 100, 100);
		}
		if(drawcount>0){
			DrawHouou(200, 200, 100, 100);
			DrawIrusion(GetX, GetY,100,255,100,100);
		}
	}

	sub standBy {
		SetMovePosition03(cenX,cenY-60, 10, 7);
		SetAction(ACT_MOVE, 60);
		wait(120);
	}

   	task Main {
        	yield;
		standBy;
		wait(10);
		Charge;
		PlaySE(seCharge1);
		wait(10);
		drawcount++;
		wait(30);
		drawcount++;
		wait(60);
		SetDamageRate(20, 0);
		BombBarrier;
		Sum;
		Att;
	}

	task Att{
		loop{
			if(GetEnemyLife<1800||GetTimer<70){break;}
			yield;
		}
		Charge;
		PlaySE(seCharge1);
		wait(60);
		shotA;
		loop{
			if(GetEnemyLife<600||GetTimer<30){break;}
			yield;
		}
		Charge;
		PlaySE(seCharge1);
		wait(60);
		shotB;	
	}

	task shotA{
		loop{
			let angle=0;
			while(angle<360){
				CreateShot01(GetX,GetY,1.5,angle,67,0);
				angle+=20;
			}
			PlaySE(seShot);
			wait(180);
			yield;
		}
	}

	task shotB{
		loop{
			let angle=GetAngleToPlayer;
			loop(20){
				CreateShot01(GetX,GetY,2,angle,82,0);
				wait(4);
				PlaySE(seShot4);
			}
			wait(360);
			yield;
		}
	}

	task Sum{
		CreateEnemyFromScript("FUJI1", maxX, maxY, 0, 0, 0);
		CreateEnemyFromScript("FUJI2", minX, minY, 0, 0, 0);
		PlaySE(seShot3);
		loop{
			if(GetEnemyLife<1200||GetTimer<50){break;}
			yield;
		}
		Charge;
		PlaySE(seCharge1);
		wait(60);
		CreateEnemyFromScript("FUJI3", maxX, maxY, 0, 0, 0);
		CreateEnemyFromScript("FUJI4", minX, minY, 0, 0, 0);
		PlaySE(seShot3);
	}

	@Finalize{
		DeleteGraphic(imgBoss);
		Delete;
	}

}

#include_script ".\familiar4.txt"