I moved from Massachusetts where if someone threatens you anywhere your duty to the law is to lube up and take what's coming and I moved to New Hampshire where we have stand your ground and castle doctrine with no duty to retreat and no civil liability if involved in a justified shooting.Not likely, but. The wording of your state statutes contain the answers. Castle Doctrine laws generally give you the presumption that the person forcibly entering intends violence, and a presumption that the occupants are in peril of death or great bodily harm. Also your statutes may permit deadly force to stop the imminent commission of a forcible felony. Does your state have a stand your ground law, or are you expected to flee before resorting to deadly force? Know the law where you live.
I myself would always try and avoid an altercation in public as I'd rather walk away from an issue that has the potential to escalate then try to prove something was justified even with the law written on your side because interpretation of even a justified direct action can get you into some real legal drama proving your side of the story.
Too many people read the simple statement of a written law and think they will be safe from prosecution not realizing that even the facts can be twisted against you by the police and courts making a legal defensive encounter now a major felony.