Fix of issue #2657: NX-17 charge rifles now work (more) properly. [Please review]

I fixed the issues I mentioned in issue #2657. 
I also made a few small changes in the mechanics of the charge rifle:
- You now have three safe turns (with warnings) at lvl 8 charge before the rifle can discharge. (Discharging can still kill you if you are unlucky and the target is chosen too close to you).
- You need a powered UPS to charge, and the rifle will start to loose charges once you power the UPS off.  It gives an easier way to stop charging but consumes a bit more power.

Issues left (which I didn't fix):
Damage/range etc. display for the charge rifle is incorrect.

It would be nice if someone could review this. I tested that it works as I expect, but it is my first contribution.

Also I am a bit unsure about code style. I used the command in CODE_STYLE.txt, but it doesn't seem to produce exactly the formating that is used elsewhere. If necessary I can go through it and update by hand, but I would prefer an updated astyle command if it exists.