
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(990);
		SetTimer(50);
		SetScore(1500000);
		SetDamageRate(0, 0);
		InitializeAction();
		LoadUserShotData(shotData);
		LoadGraphic(imgBoss);
		LoadGraphic(imgback);
		Load;
        	CutIn(YOUMU,"不死「徐福時空 -変- 」", 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);
		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-40, 10, 7);
		SetAction(ACT_MOVE, 60);
		wait(120);
	}

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

	task Att{
		loop{
			shotA;
			wait(60);
			shotB;
			wait(300);
			shotC;
			wait(60);
			shotD;
			wait(300);
			yield;
		}
	}

	task shotA{
		let angle=0;
		while(angle<360){
		CreateEnemyFromScript("BAN1",GetX,GetY,3,angle,0);
		PlaySE(seShot5);
		angle+=90;
		}
	}

	task shotB{
		let angle=0;
		while(angle<360){
		CreateEnemyFromScript("BAN2",GetX,GetY,3,angle,0);
		PlaySE(seShot5);
		angle+=90;
		}
	}

	task shotC{
		let angle=0;
		while(angle<360){
		CreateEnemyFromScript("BAN3",GetX,GetY,3,angle+45,0);
		PlaySE(seShot5);
		angle+=90;
		}
	}

	task shotD{
		let angle=0;
		while(angle<360){
		CreateEnemyFromScript("BAN4",GetX,GetY,3,angle+45,0);
		PlaySE(seShot5);
		angle+=90;
		}
	}

	task shotE{
		loop{
			let angle=GetAngleToPlayer;
			CreateShot01(GetX,GetY,0.7,angle+rand(-2,2),41,0);
			PlaySE(seShot4);
			wait(30);
			yield;
		}
	}

	@Finalize{
		DeleteGraphic(imgBoss);
		Delete;
		Spell;
	}

}

#include_script ".\familiar1.txt"