You then are cloned as a robot, and must either stay in disguise or fight your way through the scrapyard level in order to find the parts to repair your ship & leave.
It was a bit complicated to get all the spawning / saving / restarting / cloning stuff working in a special way for these two levels, since normally you go back to the ship after each level. In this case, I made a special 'invaded ship' level with robots on there, and missing equipment.
I revisited the accuracy code today, and improved that quite a bit. There are two steps to the accuracy - the first is your gun's aim getting displaced by a random vector each game tick - this increases with your velocity and your gun's default accuracy, along with any switching weapon penalty, and the per-shot penalty.
Next is your character's ability to restore the accuracy error. Each tick, he figures out what the restoring vector is needed to fix the aim, and your current accuracy percentage is used to scale this vector, so 100% accuracy will fix the aim perfectly.
The old system was similar, but had characteristics such that your aim tended to wander off to the side for a while during low accuracy situations. The new code doesn't have that issue, and is more robust to varying frame rates.
This also helped out the AI, which was having trouble aiming while moving. Now I can probably skip putting in code for the AI to hold fire when accuracy gets too low.
I also made a few more gui tweaks, like making the unused inventory slots less noticable, and adding a background for the health / shield indicators.