
script_enemy_main
{    
   let imgEnemy="script\DanMUku\Stage1\Image\Machin.png";
   let count=0;
    let z = 0;
    let w = 0.5;
   let pasUn = true;
   let pasDeux = true;
   let pasTrois = true;


   @Initialize
   {
            LoadGraphic(imgEnemy);
            SetLife(1);
            SetEnemyMarker(true);
            SetInvincibility(150);
            CreateEnemyFromScript("j64", 200, 0, 0, 0, 0);
            CreateEventFromScript("name");
		SetMovePosition02(GetCenterX-120, GetCenterY - 100, 60);
		//CreateDebugWindow;
   }
   
   @MainLoop
   {

	if (OnEvent){
		//OutputDebugString(3, "EventStep", GetEventStep);

		if (GetEventStep==1&&pasUn) {
			CreateEnemyFromFile("script\DanMUku\Stage6\DialogueFdR.txt", GetClipMaxX, 100, 0, 0, 0);
			pasUn=false;
		}
		if (GetEventStep==2&&pasDeux) {
			CreateEnemyFromFile("script\DanMUku\Stage6\DialogueLuidi.txt", GetClipMaxX, 50, 0, 0, 0);
			CreateEnemyFromFile("script\DanMUku\Stage6\DialogueWar.txt", GetClipMaxX, 140, 0, 0, 0);
			pasDeux=false;
		}
		if (GetEventStep==3&&pasTrois) {
			SetMovePosition02(0, GetCenterY - 80, 60);
			pasTrois=false;
		}	
	}
	else {
		VanishEnemy;
	}

	

      count++;
	yield;
   }
   
   @Finalize
   {
      DeleteGraphic(imgEnemy);
   }
   
   @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;

   }
}

script_event name{

  let j64 = "script\DanMUku\Stage4\Image\j64cutin.png";
  let machin = "script\DanMUku\Stage1\Image\Machincutin.png";
  let kor = "script\DanMUku\Joueur\KorA\Kordialogue.png";
   let fdr = "script\DanMUku\Stage4\Image\FdRcutin.png";
   let luidi = "script\DanMUku\Stage3\Image\luidicutin.png";
   let war = "script\DanMUku\Stage2\Image\Warcutin.png";

@Initialize{
  LoadGraphic(kor);
  LoadGraphic(j64);
  LoadGraphic(machin);
  LoadGraphic(fdr);
  LoadGraphic(luidi);
  LoadGraphic(war);
 }


@MainLoop{   
SetStep(0);
 SetChar(LEFT, kor);                   
SetGraphicRect(LEFT, 0, 0, 121, 214);        
SetChar(RIGHT, machin);
SetGraphicRect(RIGHT, 0, 0, 121, 214);
MoveChar(LEFT, BACK);
MoveChar(RIGHT, FRONT);
TextOutA("\c[RED] Not yet! \nWe can still fight!");
SetChar(RIGHT, j64);
SetGraphicRect(RIGHT, 0, 0, 121, 214);
TextOutA("\c[RED] We won't give up!");
MoveChar(RIGHT, BACK);
MoveChar(LEFT, FRONT);
TextOutA("\c[BLUE] They will really make us \nexplode with the tower...");
SetStep(1);

 SetChar(LEFT, fdr);                   
SetGraphicRect(LEFT, 0, 0, 121, 214);  
TextOutA("\c[GREEN] Deus Ex Machinaaaaa!");
 SetChar(RIGHT, machin);                   
SetGraphicRect(RIGHT, 0, 0, 121, 214); 
MoveChar(LEFT, BACK);
MoveChar(RIGHT, FRONT);
TextOutA("\c[RED] FdRstar!\n Will you help us?");
MoveChar(RIGHT, BACK);
MoveChar(LEFT, FRONT);
TextOutA("\c[GREEN] Hum, no. I betrayed you \nlike 15 minutes ago.");
MoveChar(LEFT, BACK);
MoveChar(RIGHT, FRONT);
TextOutA("\c[RED] I thought I'd get mad, \nbut I'm not even surprised..");
MoveChar(RIGHT, BACK);
MoveChar(LEFT, FRONT);
TextOutA("\c[GREEN] Anyway, I can't let you continue.");
TextOutA("\c[GREEN] I have other things to do \nthan programming more attacks for \nyou two. These two will do.");
TextOutA("\c[GREEN](I did need a mid-boss after all...)");
MoveChar(LEFT, BACK);
MoveChar(RIGHT, FRONT);
TextOutA("\c[RED] Excuse me?\n You think you can stop us alone?");
MoveChar(RIGHT, BACK);
MoveChar(LEFT, FRONT);
TextOutA("\c[GREEN] No.");
TextOutA("\c[GREEN] Come here guys!");
SetStep(2);

Wait(80);
 SetChar(LEFT, luidi);                   
SetGraphicRect(LEFT, 0, 0, 121, 214);  
TextOutA("\c[GREEN] Hello world!");
 SetChar(LEFT, war);                   
SetGraphicRect(LEFT, 0, 0, 121, 214);  
TextOutA("\c[GREEN] I'm here to help you Kor!");
 SetChar(LEFT, kor);                   
SetGraphicRect(LEFT, 0, 0, 121, 214);  
TextOutA("\c[BLUE] Thanks guys. \nThat moves me.");
MoveChar(LEFT, BACK);
MoveChar(RIGHT, FRONT);
TextOutA("\c[RED] Ksss... Where are OUR allies \nwhen we need them?");
SetChar(RIGHT, fdr);
SetGraphicRect(RIGHT, 0, 0, 121, 214);
TextOutA("\c[GREEN] Very well, Kor! \nTo the top of the tower you go!");
MoveChar(RIGHT, BACK);
MoveChar(LEFT, FRONT);
TextOutA("\c[BLUE] Huh? Why?");
MoveChar(LEFT, BACK);
MoveChar(RIGHT, FRONT);
TextOutA("\c[GREEN] The final boss is waiting for you, \nof course!");
MoveChar(RIGHT, BACK);
MoveChar(LEFT, FRONT);
TextOutA("\c[BLUE] Full_Korbe wasn't the responsible?");
MoveChar(LEFT, BACK);
MoveChar(RIGHT, FRONT);
TextOutA("\c[GREEN] There's always a man behind the man!");
MoveChar(RIGHT, BACK);
MoveChar(LEFT, FRONT);
TextOutA("\c[BLUE] I got what I need to take back \nthe control, so...");
MoveChar(LEFT, BACK);
MoveChar(RIGHT, FRONT);
TextOutA("\c[GREEN] They have prisoners up there.");
MoveChar(RIGHT, BACK);
MoveChar(LEFT, FRONT);
TextOutA("\c[BLUE] I guess I have to help them..");
MoveChar(LEFT, BACK);
MoveChar(RIGHT, FRONT);
TextOutA("\c[GREEN] See you back for the ending!");
SetStep(3);
Wait(70);
SetChar(RIGHT, war);
SetGraphicRect(RIGHT, 0, 0, 121, 214);
TextOutA("\c[GREEN] Here Kor, take that!\n Good luck!");
SetStep(4);
Wait(80);
End;


}

 @Finalize{
  DeleteGraphic(kor);
  DeleteGraphic(machin);
  DeleteGraphic(j64);
  DeleteGraphic(fdr);
  DeleteGraphic(luidi);
  DeleteGraphic(war);
 }
}

script_enemy j64{


    let imgEnemy ="script\DanMUku\Stage4\Image\j64.png";
   let pasTrois = true;

@Initialize{
    SetLife(1);
    LoadGraphic(imgEnemy);
	SetMovePosition02(GetCenterX-100, GetCenterY - 140, 60);

 }
@MainLoop{

	if (OnEvent){
		if (GetEventStep==3&&pasTrois) {
			SetMovePosition02(0, GetCenterY - 100, 60);
			pasTrois=false;
		}	
	}

	yield;

 }
@DrawLoop{
            SetColor(255,255,255);
            SetRenderState(ALPHA);
            SetAlpha(255);
            SetTexture(imgEnemy);
            SetGraphicRect(0, 0, 35, 43);
            DrawGraphic(GetX,GetY);

 }
@Finalize{
     DeleteGraphic(imgEnemy);
 }

}






