I would think the precedent of firearm response to a knife has been well settled in the courts, bring a knife to a gunfight, and you lose, first at the scene, then in civil and criminal court.
Voir Dire, selecting a jury, should work to keep the knuckleheads off a jury.
Getting to your question about mass shootings, so a guy pulls a Tanto short sword at the mall, and starts slicing up innocent shoppers. You pull a piece and shoot him, now he's in a wheelchair for the rest of his life. Do you think it's even going to trial? Any prosecutor who tried to paint you as less than a Very Good Guy is going to be out of office in short order, and he knows it.