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" );

		LoadGraphic(imgBoss);
	}
	@MainLoop{
		if(!OnEvent()){AddLife(-GetLife);}
		yield;
		SetMovePosition02(GetCenterX, GetClipMinX+120, 1);
	}
	@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 defeat = GetCurrentScriptDirectory~"Img\talk\defeat.png";
let happy = GetCurrentScriptDirectory~"Img\talk\ReimuR2.png";
let normal = GetCurrentScriptDirectory~"Img\talk\ReimuR.png";
let eh = GetCurrentScriptDirectory~"Img\talk\ReimuR3.png";
let hm = GetCurrentScriptDirectory~"Img\talk\ReimuR4.png";
	
@Initialize{
LoadGraphic(defeat);
LoadGraphic(normal);
LoadGraphic(happy);
LoadGraphic(eh);
LoadGraphic(hm);
}

@MainLoop{
SetChar(RIGHT, defeat);
SetGraphicRect(RIGHT, 0, 0, 210, 320);
MoveChar(RIGHT, FRONT);
TextOutA("\c[WHITE]Ah! Que ha pasado?");
MoveChar(RIGHT, BACK);
SetChar(LEFT, happy);
SetGraphicRect(LEFT, 0, 0, 192, 320);
MoveChar(LEFT, FRONT);
TextOutA("\c[RED]Lo que pasa, es que aun no tienes \nexperiencia jovencita.");
MoveChar(LEFT, BACK);
SetChar(RIGHT, defeat);
SetGraphicRect(RIGHT, 0, 0, 210, 320);
MoveChar(RIGHT, FRONT);
TextOutA("\c[WHITE]Comprendo. \nPero escucha bien esto.");
SetChar(LEFT, normal);
SetGraphicRect(LEFT, 0, 0, 192, 320);
TextOutA("\c[WHITE]La proxima vez que nos encontremos, te derrotare!.");
MoveChar(RIGHT, BACK);
MoveChar(LEFT, FRONT);
TextOutA("\c[RED]Eso ya lo veremos");
TextOutA("\c[RED]Mejor vete a casa.");
SetChar(LEFT, happy);
SetGraphicRect(LEFT, 0, 0, 192, 320);
TextOutA("\c[RED]A menos que quieras un poco mas de \nbatalla");
MoveChar(LEFT, BACK);
SetChar(RIGHT, defeat);
SetGraphicRect(RIGHT, 0, 0, 210, 320);
MoveChar(RIGHT, FRONT);
TextOutA("\c[WHITE]No! \nYa tuve suficiente por hoy");
TextOutA("\c[WHITE]Sob!");




 End;
 }

@Finalize{
PlaySE("script\Yui\SE\death.wav");
DeleteGraphic(defeat);
DeleteGraphic(normal);
DeleteGraphic(happy);
DeleteGraphic(eh);
DeleteGraphic(hm);
 }
}