

script_enemy_main {
	let imgBoss     = "script\l\img\dot_yuyuko.png";
	let name = "̔g";
	let xf        = GetClipMaxX / 2 +16;
    let yf        = GetClipMinY + 64;
    let cx=GetCenterX();
    #include_function ".\lib\lib_anime_Yuyuko.txt"
@Initialize {
		SetX(GetCenterX);
        SetY(GetClipMinY + 120);
        SetLife(700);
        SetTimer(50);
        SetScore(5000000);
        SetDamageRate(0, 0);
        LoadGraphic(imgBoss);
        SetTexture(imgBoss);
        SetGraphicRect(0, 0, 63, 63);
        CutIn(YOUMU, name, "", 0, 0, 0, 0);
		TMain;
	}
	@MainLoop {
        SetCollisionA(GetX, GetY, 32);
        SetCollisionB(GetX, GetY, 16);
		
        yield;
    }
    @DrawLoop {
        DrawBoss( imgBoss );
    }

    @Finalize {
        DeleteGraphic(imgBoss);
        loop(8)
		{
			CreateItem(ITEM_SCORE,cx+rand(-100,100),rand(20,100));
		}
		
    }
    task TMain{
	    yield;
	    FMove;
		concentration;
	    TbaraA;
	    TbaraB;
	   
	   }

	   sub concentration {
	    let con = 0;
        let wConc = 100;
        Concentration01(wConc);
        wait(wConc);
        SetDamageRate(20, 20);
        SetAction( ACT_STAND, 1 );
    }
    
	   sub FMove {
		SetMovePosition02(xf, yf, 60);
		SetAction(ACT_SPELL, 60);
		
		wait(60)
	}
	task TbaraA {
		
		loop {	
			let Tfy = GetClipMinY + 100; 
			let ntx = 0;
			loop(20){
		let Tfx = GetClipMinX + (GetClipMaxX / 20) * ntx;
		
		let baraA = 1;
		CreateShotA(baraA, Tfx, Tfy, 0);
		SetShotDataA(baraA, 0, 4, 90, 0, 0, 5, RED22);
		
		let tza = 0;
		let tzb = 0;
		let tzc = rand(40,-40);
		
			loop(10){
		let tyoB = 3;
	 	
		CreateShotA(tyoB, 0, 0, tza);
	 	SetShotDataA(tyoB, 0, 1.5, -90 - tzc, 0, 0.1, 5, RED22);
	 	
	 	AddShot(80, baraA, tyoB, 0);
	 	tza +=3;
	 
	
	 }
	 SetShotKillTime(baraA,81);
		FireShot(baraA);
		ntx += 2;
	
	 }
	 wait(110);
  }
}

task TbaraB {
		
		loop {	
			let Tfya = GetClipMinY + 100;
			let ntxa = 1;
			loop(20){
		let Tfxa = GetClipMinX + (GetClipMaxX / 20) * ntxa;
		
		let baraB = 2;
		CreateShotA(baraB, Tfxa, Tfya, 0);
		SetShotDataA(baraB, 0, 4, 90, 0, 0, 5, BLUE22);		
		SetShotDataA(baraB, 50, -4, 90, 0, 0, -4, BLUE22);		
		SetShotDataA(baraB, 90, -2, 90, 0, 0, -2, BLUE22);
		SetShotDataA(baraB, 120, -1, 90, 0, 0, -1, BLUE22);
		SetShotDataA(baraB, 140, 0, 90, 0, 0, 0, BLUE22);
		let i = -20;
		let tza = 0;
		let tzb = 0;
		let tzc = rand(30,-30);
		let tzd = rand(30,-30);
		while (i <=20){
			loop(5){
		let tyoB = 3;
	 	let tyoC = 4;
	 	
		CreateShotA(tyoB, 0, 0, tza);
	 	SetShotDataA(tyoB, 0, 1.5, 135 + tzc, 0, 0.2, 5, BLUE22);
	 	CreateShotA(tyoC, 0, 0, tzb);
	 	SetShotDataA(tyoC, 0, 1.5, 45 + tzd, 0, 0.2, 5, BLUE22);
	 	AddShot(140, baraB, tyoB, 0);
	 	AddShot(140, baraB, tyoC, 0);
	 	tza +=3;
	 	tzb +=3;
	 }
	 i +=20
	 }
	 SetShotKillTime(baraB,141);
		FireShot(baraB);
		
		ntxa += 2;
	 
	 
	
	 }
	 
	 wait(160);
  }
}

	
	function wait(w) {
        loop(w) { yield; }
}
}