I created a custom starship with an attack of 42 (beam). It opened fire with around 27/75 hitpoints left. The defending Yor Frigate was destroyed, but had a chance to return fire. My ship was reduced to 1 hitpoint. When I went back to the main map, the ship had full hitpoints.
What's going on here?