Stable, entropy-consistent, and localized artificial-diffusivity method for capturing discontinuities