task helper{
	let enemytarget=-1;
	let num=0;
	let pos=[0, 0];
	let ang=0;
	let charge=0;
	let obj=Obj_Create(OBJ_EFFECT);
	ObjEffect_SetTexture(obj, helperimg);
	ObjEffect_SetLayer(obj, 2);
	ObjEffect_SetPrimitiveType(obj, PRIMITIVE_TRIANGLESTRIP);
	ObjEffect_CreateVertex(obj, 4);
	while(Obj_BeDeleted(obj)==false){
		if(inplay==0){pos=[GetCenterX, GetClipMaxY-60];}
		Obj_SetPosition(obj, pos[0], pos[1]);
		if(GetCommonData("HELPER")=="NONE"){//////////////////////////////////////////////EMPTY
			ObjEffect_SetVertexUV(obj, 0, 0, 0);
			ObjEffect_SetVertexUV(obj, 1, 0, 0);
			ObjEffect_SetVertexUV(obj, 2, 0, 0);
			ObjEffect_SetVertexUV(obj, 3, 0, 0);
			ObjEffect_SetVertexXY(obj, 0, 0, 0);
			ObjEffect_SetVertexXY(obj, 1, 0, 0);
			ObjEffect_SetVertexXY(obj, 2, 0, 0);
			ObjEffect_SetVertexXY(obj, 3, 0, 0);
		}else if(GetCommonData("HELPER")=="RINNOSUKE"){////////////////////////////////////RINNOSUKE
			if(charge<1){charge+=1/180;}
			ObjEffect_SetVertexUV(obj, 0, 0, 0);
			ObjEffect_SetVertexUV(obj, 1, 64, 0);
			ObjEffect_SetVertexUV(obj, 2, 0, 64);
			ObjEffect_SetVertexUV(obj, 3, 64, 64);
			ObjEffect_SetVertexXY(obj, 0, -32, -32);
			ObjEffect_SetVertexXY(obj, 1, 32, -32);
			ObjEffect_SetVertexXY(obj, 2, -32, 32);
			ObjEffect_SetVertexXY(obj, 3, 32, 32);
			if(enemytarget==-1){
				if(GetEnemyNum>0){
					num=rand_int(EnumEnemyBegin, EnumEnemyEnd-1);
					enemytarget=EnumEnemyGetID(num);
				}else{
					if( ((GetCenterX-pos[0])^2+(GetCenterY-pos[1])^2)^0.5>2){
						ang=atan2(GetCenterY-pos[1], GetCenterX-pos[0]);
						pos=[pos[0]+2*cos(ang), pos[1]+2*sin(ang)];
					}
				}
			}else{
				if(GetEnemyInfoDefault(enemytarget, ENEMY_X, -1000)>GetClipMinX && GetEnemyInfoDefault(enemytarget, ENEMY_X, -1000)<GetClipMaxX
				&& GetEnemyInfoDefault(enemytarget, ENEMY_Y, -1000)>GetClipMinY && GetEnemyInfoDefault(enemytarget, ENEMY_Y, -1000)<GetClipMaxY){
					if(((GetEnemyInfoDefault(enemytarget, ENEMY_X, -1000)-pos[0])^2+(GetEnemyInfoDefault(enemytarget, ENEMY_Y, -1000)-pos[1])^2)^0.5>5){
						ang=atan2(GetEnemyInfoDefault(enemytarget, ENEMY_Y, -1000)-pos[1], GetEnemyInfoDefault(enemytarget, ENEMY_X, -1000)-pos[0]);
						pos=[pos[0]+2*cos(ang), pos[1]+2*sin(ang)];
					}
				}else{
					if( ((GetCenterX-pos[0])^2+(GetCenterY-pos[1])^2)^0.5>2){
						ang=atan2(GetCenterY-pos[1], GetCenterX-pos[0]);
						pos=[pos[0]+2*cos(ang), pos[1]+2*sin(ang)];
					}
				}
				if(GetEnemyInfoDefault(enemytarget, ENEMY_LIFE, 0)==0){enemytarget=-1;}
				if(charge>=1){RinCol(pos[0], pos[1]); charge=0;}
			}
		}
		yield;
	}
}

task RinCol(x, y){
	SetCommonData("ITEMCOLB", "TRUE");
	SetCommonData("ITEMCOL", [x,y]);
	let obj=Obj_Create(OBJ_EFFECT);
	Obj_SetPosition(obj, x, y);
	ObjEffect_SetTexture(obj, rinexploimg);
	ObjEffect_SetLayer(obj, 3);
	ObjEffect_SetPrimitiveType(obj, PRIMITIVE_TRIANGLESTRIP);
	ObjEffect_CreateVertex(obj, 4);
	ObjEffect_SetVertexUV(obj, 0, 0, 0);
	ObjEffect_SetVertexUV(obj, 1, 128, 0);
	ObjEffect_SetVertexUV(obj, 2, 0, 128);
	ObjEffect_SetVertexUV(obj, 3, 128, 128);
	ObjEffect_SetVertexXY(obj, 0, -64, -64);
	ObjEffect_SetVertexXY(obj, 1, 64, -64);
	ObjEffect_SetVertexXY(obj, 2, -64, 64);
	ObjEffect_SetVertexXY(obj, 3, 64, 64);
	ObjEffect_SetRenderState(obj, ADD);
	ascent(i in 0..20){
		ObjEffect_SetScale(obj, i/20, i/20);
		ObjEffect_SetAngle(obj, 0, 0, i*5);
		yield;
	}
	Obj_Delete(obj);
	SetCommonData("ITEMCOLB", "FALSE");
}