If you are a civilian, retired Cop or retired military and there is a terrorist attack, do your very best to get out of the area taking your family members and friends with you. You will be out gunned. You will not have any communications with the Police/First Responders and no one will know you are a good guy, you'll just be an unknown with a gun. You will not have your AR, Garand, Grenade Launcher or other neat stuff with you. You will not have Air Support nor Artillery. You will have an easy to carry handgun. There is the high likely hood that, at the least, you will tie up Police in trying to figure out who you are or, they might even kill you. If, if, by wild chance you get the opportunity to shoot a for sure bad guy, then do it. Then do your best to leave the area and consider yourself very lucky. After everything is over you can go to the local agency and report what you did.
The problem with this bolded portion of this response is that it's not a very accurate assessment of how it will probably go down.
If you look at the numbers over the last 10 years in mass shooting incidents, the killing is completed before the police arrive in vast majority of incidents. In about 20% of mass shootings the shooter goes mobile, and in another 20% or so he just walks away. In about half the cases where he's still around when the police arrive, he's likely to just kill himself. Which leaves a pretty small percentage of incidents where the police response is meaningful in terms of preventing deaths of civilians.
It's improving somewhat as more departments are training officers to take an immediate response and not simply evacuate the warm zone and contain the situation until the SWAT team arrives. The lessons have been learned over and over again that an immediate response by the first 1-3 officers on the scene are the best way to save lives. The downside of this immediate action approach however is that the responding officers get shot about 30% of the time.
I think we all agree that if escape is an option for you and your family, take it. But no one should ever make the mistake of thinking that the police are going to arrive in time to prevent anyone from getting killed or injured, as when all is said and done, when seconds count, the police at still going to be minutes away.
This is also the US, not the sandbox and the terrorist attacks in the US have ben notable in terms of the general ineptitude of would be bombers, and a general reliance on commonly available firearms, not full auto AK-47s, RPG-7s, etc.
Will you be outgunned with a handgun? Probably. But on the other hand the average domestic terrorists we've seen in the US have not been all that proficient with the firearms they have and a well trained armed citizen will be far more effective than most people tend to think.
The numbers indicate that even unarmed citizens do surprisingly well in ending mass shootings before the police arrive. Consider that between 2000 and 2010 of some 87 mass shootings, 24 ended with the police killing or subduing the shooter. In comparison 16 mass shootings were ended by the would be victims killing or subduing the shooter. In only 3 of those cases were the would be victims armed and able to kill the shooter with gun fire.
That's a reflection on that fact that only an estimated 1 in 20 adults in the US has a concealed carry permit, and that at best only half of those individuals are likely to conceal carry on a daily basis (and that estimate is probably high). On the other hand that 2.5% of the adult population is responsible for ending 19% of mass shootings ended by civilians, and 7.5% of all mass shootings ended by police or civilians. That's an over representation of 7.5 to 1 and 3 to 1 respectively.
That suggests the odds of an armed citizen ending a mass shooting or terrorist attack are actually quite good. You just need to be armed in the first place.