#Title[大妖精インターバル]
#Text[大妖精インターバル]
#Player[FREE]
#ScriptVersion[2]

script_enemy_main
{
        let count=0;
        let cx=GetCenterX();
        let cy=GetCenterY();
	let AnimationA=0;
	let AnimationB=0;
	let AnimationC=0;
	let angle=0;
	let bigX=1;
	let bigY=1;
        let csd     = GetCurrentScriptDirectory;
        let imgBoss =csd~"img\dot_daiyousei.png";

	@Initialize
	{
	SetLife(1);
	SetTimer(999);
        SetDamageRate(0,0);
        SetInvincibility(200);
	LoadGraphic(imgBoss);
	SetEnemyMarker(true);
        TAnime;
	}
	
	@MainLoop
	{
	if(count>=125&&count<=149){
		bigX+=0.04;
		bigY-=0.04;
        	}
	if(count==150){
		SetX(cx);
		SetY(120);
        	}
	if(count>=150&&count<=174){
		bigX-=0.04;
		bigY+=0.04;
        	}
	if(count==200){
		AddLife(-1000);
        	}
        SetCollisionB(GetX(),GetY(),18);
	SetCollisionA(GetX(),GetY(),18);
        count++;
        yield;
	}
	
        @DrawLoop {
		SetRenderState(ALPHA);
		SetTexture(imgBoss);
		SetGraphicScale(bigX,bigY);
		SetAlpha(255);
		SetGraphicRect(128*AnimationC,128*AnimationB,127+128*AnimationC,127+128*AnimationB);
		DrawGraphic(GetX(),GetY());
	}
        
        @Finalize
        {
        }

	task TAnime{
		loop{
			AnimationB=0;
			AnimationC=0;
        		loop(10){yield;}
			AnimationB=1;
        		loop(10){yield;}
			AnimationB=2;
        		loop(10){yield;}
			AnimationB=3;
        		loop(10){yield;}
			}
		}

    	task TAnime2{
			AnimationA=0;
        		loop(10){yield;}
			AnimationA=1;
        		loop(50){yield;}
			AnimationA=0;
        		loop(10){yield;}
		}
}