As mentioned above, self defense is an affirmative defense to a crime committed in the course of the act of self defense. It doesn't just apply to the crime of homicide, but any other crime, including discharging a gun in the city.
If it is a justifiable shooting, you won't be guilty of one without the other.