Once you die, your equipment stays on your corpse, other than a PDA, which is needed to play the game, so it is provided for you automatically after being reconstituted on your ship.
The problem becomes that you now have no gun, unless you left one or more in your ship's weapons locker before going on previous missions.
In linear missions where the player kills everything before dying, this might not be a big issue, but due to non-linearity, the fact that the player may not have killed all monsters, and that some monsters may spawn or wander nearthe player before he has found another weapon, we needed a way to fix this.
One idea was to respawn a pistol for the player always, but these would be next to useless on later levels.
Another idea was to respawn whatever was in the player's hands when he died, but this could allow the player to duplicate the best weapons in the game by dying on purpose.
So, I put in code this morning to save the weapon type of every weapon the player equips, and then added a weapon smithing station to the ship.
When at the smithing station, all weapons your player has equipped are found, and sorted by damage per second. The half of this list with the lowest DPS is available to create by the player. This way the best weapons remain on your corpse, but reasonable weapons are always available, and nicely track the player's progress through the game.
Certain weapons are always available to create once equipped, like the tractor beam gun and the force field gun which may be required for certain levels.
Here is a shot of the weapon creation station :
Next is to add the crystal creation station, the atomizer and the weapon junker.