Self defense is a fact intensive inquiry.
True, if you are immediately engaged in a criminal act, your self defense claim is at least weakened if not barred. But you can resist being killed for shoplifting.
The general principles are force is to be proportional, and deadly force ONLY if there is reasonable apprehension of serious injury, death, or rape.
The rioters have about the same right to self defense, most of the time, while they are milling about, as the good guys.
jury done for the day