let UdonNeut = GetCurrentScriptDirectory ~ "../img/cutins/reisen_neutral.png";
let UdonClosed = GetCurrentScriptDirectory ~ "../img/cutins/reisen_closed.png";
let UdonHappy = GetCurrentScriptDirectory ~ "../img/cutins/reisen_happy.png";
let UdonSmug = GetCurrentScriptDirectory ~ "../img/cutins/reisen_smug.png";
let UdonSerious = GetCurrentScriptDirectory ~ "../img/cutins/reisen_serious.png";
let UdonAngery = GetCurrentScriptDirectory ~ "../img/cutins/reisen_mad.png";

let AyaNeut = GetCurrentScriptDirectory ~ "../img/cutins/aya_neutral.png";
let AyaHappy = GetCurrentScriptDirectory ~ "../img/cutins/aya_happy.png";
let AyaSmug = GetCurrentScriptDirectory ~ "../img/cutins/aya_smug.png";
let AyaClosed = GetCurrentScriptDirectory ~ "../img/cutins/aya_closed.png";
let AyaSerious = GetCurrentScriptDirectory ~ "../img/cutins/aya_serious.png";

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

task dialogue(obj, chara, text){ // Stone age dialogue systems!
	ObjText_SetFontSize(obj, 12);
	ObjText_SetFontType(obj, "Andale Mono");
	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, 350);
	ObjRender_SetX(obj, 50);
	ObjRender_SetY(obj, 360);
	ObjText_SetFontBorderColor(obj, 50, 50, 50);

	if(chara == 1){ // Reisen.
		ObjText_SetText(obj, text);
		ObjText_SetFontColorTop(obj, 175, 175, 255);
		ObjText_SetFontColorBottom(obj, 175, 175, 175);
	}
	else if(chara == 2){ // Aya.
		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);
	ObjRender_SetBlendType(objBox, BLEND_MULTIPLY);
	
	while(!Obj_IsDeleted(objBox)){
		ObjRender_SetScaleXYZ(objBox, scale, 0.5, 0);
		if(scale < 1){
			scale=scale+0.03;
		}
		yield;
	}
}

task character(obj1, obj2, chara, image){
	
	ObjSprite2D_SetSourceRect(obj1, 0,0,256,512); // Reisen.
	ObjSprite2D_SetDestCenter(obj1);
	ObjRender_SetScaleXYZ(obj1, 1, 1, 0);
	ObjRender_SetAlpha(obj1, 255);
	Obj_SetRenderPriorityI(obj1, 50);
	
	ObjSprite2D_SetSourceRect(obj2, 0,0,256,512); // Aya.
	ObjSprite2D_SetDestCenter(obj2);
	ObjRender_SetScaleXYZ(obj2, 0.9, 0.9, 0);
	ObjRender_SetAlpha(obj2, 255);
	Obj_SetRenderPriorityI(obj2, 50);
	
	if(chara == 1){ // Player. (Reisen)
		ObjPrim_SetTexture(obj1, image);
		Obj_SetRenderPriorityI(obj1, 50);
		Obj_SetRenderPriorityI(obj2, 49);
		ObjRender_SetX(obj1, 120);
		ObjRender_SetX(obj2, 360);
		ObjRender_SetY(obj1, 340);
		ObjRender_SetY(obj2, 360);
		ObjRender_SetAngleXYZ(obj1, 0, 0, 0);
		ObjRender_SetColorHSV(obj1, 0, 1, 255);
		ObjRender_SetColorHSV(obj2, 0, 1, 70);
	}
	if(chara == 2){ // Boss. (Aya)
		Obj_SetVisible(obj2, true);
		Obj_SetRenderPriorityI(obj1, 49);
		Obj_SetRenderPriorityI(obj2, 50);
		ObjPrim_SetTexture(obj2, image);
		ObjRender_SetX(obj2, 340);
		ObjRender_SetX(obj1, 100);
		ObjRender_SetY(obj2, 340);
		ObjRender_SetY(obj1, 360);
		//ObjRender_SetAngleXYZ(obj2, 0, 180, 0);
		ObjRender_SetColorHSV(obj2, 0, 1, 255);
		ObjRender_SetColorHSV(obj1, 0, 1, 70);
	}
}