LOGIN
User Name
Password
Remember me


Register...Forgot password?
Main menu
Leagues
Gonzaga
Blue Max
Cartagena
Wooden Ships...
King Me!
VampiRing
Forum Message
Previous messagePost a replyNext message

Country:US
Membership23years 139days ago.
Last Login8h 29' ago.
Last Move15h 29' ago.
Electro is currently Offline!Send a mail to Electro


Message header
Area/Game:Wooden Ships & Iron Men
Topic:Other
Subject:Re: Gun repair algorithm
Posted by: Electro - 120days 6h ago.
Message text
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.


Back to the messages list
Messages thread
Posting elapsed timePosted bySubject

120days 12h CbtEn [WS&IM][OT] Gun repair algorithm
120days 6h Electro Re: [WS&IM][OT] Gun repair algorithm
Next thread
Posting elapsed timePosted bySubject

113days 6h markrendl [BM][BUG] Shot down by Observer - in a single seater
112days 9h Electro Re: [BM][BUG] Shot down by Observer - in a single seater
Previous thread
Posting elapsed timePosted bySubject

123days 8h Electro [SYS] Site Modernization
123days 6h markrendl Re: [SYS] Site Modernization
 123days 5h Electro Re: [SYS] Site Modernization
  123days 5h markrendl Re: [SYS] Site Modernization
   123days 4h Electro Re: [SYS] Site Modernization
    123days 1h markrendl Re: [SYS] Site Modernization
     122days 20h markrendl Re: [SYS] Site Modernization
      122days 12h Electro Re: [SYS] Site Modernization
       121days 16h markrendl Re: [SYS] Site Modernization
Page generated in: 19.89746 milliseconds.