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");
CreateShotA(1,GetX,GetY,10);
SetShotDataA(1,0,7,90,0,0,0,23);SetShotDataA(1,5,6,NULL,0,0,0,23);
SetShotDataA(1,10,5,NULL,0,0,0,23);SetShotDataA(1,15,4,NULL,0,0,0,23);
SetShotDataA(1,20,3,NULL,0,0,0,23);SetShotDataA(1,25,2,NULL,0,0,0,23);
FireShot(1);
}
}	
if(Frame1==90){
if(NoShotSwitch==false){
PlaySE("script\SE\Shot3.wav");
CreateShotA(1,GetX,GetY,10);
SetShotDataA(1,0,7,70,0,0,0,23);SetShotDataA(1,5,6,NULL,0,0,0,23);
SetShotDataA(1,10,5,NULL,0,0,0,23);SetShotDataA(1,15,4,NULL,0,0,0,23);
SetShotDataA(1,20,3,NULL,0,0,0,23);SetShotDataA(1,25,2,NULL,0,0,0,23);
FireShot(1);
CreateShotA(1,GetX,GetY,10);
SetShotDataA(1,0,7,110,0,0,0,23);SetShotDataA(1,5,6,NULL,0,0,0,23);
SetShotDataA(1,10,5,NULL,0,0,0,23);SetShotDataA(1,15,4,NULL,0,0,0,23);
SetShotDataA(1,20,3,NULL,0,0,0,23);SetShotDataA(1,25,2,NULL,0,0,0,23);
FireShot(1);
}
}
if(Frame1==110){
if(NoShotSwitch==false){
PlaySE("script\SE\Shot3.wav");
CreateShotA(1,GetX,GetY,10);
SetShotDataA(1,0,7,50,0,0,0,23);SetShotDataA(1,5,6,NULL,0,0,0,23);
SetShotDataA(1,10,5,NULL,0,0,0,23);SetShotDataA(1,15,4,NULL,0,0,0,23);
SetShotDataA(1,20,3,NULL,0,0,0,23);SetShotDataA(1,25,2,NULL,0,0,0,23);
FireShot(1);
CreateShotA(1,GetX,GetY,10);
SetShotDataA(1,0,7,130,0,0,0,23);SetShotDataA(1,5,6,NULL,0,0,0,23);
SetShotDataA(1,10,5,NULL,0,0,0,23);SetShotDataA(1,15,4,NULL,0,0,0,23);
SetShotDataA(1,20,3,NULL,0,0,0,23);SetShotDataA(1,25,2,NULL,0,0,0,23);
FireShot(1);
}
}
//End.Easy
}


if(GetCommonData("Rank")=="N"){
//Normal
if(Frame1==70){
if(NoShotSwitch==false){
PlaySE("script\SE\Shot3.wav");
CreateShotA(1,GetX,GetY,10);
SetShotDataA(1,0,7,90,0,0,0,23);SetShotDataA(1,5,6,NULL,0,0,0,23);
SetShotDataA(1,10,5,NULL,0,0,0,23);SetShotDataA(1,15,4,NULL,0,0,0,23);
SetShotDataA(1,20,3,NULL,0,0,0,23);
FireShot(1);
}
}	
if(Frame1==90){
if(NoShotSwitch==false){
PlaySE("script\SE\Shot3.wav");
CreateShotA(1,GetX,GetY,10);
SetShotDataA(1,0,7,80,0,0,0,23);SetShotDataA(1,5,6,NULL,0,0,0,23);
SetShotDataA(1,10,5,NULL,0,0,0,23);SetShotDataA(1,15,4,NULL,0,0,0,23);
SetShotDataA(1,20,3,NULL,0,0,0,23);
FireShot(1);
CreateShotA(1,GetX,GetY,10);
SetShotDataA(1,0,7,100,0,0,0,23);SetShotDataA(1,5,6,NULL,0,0,0,23);
SetShotDataA(1,10,5,NULL,0,0,0,23);SetShotDataA(1,15,4,NULL,0,0,0,23);
SetShotDataA(1,20,3,NULL,0,0,0,23);
FireShot(1);
}
}
if(Frame1==110){
if(NoShotSwitch==false){
PlaySE("script\SE\Shot3.wav");
CreateShotA(1,GetX,GetY,10);
SetShotDataA(1,0,7,70,0,0,0,23);SetShotDataA(1,5,6,NULL,0,0,0,23);
SetShotDataA(1,10,5,NULL,0,0,0,23);SetShotDataA(1,15,4,NULL,0,0,0,23);
SetShotDataA(1,20,3,NULL,0,0,0,23);
FireShot(1);
CreateShotA(1,GetX,GetY,10);
SetShotDataA(1,0,7,110,0,0,0,23);SetShotDataA(1,5,6,NULL,0,0,0,23);
SetShotDataA(1,10,5,NULL,0,0,0,23);SetShotDataA(1,15,4,NULL,0,0,0,23);
SetShotDataA(1,20,3,NULL,0,0,0,23);
FireShot(1);
}
}
if(Frame1==130){
if(NoShotSwitch==false){
PlaySE("script\SE\Shot3.wav");
CreateShotA(1,GetX,GetY,10);
SetShotDataA(1,0,7,60,0,0,0,23);SetShotDataA(1,5,6,NULL,0,0,0,23);
SetShotDataA(1,10,5,NULL,0,0,0,23);SetShotDataA(1,15,4,NULL,0,0,0,23);
SetShotDataA(1,20,3,NULL,0,0,0,23);
FireShot(1);
CreateShotA(1,GetX,GetY,10);
SetShotDataA(1,0,7,120,0,0,0,23);SetShotDataA(1,5,6,NULL,0,0,0,23);
SetShotDataA(1,10,5,NULL,0,0,0,23);SetShotDataA(1,15,4,NULL,0,0,0,23);
SetShotDataA(1,20,3,NULL,0,0,0,23);
FireShot(1);
}
}
//End.Normal
}


if(GetCommonData("Rank")=="H"){
//Hard
if(Frame1==70){
if(NoShotSwitch==false){
PlaySE("script\SE\Shot3.wav");
CreateShotA(1,GetX,GetY,10);
SetShotDataA(1,0,7,90,0,0,0,23);SetShotDataA(1,5,6,NULL,0,0,0,23);
SetShotDataA(1,10,5,NULL,0,0,0,23);SetShotDataA(1,15,4,NULL,0,0,0,23);
FireShot(1);
}
}	
if(Frame1==90){
if(NoShotSwitch==false){
PlaySE("script\SE\Shot3.wav");
CreateShotA(1,GetX,GetY,10);
SetShotDataA(1,0,7,85,0,0,0,23);SetShotDataA(1,5,6,NULL,0,0,0,23);
SetShotDataA(1,10,5,NULL,0,0,0,23);SetShotDataA(1,15,4,NULL,0,0,0,23);
FireShot(1);
CreateShotA(1,GetX,GetY,10);
SetShotDataA(1,0,7,95,0,0,0,23);SetShotDataA(1,5,6,NULL,0,0,0,23);
SetShotDataA(1,10,5,NULL,0,0,0,23);SetShotDataA(1,15,4,NULL,0,0,0,23);
FireShot(1);
}
}
if(Frame1==110){
if(NoShotSwitch==false){
PlaySE("script\SE\Shot3.wav");
CreateShotA(1,GetX,GetY,10);
SetShotDataA(1,0,7,80,0,0,0,23);SetShotDataA(1,5,6,NULL,0,0,0,23);
SetShotDataA(1,10,5,NULL,0,0,0,23);SetShotDataA(1,15,4,NULL,0,0,0,23);
FireShot(1);
CreateShotA(1,GetX,GetY,10);
SetShotDataA(1,0,7,100,0,0,0,23);SetShotDataA(1,5,6,NULL,0,0,0,23);
SetShotDataA(1,10,5,NULL,0,0,0,23);SetShotDataA(1,15,4,NULL,0,0,0,23);
FireShot(1);
}
}
if(Frame1==130){
if(NoShotSwitch==false){
PlaySE("script\SE\Shot3.wav");
CreateShotA(1,GetX,GetY,10);
SetShotDataA(1,0,7,75,0,0,0,23);SetShotDataA(1,5,6,NULL,0,0,0,23);
SetShotDataA(1,10,5,NULL,0,0,0,23);SetShotDataA(1,15,4,NULL,0,0,0,23);
FireShot(1);
CreateShotA(1,GetX,GetY,10);
SetShotDataA(1,0,7,105,0,0,0,23);SetShotDataA(1,5,6,NULL,0,0,0,23);
SetShotDataA(1,10,5,NULL,0,0,0,23);SetShotDataA(1,15,4,NULL,0,0,0,23);
FireShot(1);
}
}
if(Frame1==150){
if(NoShotSwitch==false){
PlaySE("script\SE\Shot3.wav");
CreateShotA(1,GetX,GetY,10);
SetShotDataA(1,0,7,70,0,0,0,23);SetShotDataA(1,5,6,NULL,0,0,0,23);
SetShotDataA(1,10,5,NULL,0,0,0,23);SetShotDataA(1,15,4,NULL,0,0,0,23);
FireShot(1);
CreateShotA(1,GetX,GetY,10);
SetShotDataA(1,0,7,110,0,0,0,23);SetShotDataA(1,5,6,NULL,0,0,0,23);
SetShotDataA(1,10,5,NULL,0,0,0,23);SetShotDataA(1,15,4,NULL,0,0,0,23);
FireShot(1);
}
}
//End.Hard
}


if(GetCommonData("Rank")=="L"){
//Normal
if(Frame1==70){
if(NoShotSwitch==false){
PlaySE("script\SE\Shot3.wav");
CreateShotA(1,GetX,GetY,10);
SetShotDataA(1,0,7,90,0,0,0,23);SetShotDataA(1,5,6,NULL,0,0,0,23);
SetShotDataA(1,10,5,NULL,0,0,0,23);
FireShot(1);
}
}	
if(Frame1==80){
if(NoShotSwitch==false){
PlaySE("script\SE\Shot3.wav");
CreateShotA(1,GetX,GetY,10);
SetShotDataA(1,0,7,88,0,0,0,23);SetShotDataA(1,5,6,NULL,0,0,0,23);
SetShotDataA(1,10,5,NULL,0,0,0,23);
FireShot(1);
CreateShotA(1,GetX,GetY,10);
SetShotDataA(1,0,7,92,0,0,0,23);SetShotDataA(1,5,6,NULL,0,0,0,23);
SetShotDataA(1,10,5,NULL,0,0,0,23);
FireShot(1);
}
}
if(Frame1==90){
if(NoShotSwitch==false){
PlaySE("script\SE\Shot3.wav");
CreateShotA(1,GetX,GetY,10);
SetShotDataA(1,0,7,86,0,0,0,23);SetShotDataA(1,5,6,NULL,0,0,0,23);
SetShotDataA(1,10,5,NULL,0,0,0,23);
FireShot(1);
CreateShotA(1,GetX,GetY,10);
SetShotDataA(1,0,7,94,0,0,0,23);SetShotDataA(1,5,6,NULL,0,0,0,23);
SetShotDataA(1,10,5,NULL,0,0,0,23);
FireShot(1);
}
}
if(Frame1==100){
if(NoShotSwitch==false){
PlaySE("script\SE\Shot3.wav");
CreateShotA(1,GetX,GetY,10);
SetShotDataA(1,0,7,84,0,0,0,23);SetShotDataA(1,5,6,NULL,0,0,0,23);
SetShotDataA(1,10,5,NULL,0,0,0,23);
FireShot(1);
CreateShotA(1,GetX,GetY,10);
SetShotDataA(1,0,7,96,0,0,0,23);SetShotDataA(1,5,6,NULL,0,0,0,23);
SetShotDataA(1,10,5,NULL,0,0,0,23);
FireShot(1);
}
}
if(Frame1==110){
if(NoShotSwitch==false){
PlaySE("script\SE\Shot3.wav");
CreateShotA(1,GetX,GetY,10);
SetShotDataA(1,0,7,82,0,0,0,23);SetShotDataA(1,5,6,NULL,0,0,0,23);
SetShotDataA(1,10,5,NULL,0,0,0,23);
FireShot(1);
CreateShotA(1,GetX,GetY,10);
SetShotDataA(1,0,7,98,0,0,0,23);SetShotDataA(1,5,6,NULL,0,0,0,23);
SetShotDataA(1,10,5,NULL,0,0,0,23);
FireShot(1);
}
}
if(Frame1==120){
if(NoShotSwitch==false){
PlaySE("script\SE\Shot3.wav");
CreateShotA(1,GetX,GetY,10);
SetShotDataA(1,0,7,80,0,0,0,23);SetShotDataA(1,5,6,NULL,0,0,0,23);
SetShotDataA(1,10,5,NULL,0,0,0,23);
FireShot(1);
CreateShotA(1,GetX,GetY,10);
SetShotDataA(1,0,7,101,0,0,0,23);SetShotDataA(1,5,6,NULL,0,0,0,23);
SetShotDataA(1,10,5,NULL,0,0,0,23);
FireShot(1);
}
}
//End.Lunatic
}



if(DedFrame==240){
NoShotSwitch=true;
SetMovePosition02(GetX,-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(0,160,63,223);
}
if(Anime1==10){
SetGraphicRect(64,160,127,223);
}
if(Anime1==15){
SetGraphicRect(128,160,191,223);
}
if(Anime1==20){
SetGraphicRect(192,160,255,223);
}
if(Anime1==25){
SetGraphicRect(256,160,319,223);
Anime1=0;
}
}else if(GetSpeedX<0){
Anime1=0;
Anime3=0;
if(Anime2==3){
SetGraphicRect(0,288,63,351);
}
if(Anime2==6){
SetGraphicRect(64,288,127,351);
}
if(Anime2==9){
SetGraphicRect(128,288,191,351);
}
if(Anime2==12){
SetGraphicRect(192,288,255,351);
}
}else{
Anime1=0;
Anime2=0;
if(Anime3==3){
SetGraphicRect(0,224,63,287);
}
if(Anime3==6){
SetGraphicRect(64,224,127,287);
}
if(Anime3==9){
SetGraphicRect(128,224,191,287);
}
if(Anime3==12){
SetGraphicRect(192,224,255,287);
}
}
DrawGraphic(GetX,GetY);//‰æ‘œ‚ð•\Ž¦


}
}