Theres way too many possible variables to answer this, but Ill try to condense it into three scenarios.
Im armed, assailant is unarmed - Id use the weapon as leverage and try to threaten them to stop. Most reasonable people would back down at the sight of a gun.
Im armed, assailant is armed - Id shoot first, providing I had a clear shot and an innocent person wouldnt get caught in the crossfire.
Im armed, assailant is unarmed and not responding to threats or pressure to stop - Id shoot. Again, providing I had a clear shot.
But really, anything can happen with multiple people involved and adrenaline is pumping. Who knows?