
script_enemy_main
{    
   let imgEnemy="script\DanMUku\Stage5\Image\fyn.png";
   let fully = "script\DanMUku\Stage5\Image\fully.png";
   let count=0;
   let happy=false;
   let x=GetX;
   let fullY = GetCenterY - 100;
   @Initialize
   {
            LoadGraphic(imgEnemy);
            SetLife(1);
            SetEnemyMarker(true);
            SetInvincibility(150);
            SetMovePosition02(GetCenterX, GetCenterY - 100, 60);
            CreateEventFromScript("name");
   }
   
   @MainLoop
   {
	if (!OnEvent) {
		AddLife(-1);
	}

	if (count==30){
		CreateEnemyFromScript("fully", 100, 0, 1, 90, 0);
	}

	if (happy==false&&GetEventStep==1) {
		happy=true;
	}


      count++;
   }
   
   @Finalize
   {
      DeleteGraphic(imgEnemy);
   }
   
   @DrawLoop
   {
	if(x>GetX){
		SetGraphicAngle(180,0,0);
	}
	if(x<GetX){
		SetGraphicAngle(0,0,0);
	}
      x=GetX;
      SetColor(255,255,255);
            SetRenderState(ALPHA);
            SetTexture(imgEnemy);
		if (happy==false) {
			SetGraphicRect(2,0,30,69);
		}
		else{
            		SetGraphicRect(41,0,65,69);
		}            
	DrawGraphic(GetX,GetY);

   }
}

script_event name{

  let fyn = "script\DanMUku\Stage5\Image\fyncutin.png";
  let fully = "script\DanMUku\Stage5\Image\fullycutin.png";

@Initialize{
  LoadGraphic("script\DanMUku\Joueur\KorA\Kordialogue.png");
  LoadGraphic(fyn);
  LoadGraphic(fully);
 }

@MainLoop{   
 SetChar(LEFT, fully);                   
SetGraphicRect(LEFT, 0, 0, 121, 214);        
SetChar(RIGHT, fyn);
SetGraphicRect(RIGHT, 0, 0, 121, 214);
MoveChar(LEFT, FRONT);
TextOutA("\c[GREEN] Kor is coming. \nYou take care of him.");
MoveChar(LEFT, BACK);
MoveChar(RIGHT, FRONT);
TextOutA("\c[RED] What? Why me?");
MoveChar(RIGHT, BACK);
MoveChar(LEFT, FRONT);
TextOutA("\c[GREEN] I still have things to prepare.");
MoveChar(LEFT, BACK);
MoveChar(RIGHT, FRONT);
TextOutA("\c[RED] OK, but still... Seud is around.");
 SetChar(LEFT, "script\DanMUku\Joueur\KorA\Kordialogue.png");                   
SetGraphicRect(LEFT, 0, 0, 121, 214); 
MoveChar(RIGHT, BACK);
MoveChar(LEFT, FRONT);
TextOutA("\c[BLUE] I already beat him.");
 SetChar(RIGHT, fully);                   
SetGraphicRect(RIGHT, 0, 0, 121, 214); 
MoveChar(LEFT, BACK);
MoveChar(RIGHT, FRONT);
TextOutA("\c[GREEN] What?! Al-Already there?");

MoveChar(RIGHT, BACK);
MoveChar(LEFT, FRONT);
TextOutA("\c[BLUE] It's hard to believe you would do that to me, \nFull_Korbe!.");
MoveChar(LEFT, BACK);
MoveChar(RIGHT, FRONT);
TextOutA("\c[GREEN] Don't believe it, then.");
SetChar(LEFT, fyn);
SetGraphicRect(LEFT, 0, 0, 121, 214);
TextOutA("\c[GREEN] Alright, if you fight him...\nI'll give you a complete collection of our Nintendo cards.");
MoveChar(RIGHT, BACK);
MoveChar(LEFT, FRONT);
TextOutA("\c[RED] ...");
MoveChar(LEFT, BACK);
MoveChar(RIGHT, FRONT);
TextOutA("\c[GREEN] Four of each cards.");
MoveChar(RIGHT, BACK);
MoveChar(LEFT, FRONT);
SetStep(1);
TextOutA("\c[RED] OK, deal!");

 SetChar(LEFT, "script\DanMUku\Joueur\KorA\Kordialogue.png");                   
SetGraphicRect(LEFT, 0, 0, 121, 214);  
SetChar(RIGHT, fyn);
SetGraphicRect(RIGHT, 0, 0, 121, 214);
MoveChar(LEFT, FRONT);
TextOutA("\c[BLUE] So... Who are you again?");
MoveChar(LEFT, BACK);
MoveChar(RIGHT, FRONT);
SetNameFromText (RIGHT, TEXT_PURPLE, "Madi", "What, really?");
TextOutA("\c[RED] Come on, I am Madi!");
MoveChar(RIGHT, BACK);
MoveChar(LEFT, FRONT);
TextOutA("\c[BLUE] What!? But you don't look \nanything like h-");
MoveChar(LEFT, BACK);
MoveChar(RIGHT, FRONT);
DeleteName(RIGHT);
TextOutA("\c[RED] Eh !");

MoveChar(RIGHT, BACK);
MoveChar(LEFT, FRONT);
TextOutA("\c[BLUE] What?");
MoveChar(LEFT, BACK);
MoveChar(RIGHT, FRONT);
TextOutA("\c[RED] Do you know where those monsters \nfrom the Mario games come from?");
MoveChar(RIGHT, BACK);
MoveChar(LEFT, FRONT);
TextOutA("\c[BLUE] Now that you mention it... No.");
MoveChar(LEFT, BACK);
MoveChar(RIGHT, FRONT);
TextOutA("\c[RED] We created them from the Nintendo \ncards you invented. Clever, right?");
MoveChar(RIGHT, BACK);
MoveChar(LEFT, FRONT);
TextOutA("\c[BLUE] How dare you!?");
MoveChar(LEFT, BACK);
MoveChar(RIGHT, FRONT);
TextOutA("\c[RED] So now. let's see how the cards \nfare in the raw.");
MoveChar(RIGHT, BACK);
MoveChar(LEFT, FRONT);
TextOutA("\c[BLUE] I'm going to demolish you Mad- You!");
End;


}

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

script_enemy fully{


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

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

 }
@MainLoop{

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

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

	count++;
 }
@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;

 }
@Finalize{
     DeleteGraphic(imgEnemy);
 }

}

