If turrets hit the mother-ship, they shouldn't fire in the first place.
Perhaps when leaving the shipyard, you should be able to "calibrate" your guns. Each square on the bounding box then has info about which turrets can aim at it without hitting the mother-ship.
Then you would just have to cast a shadow of the targets boundary box on your ships boundary box and know which turrets can hit it and where.
If you like this post, I make a suggestion of "Calibrate your guns"
When leaving the shipyard, you should be able to "calibrate" your guns.
Each square on the bounding box then has info about which turrets can aim at it without hitting the mother-ship.
Then you would just have to cast a shadow of the targets boundary box on your ships boundary box and know which turrets can hit it and where.
The "vanishing point" of the shadow is the gun position or a point relatively close to it.
The boundary box squares would have 3 quality ratings:
- Gun can aim without hitting the ship
- The gun should prefer other targets because there is a risk to hit the own ship based on calibration inaccuracies - gun-position/ship-centre deviation, etc.
- Gun can't aim without hitting the ship