I've decided I want a sword which in addition to being fully functional as a sword, can also fire energy ( or some other ammunition which can be produced when needed as opposed to being carried around) at enemies.
About the specs: -It is essentially a longsword with internal machinery, regular sword handle and all
-It should preferably be able to fire a continuous beam as well as individual bolts
-Preferably no openings in the sword that lead to the inner machinery
-Assume sufficiently advanced materials to account for the sword remaining durable, UNLESS you have a more realistic idea what it could be made of
-The actual nanotech of the sword should build on some existing scientific principle
-Energy supply may or may not be internal, although I'm leaning towards it being external
Given these criteria, how do I build this monstrosity of a weapon?
EDIT: Changed plasma cannon to energy rifle as it's a broader term for the kind for "ammo" I'm looking for, clarified a few things