|
|
@@ -156,18 +156,18 @@ func (ls *LinkerStrategy) linkFriendlies(stars []*models.Star, flights []models. |
|
|
|
} |
|
|
|
|
|
|
|
func (ls *LinkerStrategy) sendHomiesBack(stars []*models.Star, flights []models.Flight, links []models.Link) { |
|
|
|
for i, s := range stars { |
|
|
|
for _, s := range stars { |
|
|
|
if s.OwnedByMe() && s.Captured() && ls.insufficientShipsForCapturing(s) && s.FlightsAllowed > 0 { |
|
|
|
richnessRoundsToCapture = capturingShipThreshold / s.Richness |
|
|
|
richnessRoundsToCapture := capturingShipThreshold / s.Richness |
|
|
|
|
|
|
|
if richnessRoundsToCapture == 0 { |
|
|
|
richnessRoundsToCapture = 1 |
|
|
|
} |
|
|
|
|
|
|
|
timeToCapture = s.Turns + (richnessRoundsToCapture - 1) * 5 |
|
|
|
capturingStar = stars[s.CapturedBy] |
|
|
|
distanceToOrigin = flightTurnDistance(capturingStar, s) |
|
|
|
if flightTurnDistance < timeToCapture { |
|
|
|
timeToCapture := s.Turns + (richnessRoundsToCapture - 1) * 5 |
|
|
|
capturingStar := stars[s.CapturedBy] |
|
|
|
distanceToOrigin := flightTurnDistance(capturingStar, s) |
|
|
|
if distanceToOrigin < timeToCapture { |
|
|
|
s.FlightsAllowed-- |
|
|
|
fmt.Printf("fly %d %d %d\n", s.Idx, capturingStar.Idx, s.Ships) |
|
|
|
} |