
task Pdraw//Powerを画面右に表示させるエフェクトタスク
{
while(GetCommonDataDefault("BONUSPOINT",0)==0){yield;}
loop{
let Pnum1=truncate(Power%10000/1000);
let Pnum2=truncate(Power%1000/100);
let Pnum3=truncate(Power%100/10);
let Pnum4=truncate(Power%10);
		let bx1=GetClipMaxX+100;
		let by1=GetCenterY-62;
		let scax=1.2;
		let scay=1.2;
		let obj = Obj_Create(OBJ_EFFECT);
		ObjEffect_SetTexture(obj, imgBorder);
		ObjEffect_SetPrimitiveType(obj, PRIMITIVE_TRIANGLEFAN);
		ObjEffect_SetRenderState(obj, ADD); 
		ObjEffect_CreateVertex(obj, 4);
		ObjEffect_SetVertexXY(obj, 0, -7, -8);
		ObjEffect_SetVertexXY(obj, 1, 7,  -8);
		ObjEffect_SetVertexXY(obj, 2, 7, 8);
		ObjEffect_SetVertexXY(obj, 3,  -7,  8);
		
		ObjEffect_SetVertexUV(obj, 0,  2+Pnum1*14,  114);
		ObjEffect_SetVertexUV(obj, 1,  14+Pnum1*14, 114);
		ObjEffect_SetVertexUV(obj, 2, 14+Pnum1*14,  131);
		ObjEffect_SetVertexUV(obj, 3, 2+Pnum1*14, 131);
		
		ObjEffect_SetScale(obj, scax,scay);
		Obj_SetPosition(obj,bx1,by1);
		ObjEffect_SetLayer(obj,8);

		let bx2=GetClipMaxX+128;
		let by2=GetCenterY-62;
		let obj2 = Obj_Create(OBJ_EFFECT);
		ObjEffect_SetTexture(obj2, imgBorder);
		ObjEffect_SetPrimitiveType(obj2, PRIMITIVE_TRIANGLEFAN);
		ObjEffect_SetRenderState(obj2, ADD); 
		ObjEffect_CreateVertex(obj2, 4);
		ObjEffect_SetVertexXY(obj2, 0, -7, -8);
		ObjEffect_SetVertexXY(obj2, 1, 7,  -8);
		ObjEffect_SetVertexXY(obj2, 2, 7, 8);
		ObjEffect_SetVertexXY(obj2, 3,  -7,  8);
		
		ObjEffect_SetVertexUV(obj2, 0,  2+Pnum2*14,  114);
		ObjEffect_SetVertexUV(obj2, 1,  14+Pnum2*14, 114);
		ObjEffect_SetVertexUV(obj2, 2, 14+Pnum2*14,  131);
		ObjEffect_SetVertexUV(obj2, 3, 2+Pnum2*14, 131);
		
		Obj_SetPosition(obj2,bx2,by2);
		ObjEffect_SetLayer(obj2,8);
		ObjEffect_SetScale(obj2, 0.8,1.0);

		let bx3=GetClipMaxX+144;
		let by3=GetCenterY-62;
		let obj3 = Obj_Create(OBJ_EFFECT);
		ObjEffect_SetTexture(obj3, imgBorder);
		ObjEffect_SetPrimitiveType(obj3, PRIMITIVE_TRIANGLEFAN);
		ObjEffect_SetRenderState(obj3, ADD); 
		ObjEffect_CreateVertex(obj3, 4);
		ObjEffect_SetVertexXY(obj3, 0, -7, -8);
		ObjEffect_SetVertexXY(obj3, 1, 7,  -8);
		ObjEffect_SetVertexXY(obj3, 2, 7, 8);
		ObjEffect_SetVertexXY(obj3, 3,  -7,  8);
		
		ObjEffect_SetVertexUV(obj3, 0,  2+Pnum3*14,  114);
		ObjEffect_SetVertexUV(obj3, 1,  14+Pnum3*14, 114);
		ObjEffect_SetVertexUV(obj3, 2, 14+Pnum3*14,  131);
		ObjEffect_SetVertexUV(obj3, 3, 2+Pnum3*14, 131);
		
		Obj_SetPosition(obj3,bx3,by3);
		ObjEffect_SetLayer(obj3,8);
		ObjEffect_SetScale(obj3, 0.8,1.0);

		let bx5=GetClipMaxX+160;
		let by5=GetCenterY-62;
		let obj5 = Obj_Create(OBJ_EFFECT);
		ObjEffect_SetTexture(obj5, imgBorder);
		ObjEffect_SetPrimitiveType(obj5, PRIMITIVE_TRIANGLEFAN);
		ObjEffect_SetRenderState(obj5, ADD); 
		ObjEffect_CreateVertex(obj5, 4);
		ObjEffect_SetVertexXY(obj5, 0, -7, -8);
		ObjEffect_SetVertexXY(obj5, 1, 7,  -8);
		ObjEffect_SetVertexXY(obj5, 2, 7, 8);
		ObjEffect_SetVertexXY(obj5, 3,  -7,  8);
		
		ObjEffect_SetVertexUV(obj5, 0,  2+Pnum4*14,  114);
		ObjEffect_SetVertexUV(obj5, 1,  14+Pnum4*14, 114);
		ObjEffect_SetVertexUV(obj5, 2, 14+Pnum4*14,  131);
		ObjEffect_SetVertexUV(obj5, 3, 2+Pnum4*14, 131);
		
		Obj_SetPosition(obj5,bx5,by5);
		ObjEffect_SetLayer(obj5,8);
		ObjEffect_SetScale(obj5, 0.8,1.0);


		let bx4=GetClipMaxX+120;
		let by4=GetCenterY-62;
		let obj4 = Obj_Create(OBJ_EFFECT);
		ObjEffect_SetTexture(obj4, imgBorder);
		ObjEffect_SetPrimitiveType(obj4, PRIMITIVE_TRIANGLEFAN);
		ObjEffect_SetRenderState(obj4, ADD); 
		ObjEffect_CreateVertex(obj4, 4);
		ObjEffect_SetVertexXY(obj4, 0, -7, -8);
		ObjEffect_SetVertexXY(obj4, 1, 7,  -8);
		ObjEffect_SetVertexXY(obj4, 2, 7, 8);
		ObjEffect_SetVertexXY(obj4, 3,  -7,  8);
		
		ObjEffect_SetVertexUV(obj4, 0,  2+10*14,  114);
		ObjEffect_SetVertexUV(obj4, 1,  14+10*14, 114);
		ObjEffect_SetVertexUV(obj4, 2, 14+10*14,  131);
		ObjEffect_SetVertexUV(obj4, 3, 2+10*14, 131);
		
		Obj_SetPosition(obj4,bx4,by4);
		ObjEffect_SetLayer(obj4,8);
		ObjEffect_SetScale(obj4, 0.8,1.0);

		yield;
		Obj_Delete(obj);
		Obj_Delete(obj2);
		Obj_Delete(obj3);
		Obj_Delete(obj4);
		Obj_Delete(obj5);
}
}


task OverHeatdraw//OverHeatを画面右に表示させるエフェクトタスク
{
let R;
let G;
let B;
let dy=45;
while(GetCommonDataDefault("BONUSPOINT",0)==0){yield;}
loop{
if(GetCommonDataDefault("SELECTEDDIFFICULT","None")!="Extra")
{
return;
}
let Pnum1=truncate(heat%10000/1000);
let Pnum2=truncate(heat%1000/100);
let Pnum3=truncate(heat%100/10);
let Pnum4=truncate(heat%10);
		let bx1=GetClipMaxX+100;
		let by1=GetCenterY-dy;
		let scax=0.8;
		let scay=0.8;
		let scax2=0.6;
		let scay2=0.75;

		if(overheaton==false)
		{
		R=150;
		G=150;
		B=255;
		}
		else
		{
		R=255;
		G=150;
		B=150;
		}
		let obj = Obj_Create(OBJ_EFFECT);
		ObjEffect_SetTexture(obj, imgBorder);
		ObjEffect_SetPrimitiveType(obj, PRIMITIVE_TRIANGLEFAN);
		ObjEffect_SetRenderState(obj, ADD); 
		ObjEffect_CreateVertex(obj, 4);
		ObjEffect_SetVertexXY(obj, 0, -7, -8);
		ObjEffect_SetVertexXY(obj, 1, 7,  -8);
		ObjEffect_SetVertexXY(obj, 2, 7, 8);
		ObjEffect_SetVertexXY(obj, 3,  -7,  8);
		
		ObjEffect_SetVertexUV(obj, 0,  2+Pnum1*14,  114);
		ObjEffect_SetVertexUV(obj, 1,  14+Pnum1*14, 114);
		ObjEffect_SetVertexUV(obj, 2, 14+Pnum1*14,  131);
		ObjEffect_SetVertexUV(obj, 3, 2+Pnum1*14, 131);

		ObjEffect_SetVertexColor(obj,0,255,R,G,B);
		ObjEffect_SetVertexColor(obj,1,255,R,G,B);
		ObjEffect_SetVertexColor(obj,2,255,R,G,B);
		ObjEffect_SetVertexColor(obj,3,255,R,G,B);
		
		ObjEffect_SetScale(obj, scax,scay);
		Obj_SetPosition(obj,bx1,by1);
		ObjEffect_SetLayer(obj,8);

		let bx2=GetClipMaxX+128;
		let by2=GetCenterY-dy;
		let obj2 = Obj_Create(OBJ_EFFECT);
		ObjEffect_SetTexture(obj2, imgBorder);
		ObjEffect_SetPrimitiveType(obj2, PRIMITIVE_TRIANGLEFAN);
		ObjEffect_SetRenderState(obj2, ADD); 
		ObjEffect_CreateVertex(obj2, 4);
		ObjEffect_SetVertexXY(obj2, 0, -7, -8);
		ObjEffect_SetVertexXY(obj2, 1, 7,  -8);
		ObjEffect_SetVertexXY(obj2, 2, 7, 8);
		ObjEffect_SetVertexXY(obj2, 3,  -7,  8);
		
		ObjEffect_SetVertexUV(obj2, 0,  2+Pnum2*14,  114);
		ObjEffect_SetVertexUV(obj2, 1,  14+Pnum2*14, 114);
		ObjEffect_SetVertexUV(obj2, 2, 14+Pnum2*14,  131);
		ObjEffect_SetVertexUV(obj2, 3, 2+Pnum2*14, 131);
		
		ObjEffect_SetVertexColor(obj2,0,255,R,G,B);
		ObjEffect_SetVertexColor(obj2,1,255,R,G,B);
		ObjEffect_SetVertexColor(obj2,2,255,R,G,B);
		ObjEffect_SetVertexColor(obj2,3,255,R,G,B);

		Obj_SetPosition(obj2,bx2,by2);
		ObjEffect_SetLayer(obj2,8);
		ObjEffect_SetScale(obj2, scax2,scay2);

		let bx3=GetClipMaxX+144;
		let by3=GetCenterY-dy;
		let obj3 = Obj_Create(OBJ_EFFECT);
		ObjEffect_SetTexture(obj3, imgBorder);
		ObjEffect_SetPrimitiveType(obj3, PRIMITIVE_TRIANGLEFAN);
		ObjEffect_SetRenderState(obj3, ADD); 
		ObjEffect_CreateVertex(obj3, 4);
		ObjEffect_SetVertexXY(obj3, 0, -7, -8);
		ObjEffect_SetVertexXY(obj3, 1, 7,  -8);
		ObjEffect_SetVertexXY(obj3, 2, 7, 8);
		ObjEffect_SetVertexXY(obj3, 3,  -7,  8);
		
		ObjEffect_SetVertexUV(obj3, 0,  2+Pnum3*14,  114);
		ObjEffect_SetVertexUV(obj3, 1,  14+Pnum3*14, 114);
		ObjEffect_SetVertexUV(obj3, 2, 14+Pnum3*14,  131);
		ObjEffect_SetVertexUV(obj3, 3, 2+Pnum3*14, 131);

		ObjEffect_SetVertexColor(obj3,0,255,R,G,B);
		ObjEffect_SetVertexColor(obj3,1,255,R,G,B);
		ObjEffect_SetVertexColor(obj3,2,255,R,G,B);
		ObjEffect_SetVertexColor(obj3,3,255,R,G,B);
		
		Obj_SetPosition(obj3,bx3,by3);
		ObjEffect_SetLayer(obj3,8);
		ObjEffect_SetScale(obj3, scax2,scay2);

		let bx5=GetClipMaxX+160;
		let by5=GetCenterY-dy;
		let obj5 = Obj_Create(OBJ_EFFECT);
		ObjEffect_SetTexture(obj5, imgBorder);
		ObjEffect_SetPrimitiveType(obj5, PRIMITIVE_TRIANGLEFAN);
		ObjEffect_SetRenderState(obj5, ADD); 
		ObjEffect_CreateVertex(obj5, 4);
		ObjEffect_SetVertexXY(obj5, 0, -7, -8);
		ObjEffect_SetVertexXY(obj5, 1, 7,  -8);
		ObjEffect_SetVertexXY(obj5, 2, 7, 8);
		ObjEffect_SetVertexXY(obj5, 3,  -7,  8);
		
		ObjEffect_SetVertexUV(obj5, 0,  2+Pnum4*14,  114);
		ObjEffect_SetVertexUV(obj5, 1,  14+Pnum4*14, 114);
		ObjEffect_SetVertexUV(obj5, 2, 14+Pnum4*14,  131);
		ObjEffect_SetVertexUV(obj5, 3, 2+Pnum4*14, 131);

		ObjEffect_SetVertexColor(obj5,0,255,R,G,B);
		ObjEffect_SetVertexColor(obj5,1,255,R,G,B);
		ObjEffect_SetVertexColor(obj5,2,255,R,G,B);
		ObjEffect_SetVertexColor(obj5,3,255,R,G,B);
		
		Obj_SetPosition(obj5,bx5,by5);
		ObjEffect_SetLayer(obj5,8);
		ObjEffect_SetScale(obj5, scax2,scay2);


		let bx4=GetClipMaxX+120;
		let by4=GetCenterY-dy;
		let obj4 = Obj_Create(OBJ_EFFECT);
		ObjEffect_SetTexture(obj4, imgBorder);
		ObjEffect_SetPrimitiveType(obj4, PRIMITIVE_TRIANGLEFAN);
		ObjEffect_SetRenderState(obj4, ADD); 
		ObjEffect_CreateVertex(obj4, 4);
		ObjEffect_SetVertexXY(obj4, 0, -7, -8);
		ObjEffect_SetVertexXY(obj4, 1, 7,  -8);
		ObjEffect_SetVertexXY(obj4, 2, 7, 8);
		ObjEffect_SetVertexXY(obj4, 3,  -7,  8);
		
		ObjEffect_SetVertexUV(obj4, 0,  2+10*14,  114);
		ObjEffect_SetVertexUV(obj4, 1,  14+10*14, 114);
		ObjEffect_SetVertexUV(obj4, 2, 14+10*14,  131);
		ObjEffect_SetVertexUV(obj4, 3, 2+10*14, 131);

		ObjEffect_SetVertexColor(obj4,0,255,R,G,B);
		ObjEffect_SetVertexColor(obj4,1,255,R,G,B);
		ObjEffect_SetVertexColor(obj4,2,255,R,G,B);
		ObjEffect_SetVertexColor(obj4,3,255,R,G,B);
		
		Obj_SetPosition(obj4,bx4,by4);
		ObjEffect_SetLayer(obj4,8);
		ObjEffect_SetScale(obj4, scax2,scay2);

		yield;
		Obj_Delete(obj);
		Obj_Delete(obj2);
		Obj_Delete(obj3);
		Obj_Delete(obj4);
		Obj_Delete(obj5);
}
}