I am trying to write a sci-fi story in the near future where armies use mechas but I also want them to engage in close combat using swords.  

Here is what I came up with so far:  

An army could use an EMP thus rendering the mechas and laser guns ineffective.  

But what about traditional firearms...they could still resort to that.  

My question is how can one neutralize all these classical weapons from guns to grenades?