In my game, spaceships need to have weapons with more than one purpose, due to the cost of hauling extra weight across interplanetary/interstellar space. My railgun needs to be able to fire plasma ampoules (for point defense), long rods of metal (for precision sniping), junk ampoules (for clogging up an enemy's orbit) and anti-armor bombs (self explanatory). How would a gun like this work?
Edit: I meant how can a railgun adapt to fire drastically different types of ammunition, for all of the ammunition are different sizes for maximum effect and need different "barrel" sizes for all of them. As far as I know, railguns have an enclosed barrel just like any regular cannon or gun, so is it possible to expand the barrel (with moving parts) without hurting speed or performance? If it isn't, I'll try to write in some fancy new technology that can multiply plasma or something.