Browse Source

Fixed link strat errors

master
Khaled Nassar 4 years ago
parent
commit
ddc837e2d3
1 changed files with 6 additions and 6 deletions
  1. +6
    -6
      strategies/linker.go

+ 6
- 6
strategies/linker.go View File

@@ -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)
}

Loading…
Cancel
Save