let Sanae_Norm = GetCurrentScriptDirectory ~ "../img/cutins/sanaenorm.png";
let Sanae_Sweat = GetCurrentScriptDirectory ~ "../img/cutins/sanaesweat.png";
let Sanae_Happy = GetCurrentScriptDirectory ~ "../img/cutins/sanaehappy.png";
let Sanae_Confu = GetCurrentScriptDirectory ~ "../img/cutins/sanaeconfu.png";
let Sanae_Star = GetCurrentScriptDirectory ~ "../img/cutins/sanaestar.png";
let Sanae_Smug = GetCurrentScriptDirectory ~ "../img/cutins/sanaesmug.png";

let Doremy_Norm = GetCurrentScriptDirectory ~ "../img/cutins/doremynorm.png";
let Doremy_Happy = GetCurrentScriptDirectory ~ "../img/cutins/doremyhappy.png";
let Doremy_Shock = GetCurrentScriptDirectory ~ "../img/cutins/doremyshock.png";
let Doremy_Smug = GetCurrentScriptDirectory ~ "../img/cutins/doremysmug.png";
let Doremy_Cute = GetCurrentScriptDirectory ~ "../img/cutins/doremykawaii.png";

let Junko_Happy = GetCurrentScriptDirectory ~ "../img/cutins/junkohappy.png";
let Junko_Sad = GetCurrentScriptDirectory ~ "../img/cutins/junkosad.png";
let Junko_Shout = GetCurrentScriptDirectory ~ "../img/cutins/junkoshout.png";
let Junko_Smug = GetCurrentScriptDirectory ~ "../img/cutins/junkosmug.png";

let box = GetCurrentScriptDirectory ~ "../img/cutins/box.png";

task dialogue(obj, chara, text){ // Primitve dialogue systems!
	ObjText_SetFontSize(obj, 12);
	ObjText_SetFontType(obj, "AndaleMono");
	ObjText_SetFontBold(obj, false);
	ObjText_SetFontBorderType(obj, BORDER_FULL);
	ObjText_SetFontBorderWidth(obj, 1);
	Obj_SetRenderPriorityI(obj, 75);
	ObjText_SetHorizontalAlignment(obj, ALIGNMENT_LEFT);
	ObjText_SetMaxWidth(obj, 300);
	ObjRender_SetX(obj, 70);
	ObjRender_SetY(obj, 360);
	ObjText_SetFontBorderColor(obj, 50, 50, 50);

	if(chara == 1){ // Byakuren.
		ObjText_SetText(obj, text);
		ObjText_SetFontColorTop(obj, 200, 50, 255);
		ObjText_SetFontColorBottom(obj, 175, 175, 175);
	}
	else if(chara == 2){ // Miko.
		ObjText_SetText(obj, text);
		ObjText_SetFontColorTop(obj, 255, 200, 0);
		ObjText_SetFontColorBottom(obj, 175, 175, 175);
	}
}

task DialogueBox(objBox){
	let scale = 0.1;
	
	ObjPrim_SetTexture(objBox, box);
	ObjSprite2D_SetSourceRect(objBox, 0,0,384,128);
	ObjSprite2D_SetDestCenter(objBox);
	Obj_SetRenderPriorityI(objBox, 70);
	ObjRender_SetScaleXYZ(objBox, 0.1, 1.25, 0);
	ObjRender_SetAlpha(objBox, 155);
	ObjRender_SetX(objBox, GetStgFrameWidth/2);
	ObjRender_SetY(objBox, 382);
	
	while(!Obj_IsDeleted(objBox)){
		ObjRender_SetScaleXYZ(objBox, scale, 0.5, 0);
		if(scale < 1){
			scale=scale+0.03;
		}
		yield;
	}
}

task character(obj1, obj2, obj3, chara, image){
	
	ObjSprite2D_SetSourceRect(obj1, 0,1,380,630); // Byakuren.
	ObjSprite2D_SetDestCenter(obj1);
	ObjRender_SetScaleXYZ(obj1, 0.65, 0.65, 0);
	ObjRender_SetAlpha(obj1, 255);
	Obj_SetRenderPriorityI(obj1, 50);
	
	ObjSprite2D_SetSourceRect(obj2, 0,1,500,700); // Miko.
	ObjSprite2D_SetDestCenter(obj2);
	ObjRender_SetScaleXYZ(obj2, 0.65, 0.65, 0);
	ObjRender_SetAlpha(obj2, 255);
	Obj_SetRenderPriorityI(obj2, 50);
	
	if(chara == 1){ // Player. (Byakuren)
		ObjPrim_SetTexture(obj1, image);
		Obj_SetRenderPriorityI(obj1, 50);
		Obj_SetRenderPriorityI(obj2, 49);
		ObjRender_SetX(obj1, 120);
		ObjRender_SetX(obj2, 340);
		ObjRender_SetX(obj3, 340);
		ObjRender_SetY(obj1, 290);
		ObjRender_SetY(obj2, 310);
		ObjRender_SetY(obj3, 240);
		ObjRender_SetAngleXYZ(obj1, 0, 0, 0);
		ObjRender_SetColorHSV(obj1, 0, 1, 255);
		ObjRender_SetColorHSV(obj2, 0, 1, 70);
	}
	if(chara == 2){ // Boss. (Miko)
		Obj_SetVisible(obj2, true);
		Obj_SetRenderPriorityI(obj1, 49);
		Obj_SetRenderPriorityI(obj2, 50);
		ObjPrim_SetTexture(obj2, image);
		ObjRender_SetX(obj2, 320);
		ObjRender_SetX(obj1, 100);
		ObjRender_SetY(obj2, 290);
		ObjRender_SetY(obj1, 310);
		//ObjRender_SetAngleXYZ(obj2, 0, 180, 0);
		ObjRender_SetColorHSV(obj2, 0, 1, 255);
		ObjRender_SetColorHSV(obj1, 0, 1, 70);
	}
}