Affine equation of state from quintessence and k-essence fields