
script_enemy_main
{    
   let imgEnemy="script\DanMUku\Stage5\Image\fully.png";
   let count=0;
    let z = 0;
    let w = 0.5;
   let premiere=false;

   @Initialize
   {
            LoadGraphic(imgEnemy);
            SetLife(1);
            SetEnemyMarker(true);
            SetInvincibility(150);
	SetMovePosition02(GetCenterX, GetCenterY - 100, 60);
            CreateEnemyFromScript("machin", GetCenterX+100, GetCenterY-120, 0, 0, 0);
            CreateEventFromScript("name");
   }
   
   @MainLoop
   {
	if (!OnEvent) {
		AddLife(-1);
	}

	if (premiere==false&&GetEventStep==1) {
		CreateEnemyFromScript("j64", GetCenterX-150, GetClipMinY, 3, 80, 0);
		premiere=true;
	}

      count++;
   }
   
   @Finalize
   {
      DeleteGraphic(imgEnemy);
   }
   
   @DrawLoop
   {
            SetColor(255,255,255);
            SetRenderState(ALPHA);
            SetAlpha(255);
            SetTexture(imgEnemy);
            SetGraphicRect(0, 0, 35, 46);
            DrawGraphic(GetX,GetY+z);
     if(z==10){w=-0.5;}
     if(z==-10){w=0.5;}
	z+=w;

   }
}

script_event name{

  let kor = "script\DanMUku\Joueur\KorA\Kordialogue.png";
  let j64 = "script\DanMUku\Stage4\Image\j64cutin.png";
  let fully = "script\DanMUku\Stage5\Image\fullycutin.png";
  let machin = "script\DanMUku\Stage1\Image\machincutin.png";

@Initialize{
  LoadGraphic(kor);
  LoadGraphic(j64);
  LoadGraphic(fully);
  LoadGraphic(machin);
 }


@MainLoop{   
 SetChar(LEFT, kor);                   
SetGraphicRect(LEFT, 0, 0, 121, 214);        
SetChar(RIGHT, fully);
SetGraphicRect(RIGHT, 0, 0, 121, 214);
MoveChar(LEFT, BACK);
MoveChar(RIGHT, FRONT);
TextOutA("\c[RED] L-Lost!?\n Am I really this... puny?");
SetChar(RIGHT, machin);
SetGraphicRect(RIGHT, 0, 0, 121, 214);
TextOutA("\c[GREEN] General Full_Korbe...");
MoveChar(RIGHT, BACK);
MoveChar(LEFT, FRONT);
TextOutA("\c[BLUE] Now give me back the control \nof the forum and the website.");
SetChar(RIGHT, fully);
SetGraphicRect(RIGHT, 0, 0, 121, 214);
MoveChar(LEFT, BACK);
MoveChar(RIGHT, FRONT);
TextOutA("\c[RED] Khh...");


SetStep(1);

 SetChar(LEFT, j64);                   
SetGraphicRect(LEFT, 0, 0, 121, 214); 
MoveChar(RIGHT, BACK);
MoveChar(LEFT, FRONT);
TextOutA("\c[GREEN] GENERAL !!!");
MoveChar(LEFT, BACK);
MoveChar(RIGHT, FRONT);
TextOutA("\c[RED] What?");
MoveChar(RIGHT, BACK);
MoveChar(LEFT, FRONT);
TextOutA("\c[GREEN] The machine! \nIt's overheating!");
PlayMusic("script\DanMUku\Stage6\Stage6.mp3");
TextOutA("\c[GREEN] Explosion incoming!");

 SetChar(LEFT, kor);                   
SetGraphicRect(LEFT, 0, 0, 121, 214); 
MoveChar(RIGHT, FRONT);
TextOutA("\c[RED]                       Huh?\n\c[BLUE] What!?");
MoveChar(LEFT, BACK);
MoveChar(RIGHT, FRONT);
TextOutA("\c[RED] J64... Machin...\n You must flee.");

 SetChar(LEFT, machin);                   
SetGraphicRect(LEFT, 0, 0, 121, 214); 
MoveChar(RIGHT, BACK);
MoveChar(LEFT, FRONT);
TextOutA("\c[GREEN] What about you, my general?");
MoveChar(LEFT, BACK);
MoveChar(RIGHT, FRONT);
TextOutA("\c[RED] I... can't follow you.\n This battle worn me out.");
MoveChar(RIGHT, BACK);
MoveChar(LEFT, FRONT);
TextOutA("\c[GREEN] My general!");
MoveChar(LEFT, BACK);
MoveChar(RIGHT, FRONT);
TextOutA("\c[RED] I am not... your general anymore.");
MoveChar(RIGHT, BACK);
MoveChar(LEFT, FRONT);
TextOutA("\c[GREEN] J64... Let's go.");
 SetChar(LEFT, j64);                   
SetGraphicRect(LEFT, 0, 0, 121, 214); 
MoveChar(RIGHT, BACK);
MoveChar(LEFT, FRONT);
TextOutA("\c[GREEN] Fully !");
MoveChar(LEFT, BACK);
MoveChar(RIGHT, FRONT);
TextOutA("\c[RED] I will find a way.\nSo leave now!");
SetStep(2);
 SetChar(LEFT, kor);                   
SetGraphicRect(LEFT, 0, 0, 121, 214); 
MoveChar(RIGHT, BACK);
MoveChar(LEFT, FRONT);
TextOutA("\c[BLUE] I better leave too.");
MoveChar(LEFT, BACK);
MoveChar(RIGHT, FRONT);
TextOutA("\c[RED] Goodbye, KorHosik.");
End;


}

 @Finalize{
  DeleteGraphic("player\korHosik\Kordialogue.png");
  DeleteGraphic(fully);
 }
}

script_enemy j64{


    let imgEnemy ="script\DanMUku\Stage4\Image\j64.png";
    let count=0;
    let z = 0;
    let w = 0.5;
    let fini=false;

@Initialize{
    SetLife(1);
    LoadGraphic(imgEnemy);

 }
@MainLoop{

	if (count==60){
		SetSpeed(0);
	}

	if (fini==false&&GetEventStep==2) {
		SetAngle(200);
		SetSpeed(3);
		fini=true;
	}

	count++;
 }
@DrawLoop{
            SetColor(255,255,255);
            SetRenderState(ALPHA);
            SetAlpha(255);
            SetTexture(imgEnemy);
            SetGraphicRect(0, 0, 35, 43);
            DrawGraphic(GetX,GetY+z);
     if(z==10){w=-0.5;}
     if(z==-10){w=0.5;}
z+=w;

 }
@Finalize{
     DeleteGraphic(imgEnemy);
 }

}

script_enemy machin{


    let imgEnemy ="script\DanMUku\Stage1\Image\machin.png";
    let count=0;
    let z = 0;
    let w = 0.5;
    let fini=false;

@Initialize{
    SetLife(1);
    LoadGraphic(imgEnemy);

 }
@MainLoop{


	if (fini==false&&GetEventStep==2) {
		SetAngle(210);
		SetSpeed(2);
		fini=true;
	}

	count++;
 }
@DrawLoop{
            SetColor(255,255,255);
            SetRenderState(ALPHA);
            SetAlpha(255);
            SetTexture(imgEnemy);
            SetGraphicRect(0, 0, 24, 24);
            DrawGraphic(GetX,GetY+z);
     if(z==10){w=-0.5;}
     if(z==-10){w=0.5;}
z+=w;

 }
@Finalize{
     DeleteGraphic(imgEnemy);
 }

}
