script_enemy_main{
let Enemyimg="script\img-System\EnemySet.png";
let Anime1=0;
let Anime2=0;
let Anime3=0;
let Anime4=0;
let Angle1=0;
let Angle2=0;
let Angle3=0;
let Cx=GetCenterX;
let Cy=GetCenterY;
let Frame1=0;
let Frame2=0;
let Frame3=0;
let DedFrame=0;
let NoItemSwitch=false;
let NoShotSwitch=false;
let MoveMord1=false;
let MoveMord2=false;
let BossShot=false;
let Enemyimg="script\img-System\EnemySet.png";

@Initialize{
SetTexture(Enemyimg);
SetLife(400);
SetGraphicRect(0,0,31,31);
LoadUserShotData("script\Script-System\AllShotData.txt");
SetMovePosition03(420,300,10,2);
}

@MainLoop{
yield;
SetCollisionA(GetX,GetY,20);
SetCollisionB(GetX,GetY,10);
Anime1++;
Anime2++;
Anime3++;
Anime4++;
Frame1++;
Frame2++;
DedFrame++;
if(GetCommonData("Rank")=="E"){
//Normal
if(Frame1==30){
if(NoShotSwitch==false){
PlaySE("script\SE\Shot3.wav");
CreateShotA(1,GetX,GetY,10);SetShotDataA(1,0,3,GetAngleToPlayer,0,0,0,11);FireShot(1);
Frame1=0;
}
}	
//End.Easy
}


if(GetCommonData("Rank")=="N"){
//Normal
if(Frame1==30){
if(NoShotSwitch==false){
PlaySE("script\SE\Shot3.wav");
CreateShotA(1,GetX,GetY,10);SetShotDataA(1,0,3.5,GetAngleToPlayer,0,0,0,11);FireShot(1);
Frame1=0;
}
}	
//End.Normal
}


if(GetCommonData("Rank")=="H"){
//Hard
if(Frame1==30){
if(NoShotSwitch==false){
PlaySE("script\SE\Shot3.wav");
CreateShotA(1,GetX,GetY,10);SetShotDataA(1,0,4,GetAngleToPlayer,0,0,0,11);FireShot(1);
Frame1=0;
}	
}
//End.Hard
}


if(GetCommonData("Rank")=="L"){
//Normal
if(Frame1==30){
if(NoShotSwitch==false){
PlaySE("script\SE\Shot3.wav");
CreateShotA(1,GetX,GetY,10);SetShotDataA(1,0,5,GetAngleToPlayer,0,0,0,11);FireShot(1);
Frame1=0;
}
}	
//End.Lunatic
}



if(DedFrame==240){
NoShotSwitch=true;
SetMovePosition02(GetX,0,50);	
}
if(DedFrame==240){
NoItemSwitch=true;
VanishEnemy;
}
if(GetLife<300){
if(NoShotSwitch==false){
PlaySE("script\SE\Vanish1.wav");
SetCommonData("EnemyX",GetX);
SetCommonData("EnemyY",GetY);
SetCommonData("SamonPoint",true);
SetCommonData("SamonPower",true);
SetCommonData("EnemyVanish",true);
VanishEnemy;
}
}	
}

@Finalize{

}


@DrawLoop{
DrawGraphic(GetX,GetY);	
if(GetSpeed<0.1){
Anime2=0;
Anime3=0;
if(Anime1==5){
SetGraphicRect(192,0,223,31);
}
if(Anime1==10){
SetGraphicRect(224,0,255,31);
}
if(Anime1==15){
SetGraphicRect(256,0,287,31);
}
if(Anime1==20){
SetGraphicRect(288,0,319,31);
}
if(Anime1==25){
SetGraphicRect(256,0,287,31);
}
if(Anime1==30){
SetGraphicRect(224,0,255,31);
Anime1=0;
}
}else if(GetSpeedX<0){
Anime1=0;
Anime3=0;
if(Anime2==3){
SetGraphicRect(160,64,191,95);
}
if(Anime2==6){
SetGraphicRect(192,64,223,95);
}
if(Anime2==9){
SetGraphicRect(224,64,255,95);
}
if(Anime2==12){
SetGraphicRect(256,64,287,95);
}
if(Anime2==15){
SetGraphicRect(288,64,319,95);
}
}else{
Anime1=0;
Anime2=0;
if(Anime3==3){
SetGraphicRect(160,32,191,63);
}
if(Anime3==6){
SetGraphicRect(192,32,223,63);
}
if(Anime3==9){
SetGraphicRect(224,32,255,63);
}
if(Anime3==12){
SetGraphicRect(256,32,287,63);
}
if(Anime3==15){
SetGraphicRect(288,32,319,63);
}
}
DrawGraphic(GetX,GetY);//‰æ‘œ‚ð•\Ž¦


}
}