script_enemy_main{
	#include_function"script\Yui\CharacterRect.txt"
let boss = "script\Yui\Img\yui.png";

	@Initialize{
		SetLife( 1 );
		DeleteEnemyShotToItem( ALL );
		CollectItems;
		SetDamageRate( 0, 0 );
		CreateEventFromScript( "talk" );
		//SetMovePosition02(GetCenterX, 120, 30);

		LoadGraphic(imgBoss);
	}
	@MainLoop{
		if(!OnEvent()){AddLife(-GetLife);}
		yield;
	        SetMovePosition03(GetCenterX, GetClipMinX+120, 10, 5);

	}
	@DrawLoop{
	if(GetSpeedX()<0){SetGraphicRect(GraphicRectLeft[0],GraphicRectLeft[1],GraphicRectLeft[2],GraphicRectLeft[3]);}
	else if(GetSpeedX()>0){SetGraphicRect(GraphicRectRight[0],GraphicRectRight[1],GraphicRectRight[2],GraphicRectRight[3]);}
	else {SetGraphicRect(GraphicRectCenter[0],GraphicRectCenter[1],GraphicRectCenter[2],GraphicRectCenter[3]);}
	SetAlpha(255);
	SetGraphicExpansion(GraphicScale,GraphicScale);
	SetColor(255,255,255);
	SetGraphicAngle(0,0,0);
	SetTexture(imgBoss);	
	DrawGraphic(GetX(),GetY());
}

	@Finalize{
	}
}





script_event talk{
let Yui = GetCurrentScriptDirectory~"Img\talk\talk.png";
let angry = GetCurrentScriptDirectory~"Img\talk\angry.png";
let normal = GetCurrentScriptDirectory~"Img\talk\Marisa.png";
let oh = GetCurrentScriptDirectory~"Img\talk\Marisa9.png";
let eh = GetCurrentScriptDirectory~"Img\talk\Marisa8.png";
let happy = GetCurrentScriptDirectory~"Img\talk\Marisa3.png";
let uu = GetCurrentScriptDirectory~"Img\talk\Marisa6.png";
let seria = GetCurrentScriptDirectory~"Img\talk\Marisa4.png";
let cat = GetCurrentScriptDirectory~"SE\cat.wav";
	
@Initialize{
LoadGraphic(Yui);
LoadGraphic(angry);
LoadGraphic(normal);
LoadGraphic(happy);
LoadGraphic(eh);
LoadGraphic(oh);
LoadGraphic(seria);
LoadGraphic(uu);
LoadSE(cat);
}

@MainLoop{
PlayMusic(GetCurrentScriptDirectory ~ "dance.mp3");
SetChar(LEFT, normal);
SetGraphicRect(LEFT, 0, 0, 192, 320);
MoveChar(LEFT, FRONT);
TextOutB(180, "Marisa caminaba en el bosque, \ncuando de repente...");
PlaySE(cat);
Wait(90);
SetChar(LEFT, oh);
SetGraphicRect(LEFT, 0, 0, 192, 320);
TextOutA("\c[YELLOW]Que fue eso!?");
TextOutA("\c[YELLOW]Chen?");
TextOutA("\c[YELLOW]Orin? Estas aqui arriba?");
MoveChar(LEFT, BACK);
SetChar(LEFT, seria);
SetGraphicRect(LEFT, 0, 0, 192, 320);

SetNameFromText(RIGHT,TEXT_BLUE,"Yui-chan","The Playful Cat Girl");
SetChar(RIGHT, Yui);
SetGraphicRect(RIGHT, 0, 0, 192, 320);
MoveChar(RIGHT, FRONT);
TextOutA("\c[WHITE]Chen? Orin?");
TextOutA("\c[WHITE]Yo no veo a ningun chen u orin por aqui");
MoveChar(RIGHT, BACK);
DeleteName(RIGHT);

SetChar(LEFT, normal);
SetGraphicRect(LEFT, 0, 0, 192, 320);
MoveChar(LEFT, FRONT);
TextOutA("\c[YELLOW]Bueno, pero igual sigues siendo un gato");

MoveChar(LEFT, BACK);
SetChar(LEFT, happy);
SetGraphicRect(LEFT, 0, 0, 192, 320);
SetChar(RIGHT, angry);
SetGraphicRect(RIGHT, 0, 0, 192, 320);
MoveChar(RIGHT, FRONT);
TextOutA("\c[WHITE]Oye! No soy un simple gato");
MoveChar(RIGHT, BACK);

SetChar(LEFT, normal);
SetGraphicRect(LEFT, 0, 0, 192, 320);
MoveChar(LEFT, FRONT);
TextOutA("\c[YELLOW]Ah! Si?");
TextOutA("\c[YELLOW]Entonces demuestralo");
TextOutA("\c[YELLOW]con una batalla");
MoveChar(LEFT, BACK);

SetChar(RIGHT, Yui);
SetGraphicRect(RIGHT, 0, 0, 192, 320);
MoveChar(RIGHT, FRONT);
TextOutA("\c[WHITE]Adelante!");
SetChar(LEFT, eh);
SetGraphicRect(LEFT, 0, 0, 192, 320);
MoveChar(RIGHT, BACK);
MoveChar(LEFT, FRONT);
TextOutA("\c[YELLOW]Eh!");
TextOutA("\c[YELLOW]Eres de las pocas personas que aceptan una batalla ante un desconocido");
TextOutA("\c[YELLOW]eso es algo raro");
SetChar(LEFT, happy);
SetGraphicRect(LEFT, 0, 0, 192, 320);
TextOutA("\c[YELLOW]pero me agrada!");
TextOutA("\c[YELLOW]Vamos alla!");

DeleteMusic(GetCurrentScriptDirectory ~ "dance.mp3");
PlayMusic(GetCurrentScriptDirectory ~ "Spell\yuugi.mp3");


End;
}

@Finalize{
DeleteGraphic(Yui);
DeleteGraphic(angry);
DeleteGraphic(normal);
DeleteGraphic(happy);
DeleteGraphic(eh);
DeleteGraphic(oh);
DeleteGraphic(seria);
DeleteGraphic(uu);
DeleteSE(cat);
 }
}