CbtEn wrote:
What is the algorithm for gun repairs when there are damaged guns on both sides of the ship or both stern and bow of a ship? How does the computer decide which guns to repair first?
Priority: Most Damaged First
The repairGuns() function scans all damaged gun sections and picks the one with the greatest damage (original count minus current count). Damage is checked in this fixed order:
1. port bow guns 2. starboard bow 3. port stern 4. starboard stern
Tiebreaker: When two sections have equal damage, a die roll (50/50) decides whether the later section displaces the current leader.
Carronades are a Fallback Only if no regular guns need repair does the function run the same algorithm over the four carronade sections. Regular guns always take priority over carronades.
|