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(800);
SetGraphicRect(0,0,31,31);
LoadUserShotData("script\Script-System\AllShotData.txt");
SetMovePosition03(GetX,GetY+100,10,3);
}

@MainLoop{
yield;
SetCollisionA(GetX,GetY,20);
SetCollisionB(GetX,GetY,10);
Anime1++;
Anime2++;
Anime3++;
Anime4++;
Frame1++;
Frame2++;
DedFrame++;
if(GetCommonData("Rank")=="E"){
//Normal
if(Frame1==70){
if(NoShotSwitch==false){
PlaySE("script\SE\Shot3.wav");
loop(18){
CreateShotA(1,GetX,GetY,10);
SetShotDataA(1,0,6,Angle1,0,0,0,5);
SetShotDataA(1,10,5,NULL,0,0,0,5);
SetShotDataA(1,20,4,NULL,0,0,0,5);
SetShotDataA(1,30,3,NULL,0,0,0,5);
FireShot(1);
Angle1+=20;
}
}
}	

//End.Easy
}


if(GetCommonData("Rank")=="N"){
//Normal
if(Frame1==70){
if(NoShotSwitch==false){
PlaySE("script\SE\Shot3.wav");
loop(18){
CreateShotA(1,GetX,GetY,10);
SetShotDataA(1,0,7,Angle1,0,0,0,5);
SetShotDataA(1,10,6,NULL,0,0,0,5);
SetShotDataA(1,20,5,NULL,0,0,0,5);
SetShotDataA(1,30,4,NULL,0,0,0,5);
FireShot(1);
Angle1+=20;
}
}
}	
//End.Normal
}


if(GetCommonData("Rank")=="H"){
//Hard
if(Frame1==70){
if(NoShotSwitch==false){
PlaySE("script\SE\Shot3.wav");
loop(38){
CreateShotA(1,GetX,GetY,10);
SetShotDataA(1,0,7,Angle1,0,0,0,5);
SetShotDataA(1,10,6,NULL,0,0,0,5);
SetShotDataA(1,20,5,NULL,0,0,0,5);
SetShotDataA(1,30,4,NULL,0,0,0,5);
FireShot(1);
Angle1+=10;
}
}
}
//End.Hard
}


if(GetCommonData("Rank")=="L"){
//Normal
if(Frame1==70){
if(NoShotSwitch==false){
PlaySE("script\SE\Shot3.wav");
loop(38){
CreateShotA(1,GetX,GetY,10);
SetShotDataA(1,0,8,Angle1,0,0,0,5);
SetShotDataA(1,10,7,NULL,0,0,0,5);
SetShotDataA(1,20,6,NULL,0,0,0,5);
SetShotDataA(1,30,5,NULL,0,0,0,5);
FireShot(1);
Angle1+=10;
}
}
}
//End.Lunatic
}



if(DedFrame==240){
NoShotSwitch=true;
SetMovePosition02(rand(GetX-50,GetX+50),-100,50);	
}
if(DedFrame==290){
NoItemSwitch=true;
VanishEnemy;
}
if(GetLife<700){
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(32,0,63,31);
}
if(Anime1==10){
SetGraphicRect(64,0,95,31);
}
if(Anime1==15){
SetGraphicRect(96,0,127,31);
}
if(Anime1==20){
SetGraphicRect(128,0,159,31);
}
if(Anime1==25){
SetGraphicRect(96,0,127,31);
}
if(Anime1==30){
SetGraphicRect(64,0,95,31);
Anime1=0;
}
}else if(GetSpeedX<0){
Anime1=0;
Anime3=0;
if(Anime2==3){
SetGraphicRect(0,64,31,95);
}
if(Anime2==6){
SetGraphicRect(32,64,63,95);
}
if(Anime2==9){
SetGraphicRect(64,64,95,95);
}
if(Anime2==12){
SetGraphicRect(96,64,127,95);
}
if(Anime2==15){
SetGraphicRect(128,64,159,95);
}
}else{
Anime1=0;
Anime2=0;
if(Anime3==3){
SetGraphicRect(0,32,31,63);
}
if(Anime3==6){
SetGraphicRect(32,32,63,63);
}
if(Anime3==9){
SetGraphicRect(64,32,95,63);
}
if(Anime3==12){
SetGraphicRect(96,32,127,63);
}
if(Anime3==15){
SetGraphicRect(128,32,159,63);
}
}
DrawGraphic(GetX,GetY);//‰æ‘œ‚ð•\Ž¦


}
}