#東方弾幕風
#Title[通常攻撃1]
#Text[]
#BackGround[Default]
#ScriptVersion[2]

script_enemy_main{

	#include_function ".\lib\lib_anime_Sanae.txt"
	let imgBoss = GetCurrentScriptDirectory() ~ "img\dot_sanae.png";
	let shot  =GetCurrentScriptDirectory~"SE\arrow01.wav";
	let shot2  =GetCurrentScriptDirectory~"SE\kira01_r.wav";
	let shot3  =GetCurrentScriptDirectory~"SE\shoot13.wav";
	let Concentration  =GetCurrentScriptDirectory~"SE\eco00_r.wav";
	let wIni = 120;

	@Initialize{
	SetEnemyMarker(true);
	LoadGraphic(imgBoss);
	LoadUserShotData(GetCurrentScriptDirectory ~ "img\shot_All.txt");
        SetMovePosition02(GetCenterX(), 150, wIni/2);
        SetLife(600);
        SetTimer(70);
        SetInvincibility(wIni*2);
        SetDamageRate(18*1.5, 3.6*1.5);
	LoadGraphic(GetCurrentScriptDirectory~"img\back06_01.png");	
	InitializeAction();
	    
	    TMain();
	}
		
	@MainLoop{
		SetCollisionA(GetX(), GetY(), 32);
		SetCollisionB(GetX(), GetY(), 24);
	    yield;
	}
	
		
	@Finalize{
	DeleteGraphic(imgBoss);
	}
	
	
	task TMain{
	    SetAction(ACT_MOVE, wIni/2);	    
	    yield;
	    loop(wIni/2){ yield; }
          SetAction(ACT_SHOT_B,12000);
	    loop(wIni/2){ yield; }
	    
	    loop{
	    		let a=rand(0,360);
	    loop(48){
		CreateShotA(1,GetX+40,GetY-40,10);
		SetShotDataA(1,0,3,a,0,0,0,41);
		FireShot(1);
		a+=360/48;
		}
                PlaySE(shot);
	        loop(12){ yield; }
	    loop(48){
		CreateShotA(1,GetX-40,GetY-40,10);
		SetShotDataA(1,0,3,a,0,0,0,47);
		FireShot(1);
		a+=360/48;
		}
                PlaySE(shot);
	        loop(12){ yield; }
	    }
			}
	@DrawLoop{
	  DrawBoss(imgBoss);
		DrawGraphic(GetX(),GetY());
	}
        

}
