task SpiritPointGauge
{
	BerFrame;
	Ber;

	task Ber
	{
	let imgBer = GetCurrentScriptDirectory() ~ "img/ber2.png";
	let obj = ObjPrim_Create(OBJ_PRIMITIVE_2D);
	ObjPrim_SetTexture(obj, imgBer);
	ObjPrim_SetPrimitiveType(obj, PRIMITIVE_TRIANGLEFAN);
	ObjPrim_SetVertexCount(obj, 4);
	ObjRender_SetBlendType(obj, BLEND_ADD_RGB);
	Obj_SetRenderPriorityI(obj,100);
	ObjRender_SetAngleZ(obj,0);

	ObjPrim_SetVertexPosition(obj, 0, 0, -3, 0);
	ObjPrim_SetVertexPosition(obj, 1, 142, -3, 0);
	ObjPrim_SetVertexPosition(obj, 2, 142, 3, 0);
	ObjPrim_SetVertexPosition(obj, 3, 0, 3, 0);

	ObjPrim_SetVertexUVT(obj, 0, 6, 51);
	ObjPrim_SetVertexUVT(obj, 1, 148, 51);
	ObjPrim_SetVertexUVT(obj, 2, 148, 57);
	ObjPrim_SetVertexUVT(obj, 3, 6,57);

	let Scale=1;

	ObjRender_SetPosition(obj,430+60,150,0);

	ObjRender_SetColor(obj,255,255,196);

	loop
	{
		Scale=SpiritPoint/100;
		ObjRender_SetScaleXYZ(obj,Scale,1,1);
		yield;
	}

	Obj_Delete(obj);
	}

	task BerFrame
	{
	let imgBer = GetCurrentScriptDirectory() ~ "img/ber2.png";
	let obj = ObjPrim_Create(OBJ_PRIMITIVE_2D);
	ObjPrim_SetTexture(obj, imgBer);
	ObjPrim_SetPrimitiveType(obj, PRIMITIVE_TRIANGLEFAN);
	ObjPrim_SetVertexCount(obj, 4);
//	ObjRender_SetBlendType(obj, BLEND_ADD_RGB);
	Obj_SetRenderPriorityI(obj,100);
	ObjRender_SetAngleZ(obj,0);

	ObjPrim_SetVertexPosition(obj, 0, 0, -5, 0);
	ObjPrim_SetVertexPosition(obj, 1, 142, -5, 0);
	ObjPrim_SetVertexPosition(obj, 2, 142, 5, 0);
	ObjPrim_SetVertexPosition(obj, 3, 0, 5, 0);

	ObjPrim_SetVertexUVT(obj, 0, 6, 37);
	ObjPrim_SetVertexUVT(obj, 1, 148, 37);
	ObjPrim_SetVertexUVT(obj, 2, 148, 47);
	ObjPrim_SetVertexUVT(obj, 3, 6, 47);

	ObjRender_SetPosition(obj,430+60,150,0);

	loop
	{
		yield;
	}

	Obj_Delete(obj);
	}
}

task SpellPointGauge
{

	BerFrame;
	Ber;

	task Ber
	{
	let imgBer = GetCurrentScriptDirectory() ~ "img/ber2.png";
	let obj = ObjPrim_Create(OBJ_PRIMITIVE_2D);
	ObjPrim_SetTexture(obj, imgBer);
	ObjPrim_SetPrimitiveType(obj, PRIMITIVE_TRIANGLEFAN);
	ObjPrim_SetVertexCount(obj, 4);
	ObjRender_SetBlendType(obj, BLEND_ADD_RGB);
	Obj_SetRenderPriorityI(obj,100);
	ObjRender_SetAngleZ(obj,0);

	ObjPrim_SetVertexPosition(obj, 0, 0, -3, 0);
	ObjPrim_SetVertexPosition(obj, 1, 142, -3, 0);
	ObjPrim_SetVertexPosition(obj, 2, 142, 3, 0);
	ObjPrim_SetVertexPosition(obj, 3, 0, 3, 0);

	ObjPrim_SetVertexUVT(obj, 0, 6, 51);
	ObjPrim_SetVertexUVT(obj, 1, 148, 51);
	ObjPrim_SetVertexUVT(obj, 2, 148, 57);
	ObjPrim_SetVertexUVT(obj, 3, 6,57);

	let Scale=1;

	ObjRender_SetPosition(obj,430+60,110,0);

	ObjRender_SetColor(obj,196,255,196);

	loop
	{
		Scale=SpellPoint/100;
		ObjRender_SetScaleXYZ(obj,Scale,1,1);
		yield;
	}

	Obj_Delete(obj);
	}

	task BerFrame
	{
	let imgBer = GetCurrentScriptDirectory() ~ "img/ber2.png";
	let obj = ObjPrim_Create(OBJ_PRIMITIVE_2D);
	ObjPrim_SetTexture(obj, imgBer);
	ObjPrim_SetPrimitiveType(obj, PRIMITIVE_TRIANGLEFAN);
	ObjPrim_SetVertexCount(obj, 4);
//	ObjRender_SetBlendType(obj, BLEND_ADD_RGB);
	Obj_SetRenderPriorityI(obj,100);
	ObjRender_SetAngleZ(obj,0);

	ObjPrim_SetVertexPosition(obj, 0, 0, -5, 0);
	ObjPrim_SetVertexPosition(obj, 1, 142, -5, 0);
	ObjPrim_SetVertexPosition(obj, 2, 142, 5, 0);
	ObjPrim_SetVertexPosition(obj, 3, 0, 5, 0);

	ObjPrim_SetVertexUVT(obj, 0, 6, 37);
	ObjPrim_SetVertexUVT(obj, 1, 148, 37);
	ObjPrim_SetVertexUVT(obj, 2, 148, 47);
	ObjPrim_SetVertexUVT(obj, 3, 6, 47);

	ObjRender_SetPosition(obj,430+60,110,0);

	loop
	{
		yield;
	}

	Obj_Delete(obj);
	}
}

task ShieldGauge
{

	BerFrame;
	Ber;

	task Ber
	{
	let imgBer = GetCurrentScriptDirectory() ~ "img/ber2.png";
	let obj = ObjPrim_Create(OBJ_PRIMITIVE_2D);
	ObjPrim_SetTexture(obj, imgBer);
	ObjPrim_SetPrimitiveType(obj, PRIMITIVE_TRIANGLEFAN);
	ObjPrim_SetVertexCount(obj, 4);
	ObjRender_SetBlendType(obj, BLEND_ADD_RGB);
	Obj_SetRenderPriorityI(obj,100);
	ObjRender_SetAngleZ(obj,0);

	ObjPrim_SetVertexPosition(obj, 0, 0, -3, 0);
	ObjPrim_SetVertexPosition(obj, 1, 142, -3, 0);
	ObjPrim_SetVertexPosition(obj, 2, 142, 3, 0);
	ObjPrim_SetVertexPosition(obj, 3, 0, 3, 0);

	ObjPrim_SetVertexUVT(obj, 0, 6, 51);
	ObjPrim_SetVertexUVT(obj, 1, 148, 51);
	ObjPrim_SetVertexUVT(obj, 2, 148, 57);
	ObjPrim_SetVertexUVT(obj, 3, 6,57);

	let Scale=1;

	ObjRender_SetPosition(obj,430+60,70,0);

	ObjRender_SetColor(obj,196,196,255);

	loop
	{
		if(PlayerShield){Scale=1;}
		else
		{
		Scale=ShieldCount/ShieldGaugeMax;
		}
		ObjRender_SetScaleXYZ(obj,Scale,1,1);
		yield;
	}

	Obj_Delete(obj);
	}

	task BerFrame
	{
	let imgBer = GetCurrentScriptDirectory() ~ "img/ber2.png";
	let obj = ObjPrim_Create(OBJ_PRIMITIVE_2D);
	ObjPrim_SetTexture(obj, imgBer);
	ObjPrim_SetPrimitiveType(obj, PRIMITIVE_TRIANGLEFAN);
	ObjPrim_SetVertexCount(obj, 4);
//	ObjRender_SetBlendType(obj, BLEND_ADD_RGB);
	Obj_SetRenderPriorityI(obj,100);
	ObjRender_SetAngleZ(obj,0);

	ObjPrim_SetVertexPosition(obj, 0, 0, -5, 0);
	ObjPrim_SetVertexPosition(obj, 1, 142, -5, 0);
	ObjPrim_SetVertexPosition(obj, 2, 142, 5, 0);
	ObjPrim_SetVertexPosition(obj, 3, 0, 5, 0);

	ObjPrim_SetVertexUVT(obj, 0, 6, 37);
	ObjPrim_SetVertexUVT(obj, 1, 148, 37);
	ObjPrim_SetVertexUVT(obj, 2, 148, 47);
	ObjPrim_SetVertexUVT(obj, 3, 6, 47);

	ObjRender_SetPosition(obj,430+60,70,0);

	loop
	{
		yield;
	}

	Obj_Delete(obj);
	}
}